diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..eb1f60c --- /dev/null +++ b/.editorconfig @@ -0,0 +1,14 @@ +# EditorConfig is awesome: http://EditorConfig.org +# top-most EditorConfig file +root = true + +# Unix-style newlines at the bottom of every file +[*] +charset = utf-8 + +# Tab indentation +indent_style = space +indent_size = 4 + +[*.{md,sh,yaml,yml}] +indent_size = 2 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..b3aa5b9 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,75 @@ +--- +name: Tests + +on: + # Run tests each time a PR is opened or changed. + # Allow other Workflows (e.g., build workflows) to call this workflow. + pull_request: + workflow_call: + +permissions: read-all + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: ["3.11", "3.12"] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install uv + uses: astral-sh/setup-uv@v5 + + - name: Install dependencies + run: | + uv pip install --system -e ".[dev]" + + - name: Run tests with pytest + run: | + uv run pytest tests/ --cov=. --cov-report=xml --cov-report=term + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v5 + if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' + with: + file: ./coverage.xml + flags: unittests + name: codecov-umbrella + fail_ci_if_error: false + + lint: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install uv + uses: astral-sh/setup-uv@v5 + + - name: Install dependencies + run: | + uv pip install --system -e ".[dev]" + + - name: Install pre-commit + run: | + uv pip install --system pre-commit + + - name: Run pre-commit hooks + run: | + pre-commit run --all-files diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c71f051 --- /dev/null +++ b/.gitignore @@ -0,0 +1,72 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +*.manifest +*.spec + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ + +# Virtual environments +venv/ +.venv/ +ENV/ +env/ +.env + +# IDEs +.vscode/ +.idea/ +*.swp +*.swo +*~ + +# OS +.DS_Store +Thumbs.db + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Ruff +.ruff_cache/ diff --git a/.idea/dependency-update-pre-commit.iml b/.idea/dependency-update-pre-commit.iml index 8b8c395..292aeb0 100644 --- a/.idea/dependency-update-pre-commit.iml +++ b/.idea/dependency-update-pre-commit.iml @@ -9,4 +9,4 @@