Skip to content

Commit 3563854

Browse files
authored
ci: Use uv pip for faster build (#2038)
uv is a fast drop-in pip, pip-compile, virtualenv etc replacement created by the creator of Ruff.
1 parent 1bd9537 commit 3563854

File tree

2 files changed

+10
-38
lines changed

2 files changed

+10
-38
lines changed

.github/workflows/build_lint.yml

Lines changed: 9 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -46,30 +46,12 @@ jobs:
4646
uses: actions/setup-python@v5
4747
with:
4848
python-version: ${{ matrix.python-version }}
49-
- if: ${{ runner.os == 'Windows' }}
50-
# This is needed so that restoring cache on Windows is fast.
51-
# See until https://github.com/actions/cache/issues/752 is resolved.
52-
name: Use GNU tar
53-
shell: cmd
54-
run: |
55-
echo "Adding GNU tar to PATH"
56-
echo C:\Program Files\Git\usr\bin>>"%GITHUB_PATH%"
57-
- uses: actions/cache@v4
58-
with:
59-
path: ${{ env.pythonLocation }}
60-
key: ${{ runner.os }}-pip-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}
61-
- name: Install dependencies
62-
# Only if the cache misses
63-
# Based on https://github.com/pypa/pip/issues/8049#issuecomment-633845028
64-
# read_requirements.py should be removed once
65-
# https://github.com/pypa/pip/issues/11440 is resolved.
66-
if: steps.cache.outputs.cache-hit != 'true'
67-
run: |
68-
pip install toml
69-
python tests/read_requirements.py > requirements.txt
70-
pip install -r requirements.txt
49+
cache: 'pip'
50+
- name: Install uv
51+
run: pip install uv
7152
- name: Install Mesa
72-
run: pip install --no-deps .
53+
# See https://github.com/astral-sh/uv/issues/1945
54+
run: uv pip install --system .[dev]
7355
- name: Test with pytest
7456
run: pytest --durations=10 --cov=mesa tests/ --cov-report=xml
7557
- if: matrix.os == 'ubuntu'
@@ -84,22 +66,11 @@ jobs:
8466
uses: actions/setup-python@v5
8567
with:
8668
python-version: "3.12"
87-
- uses: actions/cache@v4
88-
with:
89-
path: ${{ env.pythonLocation }}
90-
key: test-examples-pip-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}
91-
- name: Install dependencies
92-
# Only if the cache misses
93-
# Based on https://github.com/pypa/pip/issues/8049#issuecomment-633845028
94-
# read_requirements.py should be removed once
95-
# https://github.com/pypa/pip/issues/11440 is resolved.
96-
if: steps.cache.outputs.cache-hit != 'true'
97-
run: |
98-
pip install toml
99-
python tests/read_requirements.py > requirements.txt
100-
pip install -r requirements.txt
69+
cache: 'pip'
70+
- name: Install uv
71+
run: pip install uv
10172
- name: Install Mesa
102-
run: pip install --no-deps .
73+
run: uv pip install --system .[dev]
10374
- name: Checkout mesa-examples
10475
uses: actions/checkout@v4
10576
with:

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
uses: actions/setup-python@v5
3232
with:
3333
python-version: "3.12"
34+
cache: 'pip'
3435
- name: Install dependencies
3536
run: pip install -U pip hatch
3637
- name: Build distributions

0 commit comments

Comments
 (0)