mirror of
https://github.com/dcarrillo/digaws.git
synced 2026-01-02 10:27:08 +00:00
Migrate python tool chain to uv and ruff
This commit is contained in:
50
.github/workflows/main.yml
vendored
50
.github/workflows/main.yml
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user