Skip to content

Commit b98762c

Browse files
authored
Do less cding around in the third-party workflow (#637)
1 parent 9471a44 commit b98762c

File tree

1 file changed

+93
-72
lines changed

1 file changed

+93
-72
lines changed

.github/workflows/third_party.yml

Lines changed: 93 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,17 @@ jobs:
6161
with:
6262
path: typing-extensions-latest
6363
persist-credentials: false
64-
- name: Add local version of typing_extensions as a dependency
65-
run: cd pydantic; uv add --editable ../typing-extensions-latest
66-
- name: Install pydantic test dependencies
67-
run: cd pydantic; uv sync --group dev
68-
- name: List installed dependencies
69-
run: cd pydantic; uv pip list
70-
- name: Run pydantic tests
71-
run: cd pydantic; uv run pytest
64+
- name: Run tests with typing_extensions main branch
65+
working-directory: pydantic
66+
run: |
67+
uv add --editable ../typing-extensions-latest
68+
uv sync --group dev
69+
70+
printf "\n\nINSTALLED DEPENDENCIES ARE:\n\n"
71+
uv pip list
72+
printf "\n\n"
73+
74+
uv run pytest
7275
7376
typing_inspect:
7477
name: typing_inspect tests
@@ -91,19 +94,19 @@ jobs:
9194
with:
9295
path: typing-extensions-latest
9396
persist-credentials: false
94-
- name: Install typing_inspect test dependencies
97+
- name: Run tests with typing_extensions main branch
98+
working-directory: typing_inspect
9599
run: |
96100
set -x
97-
cd typing_inspect
98101
uv venv .venv
102+
99103
uv pip install -r test-requirements.txt --exclude-newer "$(git show -s --date=format:'%Y-%m-%dT%H:%M:%SZ' --format=%cd HEAD)"
100-
- name: Install typing_extensions latest
101-
run: cd typing_inspect; uv pip install "typing-extensions @ ../typing-extensions-latest"
102-
- name: List all installed dependencies
103-
run: cd typing_inspect; uv pip freeze
104-
- name: Run typing_inspect tests
105-
run: |
106-
cd typing_inspect; uv run --no-project pytest
104+
uv pip install -e "typing-extensions @ ../typing-extensions-latest"
105+
106+
printf "\n\nINSTALLED DEPENDENCIES ARE:\n\n"
107+
uv pip list
108+
109+
uv run --no-project pytest
107110
108111
pycroscope:
109112
name: pycroscope tests
@@ -126,19 +129,19 @@ jobs:
126129
with:
127130
path: typing-extensions-latest
128131
persist-credentials: false
129-
- name: Install pycroscope test requirements
132+
- name: Run tests with typing_extensions main branch
133+
working-directory: pycroscope
130134
run: |
131135
set -x
132-
cd pycroscope
133136
uv venv .venv
134-
uv pip install 'pycroscope[tests] @ .' --exclude-newer "$(git show -s --date=format:'%Y-%m-%dT%H:%M:%SZ' --format=%cd HEAD)"
135-
- name: Install typing_extensions latest
136-
run: cd pycroscope; uv pip install "typing-extensions @ ../typing-extensions-latest"
137-
- name: List all installed dependencies
138-
run: cd pycroscope; uv pip freeze
139-
- name: Run pycroscope tests
140-
run: |
141-
cd pycroscope; uv run --no-project pytest pycroscope/
137+
138+
uv pip install -e 'pycroscope[tests] @ .' --exclude-newer "$(git show -s --date=format:'%Y-%m-%dT%H:%M:%SZ' --format=%cd HEAD)"
139+
uv pip install -e "typing-extensions @ ../typing-extensions-latest"
140+
141+
printf "\n\nINSTALLED DEPENDENCIES ARE:\n\n"
142+
uv pip list
143+
144+
uv run --no-project pytest pycroscope/
142145
143146
typeguard:
144147
name: typeguard tests
@@ -161,20 +164,21 @@ jobs:
161164
with:
162165
path: typing-extensions-latest
163166
persist-credentials: false
164-
- name: Install typeguard test requirements
167+
- name: Run tests with typing_extensions main branch
168+
env:
169+
PYTHON_COLORS: 0 # A test fails if tracebacks are colorized
170+
working-directory: typeguard
165171
run: |
166172
set -x
167-
cd typeguard
168173
uv venv .venv
169-
uv pip install "typeguard @ ." --group test --exclude-newer "$(git show -s --date=format:'%Y-%m-%dT%H:%M:%SZ' --format=%cd HEAD)"
170-
- name: Install typing_extensions latest
171-
run: cd typeguard; uv pip install "typing-extensions @ ../typing-extensions-latest"
172-
- name: List all installed dependencies
173-
run: cd typeguard; uv pip freeze
174-
- name: Run typeguard tests
175-
run: |
176-
export PYTHON_COLORS=0 # A test fails if tracebacks are colorized
177-
cd typeguard; uv run --no-project pytest
174+
175+
uv pip install -e "typeguard @ ." --group test --exclude-newer "$(git show -s --date=format:'%Y-%m-%dT%H:%M:%SZ' --format=%cd HEAD)"
176+
uv pip install -e "typing-extensions @ ../typing-extensions-latest"
177+
178+
printf "\n\nINSTALLED DEPENDENCIES ARE:\n\n"
179+
uv pip list
180+
181+
uv run --no-project pytest
178182
179183
typed-argument-parser:
180184
name: typed-argument-parser tests
@@ -203,20 +207,20 @@ jobs:
203207
run: |
204208
git config --global user.email "[email protected]"
205209
git config --global user.name "Your Name"
206-
- name: Install typed-argument-parser test requirements
210+
- name: Run tests with typing_extensions main branch
211+
working-directory: typed-argument-parser
207212
run: |
208213
set -x
209-
cd typed-argument-parser
210214
uv venv .venv
211-
uv pip install "typed-argument-parser @ ." --exclude-newer "$(git show -s --date=format:'%Y-%m-%dT%H:%M:%SZ' --format=%cd HEAD)"
215+
216+
uv pip install -e "typed-argument-parser @ ." --exclude-newer "$(git show -s --date=format:'%Y-%m-%dT%H:%M:%SZ' --format=%cd HEAD)"
212217
uv pip install pytest --exclude-newer "$(git show -s --date=format:'%Y-%m-%dT%H:%M:%SZ' --format=%cd HEAD)"
213-
- name: Install typing_extensions latest
214-
run: cd typed-argument-parser; uv pip install "typing-extensions @ ../typing-extensions-latest"
215-
- name: List all installed dependencies
216-
run: cd typed-argument-parser; uv pip freeze
217-
- name: Run typed-argument-parser tests
218-
run: |
219-
cd typed-argument-parser; uv run --no-project pytest
218+
uv pip install -e "typing-extensions @ ../typing-extensions-latest"
219+
220+
printf "\n\nINSTALLED DEPENDENCIES ARE:\n\n"
221+
uv pip list
222+
223+
uv run --no-project pytest
220224
221225
mypy:
222226
name: stubtest & mypyc tests
@@ -239,20 +243,20 @@ jobs:
239243
with:
240244
path: typing-extensions-latest
241245
persist-credentials: false
242-
- name: Install mypy test requirements
246+
- name: Run tests with typing_extensions main branch
247+
working-directory: mypy
243248
run: |
244249
set -x
245-
cd mypy
246250
uv venv .venv
251+
247252
uv pip install -r test-requirements.txt --exclude-newer "$(git show -s --date=format:'%Y-%m-%dT%H:%M:%SZ' --format=%cd HEAD)"
248253
uv pip install -e .
249-
- name: Install typing_extensions latest
250-
run: cd mypy; uv pip install "typing-extensions @ ../typing-extensions-latest"
251-
- name: List all installed dependencies
252-
run: cd mypy; uv pip freeze
253-
- name: Run stubtest & mypyc tests
254-
run: |
255-
cd mypy; uv run --no-project pytest -n 2 ./mypy/test/teststubtest.py ./mypyc/test/test_run.py ./mypyc/test/test_external.py
254+
uv pip install -e "typing_extensions @ ../typing-extensions-latest"
255+
256+
printf "\n\nINSTALLED DEPENDENCIES ARE:\n\n"
257+
uv pip list
258+
259+
uv run --no-project pytest -n 2 ./mypy/test/teststubtest.py ./mypyc/test/test_run.py ./mypyc/test/test_external.py
256260
257261
cattrs:
258262
name: cattrs tests
@@ -275,14 +279,17 @@ jobs:
275279
with:
276280
path: typing-extensions-latest
277281
persist-credentials: false
278-
- name: Add local version of typing_extensions as a dependency
279-
run: cd cattrs; uv add --editable ../typing-extensions-latest
280-
- name: Install test dependencies
281-
run: cd cattrs; uv sync --group test --all-extras
282-
- name: List installed dependencies
283-
run: cd cattrs; uv pip list
284-
- name: Run tests
285-
run: cd cattrs; uv run pytest tests
282+
- name: Run tests with typing_extensions main branch
283+
working-directory: cattrs
284+
run: |
285+
uv add --editable ../typing-extensions-latest
286+
uv sync --group test --all-extras
287+
288+
printf "\n\nINSTALLED DEPENDENCIES ARE:\n\n"
289+
uv pip list
290+
printf "\n\n"
291+
292+
uv run pytest tests
286293
287294
sqlalchemy:
288295
name: sqlalchemy tests
@@ -310,12 +317,14 @@ jobs:
310317
with:
311318
path: typing-extensions-latest
312319
persist-credentials: false
313-
- name: Run sqlalchemy tests
320+
- name: Run sqlalchemy tests with typing_extensions main branch
321+
working-directory: sqlalchemy
314322
run: |
315-
cd sqlalchemy
316-
uvx --with setuptools tox -e github-nocext \
317-
--force-dep "typing-extensions @ file://$(pwd)/../typing-extensions-latest" \
318-
-- -q --nomemory --notimingintensive
323+
set -x
324+
325+
uvx \
326+
--with=setuptools \
327+
tox -e github-nocext --force-dep="typing-extensions @ file://$(pwd)/../typing-extensions-latest" -- -q --nomemory --notimingintensive
319328
320329
321330
litestar:
@@ -339,9 +348,21 @@ jobs:
339348
with:
340349
path: typing-extensions-latest
341350
persist-credentials: false
342-
- name: Run litestar tests
343-
run: uv run --with=../typing-extensions-latest -- python -m pytest tests/unit/test_typing.py tests/unit/test_dto
351+
- name: Run litestar tests with typing_extensions main branch
344352
working-directory: litestar
353+
run: |
354+
# litestar's python-requires means uv won't let us add typing-extensions-latest
355+
# as a requirement unless we do this
356+
sed -i 's/^requires-python = ">=3.8/requires-python = ">=3.9/' pyproject.toml
357+
358+
uv add --editable ../typing-extensions-latest
359+
uv sync
360+
361+
printf "\n\nINSTALLED DEPENDENCIES ARE:\n\n"
362+
uv pip list
363+
printf "\n\n"
364+
365+
uv run python -m pytest tests/unit/test_typing.py tests/unit/test_dto
345366
346367
create-issue-on-failure:
347368
name: Create an issue if daily tests failed

0 commit comments

Comments
 (0)