Skip to content

Commit 63e5cbd

Browse files
committed
Start using uv for Python in CI
1 parent d1df577 commit 63e5cbd

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,28 +24,31 @@ jobs:
2424

2525
steps:
2626
- uses: actions/checkout@v4
27-
- name: "Set up Python"
28-
uses: actions/setup-python@v5
27+
28+
- name: Install the latest version of uv
29+
uses: astral-sh/setup-uv@v3
2930
with:
30-
python-version: ${{ matrix.python-version }}
31+
enable-cache: true
32+
33+
- name: Install Python 3.12
34+
run: uv python install ${{ matrix.python-version }}
3135

3236
# We do not use the cache action as uv is faster than the cache action.
3337
- name: "Install dependencies"
3438
run: |
35-
curl -LsSf https://astral.sh/uv/install.sh | sh
3639
uv pip install --system --upgrade --editable .[dev]
3740
3841
- name: "Lint"
3942
run: |
40-
pre-commit run --all-files --hook-stage commit --verbose
41-
pre-commit run --all-files --hook-stage push --verbose
42-
pre-commit run --all-files --hook-stage manual --verbose
43+
uv run --all-extras pre-commit run --all-files --hook-stage commit --verbose
44+
uv run --all-extras pre-commit run --all-files --hook-stage push --verbose
45+
uv run --all-extras pre-commit run --all-files --hook-stage manual --verbose
4346
4447
- name: "Run tests"
4548
run: |
4649
# We run tests against "." and not the tests directory as we test the README
4750
# and documentation.
48-
pytest -s -vvv --cov-fail-under 100 --cov=src/ --cov=tests . --cov-report=xml
51+
uv run --all-extras pytest -s -vvv --cov-fail-under 100 --cov=src/ --cov=tests/ . --cov-report=xml
4952
5053
- name: "Upload coverage to Codecov"
5154
uses: "codecov/codecov-action@v4"

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
# https://github.com/stefanzweifel/git-auto-commit-action?tab=readme-ov-file#push-to-protected-branches
3232
token: ${{ secrets.RELEASE_PAT }}
3333

34+
# TODO use UV here
3435
- name: "Set up Python"
3536
uses: actions/setup-python@v5
3637
with:

.github/workflows/windows-ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
with:
3030
python-version: ${{ matrix.python-version }}
3131

32+
# TODO Here (or maybe get rid of this and use the ci yml?)
3233
# We do not use the cache action as uv is faster than the cache action.
3334
- name: "Install dependencies"
3435
run: |

0 commit comments

Comments
 (0)