Migrate python tool chain to uv and ruff (#10)

This commit is contained in:
2025-12-29 13:35:23 +01:00
committed by GitHub
parent df1d08312f
commit f725dab970
12 changed files with 823 additions and 133 deletions

View File

@@ -14,51 +14,53 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
- name: Install nox
run: |
python -m pip install --upgrade pip
pip install nox
- name: Install dependencies
run: uv sync --group dev
- name: Lint and typing
- name: Lint and format
run: |
nox -rs lint typing
uv run --group lint ruff check digaws/ tests/
uv run --group lint ruff format --check digaws/ tests/
uv run --group typing mypy digaws/ tests/
- name: Tests
run: |
nox -rs tests -- -v
uv run --group test pytest tests/ -v
uv run --group test coverage report
build_publish:
runs-on: ubuntu-latest
needs: tests
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
environment:
name: pypi
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Set up Python 3.12
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
python-version: 3.12
enable-cache: true
python-version: 3.14
- name: Install tools
run: |
python -m pip install --upgrade pip
pip install twine wheel setuptools
- name: Install dependencies
run: uv sync
- name: Build
run: |
python setup.py sdist bdist_wheel
run: uv build
- name: Publish
run: |
export TWINE_USERNAME=${{ secrets.TWINE_USERNAME }}
export TWINE_PASSWORD=${{ secrets.TWINE_PASSWORD }}
twine upload dist/*
run: uv publish