Skip to content

Commit 8db1af3

Browse files
Merge pull request #2116 from VWS-Python/uv
Switch from pip to uv in main CI
2 parents 12aae3a + 4519f8d commit 8db1af3

File tree

2 files changed

+27
-17
lines changed

2 files changed

+27
-17
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,26 +30,32 @@ jobs:
3030
python-version: ${{ matrix.python-version }}
3131

3232
- uses: actions/cache@v4
33+
env:
34+
UV_CACHE_DIR: ~/.cache/uv
3335
with:
34-
path: ~/.cache/pip
35-
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
36+
path: "${{ env.UV_CACHE_DIR }}"
37+
key: ${{ runner.os }}-uv-${{ hashFiles('pyproject.toml') }}
3638
restore-keys: |
37-
${{ runner.os }}-pip-
39+
${{ runner.os }}-uv-
3840
3941
- name: "Install dependencies"
42+
env:
43+
# `/home/runner` is the result of running `readlink -f ~` on the runner.
44+
UV_CACHE_DIR: /home/runner/.cache/uv
4045
run: |
41-
python -m pip install --upgrade pip setuptools wheel
42-
# We use '--ignore-installed' to avoid GitHub's cache which can cause
43-
# issues - we have seen packages from this cache be cause trouble with
44-
# pip-extra-reqs.
45-
python -m pip install --ignore-installed --upgrade --editable .[dev]
46+
curl -LsSf https://astral.sh/uv/install.sh | sh
47+
uv venv /home/runner/.venv
48+
source /home/runner/.venv/bin/activate
49+
uv pip install --upgrade --editable .[dev]
4650
4751
- name: "Lint"
4852
run: |
53+
source /home/runner/.venv/bin/activate
4954
make lint
5055
5156
- name: "Run tests"
5257
run: |
58+
source /home/runner/.venv/bin/activate
5359
# We run tests against "." and not the tests directory as we test the README
5460
# and documentation.
5561
pytest -s -vvv --cov-fail-under 100 --cov=src/ --cov=tests . --cov-report=xml

.github/workflows/windows-ci.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,26 @@ jobs:
3030
python-version: ${{ matrix.python-version }}
3131

3232
- uses: actions/cache@v4
33+
env:
34+
UV_CACHE_DIR: C:/Users/runner/.cache/
3335
with:
34-
path: ~\AppData\Local\pip\Cache
35-
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
36+
path: "${{ env.UV_CACHE_DIR }}"
37+
key: ${{ runner.os }}-uv-${{ hashFiles('pyproject.toml') }}
3638
restore-keys: |
37-
${{ runner.os }}-pip-
39+
${{ runner.os }}-uv-
3840
3941
- name: "Install dependencies"
42+
env:
43+
UV_CACHE_DIR: C:/Users/runner/.cache/
4044
run: |
41-
python -m pip install --upgrade pip setuptools wheel
42-
# We use '--ignore-installed' to avoid GitHub's cache which can cause
43-
# issues - we have seen packages from this cache be cause trouble with
44-
# pip-extra-reqs.
45-
python -m pip install --ignore-installed --upgrade --editable .[dev]
45+
irm https://astral.sh/uv/install.ps1 | iex
46+
uv venv C:/Users/runner/.venv
47+
C:/Users/runner/.venv/Scripts/Activate.ps1
48+
uv pip install --upgrade --editable .[dev]
4649
4750
- name: "Run tests"
4851
run: |
52+
C:/Users/runner/.venv/Scripts/Activate.ps1
4953
# We run tests against "." and not the tests directory as we test the README
5054
# and documentation.
51-
pytest -s -vvv --cov-fail-under 100 --cov=src/ --cov=tests . --cov-report=xml
55+
python -m pytest -s -vvv --cov-fail-under 100 --cov=src/ --cov=tests . --cov-report=xml

0 commit comments

Comments
 (0)