Skip to content

Commit f500f4f

Browse files
Merge pull request #2395 from VWS-Python/setup-uv
Start using uv for Python in CI
2 parents 75d9229 + 5bc6c37 commit f500f4f

File tree

4 files changed

+19
-64
lines changed

4 files changed

+19
-64
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
.git_archival.txt export-subst
2+
*.txt text eol=lf

.github/workflows/ci.yml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,34 +18,30 @@ jobs:
1818
strategy:
1919
matrix:
2020
python-version: ["3.12"]
21-
platform: [ubuntu-latest]
21+
platform: ["ubuntu-latest", "windows-latest"]
2222

2323
runs-on: ${{ matrix.platform }}
2424

2525
steps:
2626
- uses: actions/checkout@v4
27-
- name: "Set up Python"
28-
uses: actions/setup-python@v5
29-
with:
30-
python-version: ${{ matrix.python-version }}
3127

32-
# We do not use the cache action as uv is faster than the cache action.
33-
- name: "Install dependencies"
34-
run: |
35-
curl -LsSf https://astral.sh/uv/install.sh | sh
36-
uv pip install --system --upgrade --editable .[dev]
28+
- name: Install uv
29+
uses: astral-sh/setup-uv@v3
30+
31+
- name: Install Python
32+
run: uv python install ${{ matrix.python-version }}
3733

3834
- name: "Lint"
3935
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
36+
uv run --all-extras pre-commit run --all-files --hook-stage commit --verbose
37+
uv run --all-extras pre-commit run --all-files --hook-stage push --verbose
38+
uv run --all-extras pre-commit run --all-files --hook-stage manual --verbose
4339
4440
- name: "Run tests"
4541
run: |
4642
# We run tests against "." and not the tests directory as we test the README
4743
# and documentation.
48-
pytest -s -vvv --cov-fail-under 100 --cov=src/ --cov=tests . --cov-report=xml
44+
uv run --all-extras pytest -s -vvv --cov-fail-under 100 --cov=src/ --cov=tests/ . --cov-report=xml
4945
5046
- name: "Upload coverage to Codecov"
5147
uses: "codecov/codecov-action@v4"

.github/workflows/release.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@ 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-
- name: "Set up Python"
35-
uses: actions/setup-python@v5
36-
with:
37-
python-version: ${{ matrix.python-version }}
34+
- name: Install uv
35+
uses: astral-sh/setup-uv@v3
36+
37+
- name: Install Python
38+
run: uv python install ${{ matrix.python-version }}
3839

3940
- name: "Calver calculate version"
4041
uses: StephaneBour/actions-calver@master
@@ -77,12 +78,11 @@ jobs:
7778

7879
- name: Build a binary wheel and a source tarball
7980
run: |
80-
# Checkout the latest tag - the one we just created.
8181
git fetch --tags
8282
git checkout ${{ steps.tag_version.outputs.new_tag }}
83-
python -m pip install build check-wheel-contents
84-
python -m build --sdist --wheel --outdir dist/ .
85-
check-wheel-contents dist/*.whl
83+
uv run pip install build check-wheel-contents
84+
uv run python -m build --sdist --wheel --outdir dist/ .
85+
uv run check-wheel-contents dist/*.whl
8686
8787
# We use PyPI trusted publishing rather than a PyPI API token.
8888
# See https://github.com/pypa/gh-action-pypi-publish/tree/release/v1/?tab=readme-ov-file#trusted-publishing.

.github/workflows/windows-ci.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)