diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a61542d..dc99b7c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,26 +23,19 @@ jobs: steps: - uses: actions/checkout@v4 - - name: "Set up Python" - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - # We do not use the cache action as uv is faster than the cache action. - - name: "Install dependencies" - run: | - curl -LsSf https://astral.sh/uv/install.sh | sh - uv pip install --system --upgrade --editable .[dev] + - name: Install uv + uses: astral-sh/setup-uv@v3 - name: "Lint" run: | - pre-commit run --all-files --hook-stage commit --verbose - pre-commit run --all-files --hook-stage push --verbose - pre-commit run --all-files --hook-stage manual --verbose + uv run --all-extras --python=${{ matrix.python-version }} pre-commit run --all-files --hook-stage commit --verbose + uv run --all-extras --python=${{ matrix.python-version }} pre-commit run --all-files --hook-stage push --verbose + uv run --all-extras --python=${{ matrix.python-version }} pre-commit run --all-files --hook-stage manual --verbose - name: "Run tests" run: | - pytest -s -vvv --cov-fail-under 100 --cov=src/ --cov=tests . --cov-report=xml + uv run --all-extras --python=${{ matrix.python-version }} pytest -s -vvv --cov-fail-under 100 --cov=src/ --cov=tests . --cov-report=xml - name: "Upload coverage to Codecov" uses: "codecov/codecov-action@v4" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a24d5da..c38a38a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,10 +31,8 @@ jobs: # https://github.com/stefanzweifel/git-auto-commit-action?tab=readme-ov-file#push-to-protected-branches token: ${{ secrets.RELEASE_PAT }} - - name: "Set up Python" - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} + - name: Install uv + uses: astral-sh/setup-uv@v3 - name: "Calver calculate version" uses: StephaneBour/actions-calver@master @@ -77,12 +75,11 @@ jobs: - name: Build a binary wheel and a source tarball run: | - # Checkout the latest tag - the one we just created. git fetch --tags git checkout ${{ steps.tag_version.outputs.new_tag }} - python -m pip install build check-wheel-contents - python -m build --sdist --wheel --outdir dist/ . - check-wheel-contents dist/*.whl + uv run pip install build check-wheel-contents + uv run python -m build --sdist --wheel --outdir dist/ . + uv run check-wheel-contents dist/*.whl # We use PyPI trusted publishing rather than a PyPI API token. # See https://github.com/pypa/gh-action-pypi-publish/tree/release/v1/?tab=readme-ov-file#trusted-publishing.