Skip to content

Commit 3304a5f

Browse files
authored
Stabilise third party tests (#348)
Use uv to test with the state of PyPI as of the commit we are testing
1 parent c3dc681 commit 3304a5f

File tree

1 file changed

+34
-17
lines changed

1 file changed

+34
-17
lines changed

.github/workflows/third_party.yml

+34-17
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,16 @@ jobs:
103103
uses: actions/setup-python@v5
104104
with:
105105
python-version: ${{ matrix.python-version }}
106+
- name: Install uv
107+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
106108
- name: Install typing_inspect test dependencies
107-
run: pip install -r typing_inspect/test-requirements.txt
109+
run: |
110+
cd typing_inspect
111+
uv pip install --system -r test-requirements.txt --exclude-newer $(git show -s --date=format:'%Y-%m-%dT%H:%M:%SZ' --format=%cd HEAD)
108112
- name: Install typing_extensions latest
109-
run: pip install ./typing-extensions-latest
113+
run: uv pip install --system "typing-extensions @ ./typing-extensions-latest"
110114
- name: List all installed dependencies
111-
run: pip freeze --all
115+
run: uv pip freeze
112116
- name: Run typing_inspect tests
113117
run: |
114118
cd typing_inspect
@@ -147,12 +151,16 @@ jobs:
147151
with:
148152
python-version: ${{ matrix.python-version }}
149153
allow-prereleases: true
154+
- name: Install uv
155+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
150156
- name: Install pyanalyze test requirements
151-
run: pip install ./pyanalyze[tests]
157+
run: |
158+
cd pyanalyze
159+
uv pip install --system 'pyanalyze[tests] @ .' --exclude-newer $(git show -s --date=format:'%Y-%m-%dT%H:%M:%SZ' --format=%cd HEAD)
152160
- name: Install typing_extensions latest
153-
run: pip install ./typing-extensions-latest
161+
run: uv pip install --system "typing-extensions @ ./typing-extensions-latest"
154162
- name: List all installed dependencies
155-
run: pip freeze --all
163+
run: uv pip freeze
156164
- name: Run pyanalyze tests
157165
run: |
158166
cd pyanalyze
@@ -191,12 +199,16 @@ jobs:
191199
with:
192200
python-version: ${{ matrix.python-version }}
193201
allow-prereleases: true
202+
- name: Install uv
203+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
194204
- name: Install typeguard test requirements
195-
run: pip install -e ./typeguard[test]
205+
run: |
206+
cd typeguard
207+
uv pip install --system "typeguard[test] @ ." --exclude-newer $(git show -s --date=format:'%Y-%m-%dT%H:%M:%SZ' --format=%cd HEAD)
196208
- name: Install typing_extensions latest
197-
run: pip install ./typing-extensions-latest
209+
run: uv pip install --system "typing-extensions @ ./typing-extensions-latest"
198210
- name: List all installed dependencies
199-
run: pip freeze --all
211+
run: uv pip freeze
200212
- name: Run typeguard tests
201213
run: |
202214
cd typeguard
@@ -234,6 +246,8 @@ jobs:
234246
uses: actions/setup-python@v5
235247
with:
236248
python-version: ${{ matrix.python-version }}
249+
- name: Install uv
250+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
237251
- name: Configure git for typed-argument-parser tests
238252
# typed-argument parser does this in their CI,
239253
# and the tests fail unless we do this
@@ -242,12 +256,13 @@ jobs:
242256
git config --global user.name "Your Name"
243257
- name: Install typed-argument-parser test requirements
244258
run: |
245-
pip install -e ./typed-argument-parser
246-
pip install pytest
259+
cd typed-argument-parser
260+
uv pip install --system "typed-argument-parser @ ." --exclude-newer $(git show -s --date=format:'%Y-%m-%dT%H:%M:%SZ' --format=%cd HEAD)
261+
uv pip install --system pytest --exclude-newer $(git show -s --date=format:'%Y-%m-%dT%H:%M:%SZ' --format=%cd HEAD)
247262
- name: Install typing_extensions latest
248-
run: pip install ./typing-extensions-latest
263+
run: uv pip install --system "typing-extensions @ ./typing-extensions-latest"
249264
- name: List all installed dependencies
250-
run: pip freeze --all
265+
run: uv pip freeze
251266
- name: Run typed-argument-parser tests
252267
run: |
253268
cd typed-argument-parser
@@ -286,15 +301,17 @@ jobs:
286301
with:
287302
python-version: ${{ matrix.python-version }}
288303
allow-prereleases: true
304+
- name: Install uv
305+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
289306
- name: Install mypy test requirements
290307
run: |
291308
cd mypy
292-
pip install -r test-requirements.txt
293-
pip install -e .
309+
uv pip install --system -r test-requirements.txt --exclude-newer $(git show -s --date=format:'%Y-%m-%dT%H:%M:%SZ' --format=%cd HEAD)
310+
uv pip install --system -e .
294311
- name: Install typing_extensions latest
295-
run: pip install ./typing-extensions-latest
312+
run: uv pip install --system "typing-extensions @ ./typing-extensions-latest"
296313
- name: List all installed dependencies
297-
run: pip freeze --all
314+
run: uv pip freeze
298315
- name: Run stubtest & mypyc tests
299316
run: |
300317
cd mypy

0 commit comments

Comments
 (0)