-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Major changes in dependency management, docs, linting, and checks
- Loading branch information
1 parent
71b9099
commit 100de06
Showing
290 changed files
with
3,628 additions
and
3,123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.{py,toml}] | ||
indent_style = space | ||
indent_size = 4 | ||
|
||
[*.yml,yaml,json] | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: "setup-env" | ||
description: "Set up a Python environment with Poetry" | ||
|
||
inputs: | ||
python-version: | ||
required: false | ||
description: "The version of Python to use with Poetry" | ||
default: "3.11" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Set up python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ inputs.python-version }} | ||
|
||
- name: Install Poetry | ||
env: | ||
POETRY_VERSION: "1.8.4" | ||
run: curl -sSL https://install.python-poetry.org | python - -y | ||
shell: bash | ||
|
||
- name: Add Poetry to Path | ||
run: echo "$HOME/.local/bin" >> $GITHUB_PATH | ||
shell: bash | ||
|
||
- name: Configure Poetry virtual environment in project | ||
run: poetry config virtualenvs.in-project true | ||
shell: bash | ||
|
||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ inputs.python-version }}-${{ hashFiles('poetry.lock') }} | ||
|
||
- name: Install dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Main | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
types: [opened, synchronize, reopened, ready_for_review] | ||
|
||
jobs: | ||
quality: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out | ||
uses: actions/checkout@v4 | ||
|
||
- uses: actions/cache@v4 | ||
with: | ||
path: ~/.cache/pre-commit | ||
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} | ||
|
||
- name: Set up the environment | ||
uses: ./.github/actions/setup-env | ||
|
||
- name: Run checks | ||
run: make check | ||
|
||
check-docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up the environment | ||
uses: ./.github/actions/setup-env | ||
|
||
- name: Check if documentation can be built | ||
run: poetry run mkdocs build -s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Release | ||
|
||
on: | ||
release: | ||
types: [published] | ||
branches: [main] | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up the environment | ||
uses: ./.github/actions/setup-env | ||
|
||
- name: Export tag | ||
id: vars | ||
run: echo tag=${GITHUB_REF#refs/*/} >> $GITHUB_OUTPUT | ||
|
||
- name: Build and publish | ||
run: | | ||
source .venv/bin/activate | ||
poetry version $RELEASE_VERSION | ||
make build-and-publish | ||
env: | ||
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | ||
RELEASE_VERSION: ${{ steps.vars.outputs.tag }} | ||
deploy-docs: | ||
needs: publish | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Trigger documentation workflow | ||
uses: benc-uk/workflow-dispatch@v1 | ||
with: | ||
workflow: documentation.yml | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
ref: main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: "v5.0.0" | ||
hooks: | ||
- id: check-case-conflict | ||
- id: check-merge-conflict | ||
- id: check-toml | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
|
||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.7.2 | ||
hooks: | ||
- id: ruff | ||
args: [--exit-non-zero-on-fix] | ||
- id: ruff-format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Changelog | ||
All notable changes to this project will be documented in this file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Contributing | ||
We welcome contributions to this project. Please read the following guidelines. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
.PHONY: install | ||
install: ## Install the poetry environment and install the pre-commit hooks | ||
@echo "📦 Installing dependencies with Poetry" | ||
@poetry install | ||
@echo "🔧 Installing pre-commit hooks" | ||
@poetry run pre-commit install | ||
@echo "🐚 Activating virtual environment" | ||
@poetry shell | ||
|
||
.PHONY: check | ||
check: ## Run code quality tools. | ||
@echo "🛠️ Running code quality checks" | ||
@echo "🔍 Checking Poetry lock file consistency" | ||
@poetry check --lock | ||
@echo "🚨 Linting code with pre-commit" | ||
@poetry run pre-commit run -a | ||
|
||
.PHONY: check-plus | ||
check-plus: check ## Run additional code quality tools. | ||
@echo "🔍 Checking code formatting with black | ||
@poetry run black --check ." | ||
@echo "⚙️ Static type checking with mypy" | ||
@poetry run mypy | ||
@echo "🔎 Checking for obsolete dependencies" | ||
@poetry run deptry . | ||
|
||
.PHONY: build | ||
build: clean-build ## Build wheel file using poetry | ||
@echo "🚀 Creating wheel file" | ||
@poetry build | ||
|
||
.PHONY: clean-build | ||
clean-build: ## clean build artifacts | ||
@rm -rf dist | ||
|
||
.PHONY: publish | ||
publish: ## publish a release to pypi. | ||
@echo "🚀 Publishing: Dry run." | ||
@poetry config pypi-token.pypi $(PYPI_TOKEN) | ||
@poetry publish --dry-run | ||
@echo "🚀 Publishing." | ||
@poetry publish | ||
|
||
.PHONY: build-and-publish | ||
build-and-publish: build publish ## Build and publish. | ||
|
||
.PHONY: format | ||
format: ## Format code with black and isort | ||
@echo "🎨 Formatting code" | ||
@poetry run black . | ||
@poetry run isort . | ||
|
||
.PHONY: clean | ||
clean: clean-build ## Clean up build artifacts and cache files | ||
@echo "🧹 Cleaning up build artifacts and caches" | ||
@rm -rf __pycache__ */__pycache__ .mypy_cache | ||
|
||
.PHONY: help | ||
help: | ||
@echo "Available commands:" | ||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "💡 \033[36m%-20s\033[0m %s\n", $$1, $$2}' | ||
|
||
.DEFAULT_GOAL := help |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
.PHONY: apidoc html clean all | ||
.PHONY: test | ||
test: ## Test if documentation can be built without warnings or errors | ||
@poetry run mkdocs build -s | ||
|
||
apidoc: | ||
sphinx-apidoc -f -o . ../nebula | ||
.PHONY: build | ||
build: ## Build the documentation | ||
@poetry run mkdocs build -d _build | ||
|
||
html: | ||
sphinx-build -b html . _build | ||
|
||
clean: | ||
rm -rf _build | ||
|
||
all: apidoc html | ||
.PHONY: serve | ||
serve: ## Build and serve the documentation | ||
@poetry run mkdocs serve |
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.