Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 2 additions & 20 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,32 +1,14 @@
[flake8]
min_python_version = 3.7.0
min_python_version = 3.11.0
max-line-length = 140
ban-relative-imports = true
format-greedy = 1
inline-quotes = double
enable-extensions = TC, TC1
suppress-none-returning = true
type-checking-exempt-modules = typing, typing-extensions
eradicate-whitelist-extend = ^-.*;
extend-ignore =
# E203: Whitespace before ':' (pycqa/pycodestyle#373)
E203,
# SIM106: Handle error-cases first
SIM106,
# ANN101: Missing type annotation for self in method
ANN101,
# ANN102: Missing type annotation for cls in classmethod
ANN102,
E722,
BLK100,
# BLK100: Missing type annotation for public function
per-file-ignores =
# F401: Module imported by unused (non-implicit modules)
# TC002: Move third-party import '...' into a type-checking block
__init__.py:F401,TC002,
# ANN201: Missing return type annotation for public function
tests/test_*:ANN201
tests/**/test_*:ANN201
__init__.py:F401,
extend-exclude =
# Frozen and not subject to change in this repo:
get-poetry.py,
Expand Down
51 changes: 25 additions & 26 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,22 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Use Python ${{ env.pythonVersion }}
uses: actions/setup-python@v3
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
python-version: ${{ env.pythonVersion }}
architecture: x64
version: "latest"

- name: Install Poetry
run: pip install --user poetry
- name: Set up Python ${{ env.pythonVersion }}
run: uv python install ${{ env.pythonVersion }}

- name: Install dependencies
run: poetry install
run: uv sync --dev

- name: Run Tests
run: poetry run pytest tests/
run: uv run pytest tests/

- name: Run Linter
run: poetry run flake8 src/
run: uv run flake8 src/

publish:
name: "Deploy package to PyPI"
Expand All @@ -41,23 +40,24 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Use Python ${{ env.pythonVersion }}
uses: actions/setup-python@v3
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
python-version: ${{ env.pythonVersion }}
architecture: x64
version: "latest"

- name: Install Poetry
run: pip install --user poetry
- name: Set up Python ${{ env.pythonVersion }}
run: uv python install ${{ env.pythonVersion }}

- name: Install dependencies
run: poetry install
run: uv sync --dev

- name: Build package
run: uv build

- name: Publish to PyPI
env:
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: poetry publish --build --username $PYPI_USERNAME --password $PYPI_PASSWORD
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: uv publish --token $PYPI_TOKEN

docs:
name: "Deploy Docs"
Expand All @@ -69,17 +69,16 @@ jobs:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo

- name: Use Python ${{ env.pythonVersion }}
uses: actions/setup-python@v3
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
python-version: ${{ env.pythonVersion }}
architecture: x64
version: "latest"

- name: Install Poetry
run: pip install --user poetry
- name: Set up Python ${{ env.pythonVersion }}
run: uv python install ${{ env.pythonVersion }}

- name: Install dependencies
run: poetry install
run: uv sync --dev

- name: Create local changes
run: |
Expand Down
23 changes: 11 additions & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
name: Units Tests

env:
pythonVersion: "3.11"

on: push

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v3

- name: Use Python ${{ env.pythonVersion }}
uses: actions/setup-python@v3
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
python-version: ${{ env.pythonVersion }}
architecture: x64
version: "latest"

- name: Install Poetry
run: pip install --user poetry
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}

- name: Install dependencies
run: poetry install
run: uv sync --extra dev

- name: Run Tests
run: poetry run pytest tests/
run: uv run pytest tests/

- name: Run Linter
run: poetry run flake8 src/
run: uv run ruff check src
Loading