-
-
Notifications
You must be signed in to change notification settings - Fork 135
417 lines (373 loc) · 14.8 KB
/
third_party.yml
File metadata and controls
417 lines (373 loc) · 14.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
# This workflow is a daily cron job,
# running the tests of various third-party libraries that use us.
# This helps us spot regressions early,
# and helps flag when third-party libraries are making incorrect assumptions
# that might cause them to break when we cut a new release.
name: Third-party tests
on:
schedule:
- cron: "30 2 * * *" # 02:30 UTC
pull_request:
paths:
- ".github/workflows/third_party.yml"
workflow_dispatch:
permissions:
contents: read
env:
PIP_DISABLE_PIP_VERSION_CHECK: 1
FORCE_COLOR: 1
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
skip-schedule-on-fork:
name: Check for schedule trigger on fork
runs-on: ubuntu-latest
# if 'schedule' was the trigger,
# don't run it on contributors' forks
if: >-
github.repository == 'python/typing_extensions'
|| github.event_name != 'schedule'
steps:
- run: "true"
pydantic:
name: pydantic tests
needs: skip-schedule-on-fork
strategy:
fail-fast: false
matrix:
# PyPy is deliberately omitted here,
# since pydantic's tests intermittently segfault on PyPy,
# and it's nothing to do with typing_extensions
# Tests on 3.14 don't pass as of 2 November 2025
python-version: ["3.10", "3.11", "3.12", "3.13"]
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Install the latest version of uv
uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
with:
python-version: ${{ matrix.python-version }}
- name: Checkout pydantic
run: git clone --depth=1 https://github.com/pydantic/pydantic.git || git clone --depth=1 https://github.com/pydantic/pydantic.git
- name: Checkout typing_extensions
uses: actions/checkout@v6
with:
path: typing-extensions-latest
persist-credentials: false
- name: Run tests with typing_extensions main branch
working-directory: pydantic
run: |
uv add --editable ../typing-extensions-latest
uv sync --all-packages --group testing-extra --all-extras
printf "\n\nINSTALLED DEPENDENCIES ARE:\n\n"
uv pip list
printf "\n\n"
uv run pytest
typing_inspect:
name: typing_inspect tests
needs: skip-schedule-on-fork
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Install the latest version of uv
uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
with:
python-version: ${{ matrix.python-version }}
- name: Checkout typing_inspect
run: git clone --depth=1 https://github.com/ilevkivskyi/typing_inspect.git || git clone --depth=1 https://github.com/ilevkivskyi/typing_inspect.git
- name: Checkout typing_extensions
uses: actions/checkout@v6
with:
path: typing-extensions-latest
persist-credentials: false
- name: Run tests with typing_extensions main branch
working-directory: typing_inspect
run: |
set -x
uv venv .venv
uv pip install -r test-requirements.txt --exclude-newer "$(git show -s --date=format:'%Y-%m-%dT%H:%M:%SZ' --format=%cd HEAD)"
uv pip install -e "typing-extensions @ ../typing-extensions-latest"
printf "\n\nINSTALLED DEPENDENCIES ARE:\n\n"
uv pip list
uv run --no-project pytest
pycroscope:
name: pycroscope tests
needs: skip-schedule-on-fork
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Install the latest version of uv
uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
with:
python-version: ${{ matrix.python-version }}
- name: Check out pycroscope
run: git clone --depth=1 https://github.com/JelleZijlstra/pycroscope.git || git clone --depth=1 https://github.com/JelleZijlstra/pycroscope.git
- name: Checkout typing_extensions
uses: actions/checkout@v6
with:
path: typing-extensions-latest
persist-credentials: false
- name: Run tests with typing_extensions main branch
working-directory: pycroscope
run: |
set -x
uv venv .venv
uv pip install -e 'pycroscope[tests] @ .' --exclude-newer "$(git show -s --date=format:'%Y-%m-%dT%H:%M:%SZ' --format=%cd HEAD)"
uv pip install -e "typing-extensions @ ../typing-extensions-latest"
printf "\n\nINSTALLED DEPENDENCIES ARE:\n\n"
uv pip list
uv run --no-project pytest pycroscope/
typeguard:
name: typeguard tests
needs: skip-schedule-on-fork
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Install the latest version of uv
uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
with:
python-version: ${{ matrix.python-version }}
- name: Check out typeguard
run: git clone --depth=1 https://github.com/agronholm/typeguard.git || git clone --depth=1 https://github.com/agronholm/typeguard.git
- name: Checkout typing_extensions
uses: actions/checkout@v6
with:
path: typing-extensions-latest
persist-credentials: false
- name: Run tests with typing_extensions main branch
env:
PYTHON_COLORS: 0 # A test fails if tracebacks are colorized
working-directory: typeguard
run: |
set -x
uv venv .venv
uv pip install -e "typeguard @ ." --group test --exclude-newer "$(git show -s --date=format:'%Y-%m-%dT%H:%M:%SZ' --format=%cd HEAD)"
uv pip install -e "typing-extensions @ ../typing-extensions-latest"
printf "\n\nINSTALLED DEPENDENCIES ARE:\n\n"
uv pip list
uv run --no-project pytest
typed-argument-parser:
name: typed-argument-parser tests
needs: skip-schedule-on-fork
strategy:
fail-fast: false
matrix:
# 3.9 is no longer supported. 3.14 fails some tests as of 2 November 2025
python-version: ["3.10", "3.11", "3.12", "3.13"]
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Install the latest version of uv
uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
with:
python-version: ${{ matrix.python-version }}
- name: Check out typed-argument-parser
run: git clone --depth=1 https://github.com/swansonk14/typed-argument-parser.git || git clone --depth=1 https://github.com/swansonk14/typed-argument-parser.git
- name: Checkout typing_extensions
uses: actions/checkout@v6
with:
path: typing-extensions-latest
persist-credentials: false
- name: Configure git for typed-argument-parser tests
# typed-argument parser does this in their CI,
# and the tests fail unless we do this
run: |
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
- name: Run tests with typing_extensions main branch
working-directory: typed-argument-parser
run: |
set -x
uv venv .venv
uv pip install -e "typed-argument-parser @ ." --exclude-newer "$(git show -s --date=format:'%Y-%m-%dT%H:%M:%SZ' --format=%cd HEAD)"
uv pip install pytest --exclude-newer "$(git show -s --date=format:'%Y-%m-%dT%H:%M:%SZ' --format=%cd HEAD)"
uv pip install -e "typing-extensions @ ../typing-extensions-latest"
printf "\n\nINSTALLED DEPENDENCIES ARE:\n\n"
uv pip list
uv run --no-project pytest
mypy:
name: stubtest & mypyc tests
needs: skip-schedule-on-fork
strategy:
fail-fast: false
matrix:
# 3.14 fails a test as of 2 November 2025
python-version: ["3.10", "3.11", "3.12", "3.13"]
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Install the latest version of uv
uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
with:
python-version: ${{ matrix.python-version }}
- name: Checkout mypy for stubtest and mypyc tests
run: git clone --depth=1 https://github.com/python/mypy.git || git clone --depth=1 https://github.com/python/mypy.git
- name: Checkout typing_extensions
uses: actions/checkout@v6
with:
path: typing-extensions-latest
persist-credentials: false
- name: Run tests with typing_extensions main branch
working-directory: mypy
run: |
set -x
uv venv .venv
uv pip install -r test-requirements.txt --exclude-newer "$(git show -s --date=format:'%Y-%m-%dT%H:%M:%SZ' --format=%cd HEAD)"
uv pip install -e .
uv pip install -e "typing_extensions @ ../typing-extensions-latest"
printf "\n\nINSTALLED DEPENDENCIES ARE:\n\n"
uv pip list
uv run --no-project pytest -n 2 ./mypy/test/teststubtest.py ./mypyc/test/test_run.py ./mypyc/test/test_external.py
cattrs:
name: cattrs tests
needs: skip-schedule-on-fork
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Install the latest version of uv
uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
with:
python-version: ${{ matrix.python-version }}
- name: Checkout cattrs
run: git clone --depth=1 https://github.com/python-attrs/cattrs.git || git clone --depth=1 https://github.com/python-attrs/cattrs.git
- name: Checkout typing_extensions
uses: actions/checkout@v6
with:
path: typing-extensions-latest
persist-credentials: false
- name: Run tests with typing_extensions main branch
working-directory: cattrs
run: |
uv add --editable ../typing-extensions-latest
uv sync --group test --all-extras
printf "\n\nINSTALLED DEPENDENCIES ARE:\n\n"
uv pip list
printf "\n\n"
uv run pytest tests
sqlalchemy:
name: sqlalchemy tests
needs: skip-schedule-on-fork
strategy:
fail-fast: false
matrix:
# PyPy is deliberately omitted here, since SQLAlchemy's tests
# fail on PyPy for reasons unrelated to typing_extensions.
python-version: [ "3.10", "3.11", "3.12", "3.13", "3.14" ]
checkout-ref: [ "main", "rel_2_0" ]
# sqlalchemy tests fail when using the Ubuntu 24.04 runner
# https://github.com/sqlalchemy/sqlalchemy/commit/8d73205f352e68c6603e90494494ef21027ec68f
runs-on: ubuntu-22.04
timeout-minutes: 60
steps:
- name: Install the latest version of uv
uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
with:
python-version: ${{ matrix.python-version }}
- name: Checkout sqlalchemy
run: git clone -b ${{ matrix.checkout-ref }} --depth=1 https://github.com/sqlalchemy/sqlalchemy.git || git clone -b ${{ matrix.checkout-ref }} --depth=1 https://github.com/sqlalchemy/sqlalchemy.git
- name: Checkout typing_extensions
uses: actions/checkout@v6
with:
path: typing-extensions-latest
persist-credentials: false
- name: Run sqlalchemy tests with typing_extensions main branch
working-directory: sqlalchemy
run: |
set -x
uvx \
--with=setuptools \
tox -e github-nocext --force-dep="typing-extensions @ file://$(pwd)/../typing-extensions-latest" -- -q --nomemory --notimingintensive
litestar:
name: litestar tests
needs: skip-schedule-on-fork
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
# As of 2 November 2025 a dependency is missing 3.14 wheels
python-version: [ "3.10", "3.11", "3.12", "3.13" ]
steps:
- name: Install the latest version of uv
uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
with:
python-version: ${{ matrix.python-version }}
- name: Checkout litestar
run: git clone --depth=1 https://github.com/litestar-org/litestar.git || git clone --depth=1 https://github.com/litestar-org/litestar.git
- name: Checkout typing_extensions
uses: actions/checkout@v6
with:
path: typing-extensions-latest
persist-credentials: false
- name: Run litestar tests with typing_extensions main branch
working-directory: litestar
run: |
# litestar's python-requires means uv won't let us add typing-extensions-latest
# as a requirement unless we do this
sed -i 's/^requires-python = ">=3.8/requires-python = ">=3.10/' pyproject.toml
uv add --editable ../typing-extensions-latest
uv sync
printf "\n\nINSTALLED DEPENDENCIES ARE:\n\n"
uv pip list
printf "\n\n"
uv run python -m pytest tests/unit/test_typing.py tests/unit/test_dto
create-issue-on-failure:
name: Create an issue if daily tests failed
runs-on: ubuntu-latest
needs:
- pydantic
- typing_inspect
- pycroscope
- typeguard
- typed-argument-parser
- mypy
- cattrs
- sqlalchemy
- litestar
if: >-
${{
github.repository == 'python/typing_extensions'
&& always()
&& github.event_name == 'schedule'
&& (
needs.pydantic.result == 'failure'
|| needs.typing_inspect.result == 'failure'
|| needs.pycroscope.result == 'failure'
|| needs.typeguard.result == 'failure'
|| needs.typed-argument-parser.result == 'failure'
|| needs.mypy.result == 'failure'
|| needs.cattrs.result == 'failure'
|| needs.sqlalchemy.result == 'failure'
|| needs.litestar.result == 'failure'
)
}}
permissions:
issues: write
steps:
- uses: actions/github-script@v8
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
await github.rest.issues.create({
owner: "python",
repo: "typing_extensions",
title: `Third-party tests failed on ${new Date().toDateString()}`,
body: "Run listed here: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
})