Skip to content

Commit fb31669

Browse files
authored
Merge branch 'main' into structured-obsolete-since
2 parents 812d344 + 6789530 commit fb31669

87 files changed

Lines changed: 925 additions & 422 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/daily.yml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
fail-fast: false
4444

4545
steps:
46-
- uses: actions/checkout@v6
46+
- uses: actions/checkout@v7
4747
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
4848
uses: actions/setup-python@v6
4949
with:
@@ -67,7 +67,7 @@ jobs:
6767
shard-index: [0, 1, 2, 3]
6868
fail-fast: false
6969
steps:
70-
- uses: actions/checkout@v6
70+
- uses: actions/checkout@v7
7171
- uses: actions/setup-python@v6
7272
with:
7373
python-version: "3.13"
@@ -115,26 +115,22 @@ jobs:
115115
runs-on: ubuntu-latest
116116
steps:
117117
- name: Checkout typeshed
118-
uses: actions/checkout@v6
118+
uses: actions/checkout@v7
119119
with:
120120
path: typeshed
121121
- name: Checkout stub_uploader
122-
uses: actions/checkout@v6
122+
uses: actions/checkout@v7
123123
with:
124124
repository: typeshed-internal/stub_uploader
125125
path: stub_uploader
126-
- uses: actions/setup-python@v6
127-
with:
128-
# Keep in sync with stub_uploader's check_scripts.yml workflow.
129-
python-version: "3.13"
130-
- uses: astral-sh/setup-uv@v7
126+
- uses: astral-sh/setup-uv@v8.2.0
131127
with:
132128
version-file: "typeshed/requirements-tests.txt"
133129
- name: Run tests
134130
run: |
135131
cd stub_uploader
136-
uv pip install -r requirements.txt --system
137-
python -m pytest tests
132+
# Keep Python version in sync with stub_uploader's check_scripts.yml workflow.
133+
uv run --python=3.13 --no-project --with-requirements=requirements.txt -m pytest tests
138134
139135
# https://github.community/t/run-github-actions-job-only-if-previous-job-has-failed/174786/2
140136
create-issue-on-failure:
@@ -145,7 +141,7 @@ jobs:
145141
permissions:
146142
issues: write
147143
steps:
148-
- uses: actions/github-script@v8
144+
- uses: actions/github-script@v9
149145
with:
150146
github-token: ${{ secrets.GITHUB_TOKEN }}
151147
script: |

.github/workflows/meta_tests.yml

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,18 @@ jobs:
3535
platform: ["linux", "win32"]
3636
fail-fast: false
3737
steps:
38-
- uses: actions/checkout@v6
39-
- uses: actions/setup-python@v6
40-
with:
41-
python-version: "3.13"
42-
- uses: astral-sh/setup-uv@v7
38+
- uses: actions/checkout@v7
39+
- uses: astral-sh/setup-uv@v8.2.0
4340
with:
4441
version-file: "requirements-tests.txt"
45-
- run: uv pip install -r requirements-tests.txt --system
46-
- run: python ./tests/typecheck_typeshed.py --platform=${{ matrix.platform }}
42+
- run: |
43+
uv run \
44+
--python=3.13 \
45+
--no-project \
46+
--with-requirements=requirements-tests.txt \
47+
./tests/typecheck_typeshed.py \
48+
--platform=${{ matrix.platform }}
49+
4750
pyright:
4851
name: Check scripts and tests with pyright
4952
runs-on: ubuntu-latest
@@ -52,11 +55,11 @@ jobs:
5255
python-platform: ["Linux", "Windows"]
5356
fail-fast: false
5457
steps:
55-
- uses: actions/checkout@v6
58+
- uses: actions/checkout@v7
5659
- uses: actions/setup-python@v6
5760
with:
5861
python-version: "3.13"
59-
- uses: astral-sh/setup-uv@v7
62+
- uses: astral-sh/setup-uv@v8.2.0
6063
with:
6164
version-file: "requirements-tests.txt"
6265
- run: uv pip install -r requirements-tests.txt --system
@@ -67,20 +70,23 @@ jobs:
6770
python-platform: ${{ matrix.python-platform }}
6871
python-version: "3.10" # Oldest version supported for running scripts and tests
6972
project: ./pyrightconfig.scripts_and_tests.json
73+
7074
stubsabot-dry-run:
7175
name: Stubsabot dry run
7276
runs-on: ubuntu-latest
7377
steps:
74-
- uses: actions/checkout@v6
75-
- uses: actions/setup-python@v6
76-
with:
77-
python-version: "3.13"
78-
- uses: astral-sh/setup-uv@v7
78+
- uses: actions/checkout@v7
79+
- uses: astral-sh/setup-uv@v8.2.0
7980
with:
8081
version-file: "requirements-tests.txt"
8182
- name: Git config
8283
run: |
8384
git config --global user.name stubsabot
8485
git config --global user.email '<>'
85-
- run: uv pip install -r requirements-tests.txt --system
86-
- run: python scripts/stubsabot.py --action-level local
86+
- run: |
87+
uv run \
88+
--python=3.13 \
89+
--no-project \
90+
--with-requirements=requirements-tests.txt \
91+
scripts/stubsabot.py \
92+
--action-level=local

.github/workflows/mypy_primer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
shard-index: [0, 1, 2, 3, 4, 5]
2626
fail-fast: false
2727
steps:
28-
- uses: actions/checkout@v6
28+
- uses: actions/checkout@v7
2929
with:
3030
path: typeshed_to_test
3131
fetch-depth: 0

.github/workflows/mypy_primer_comment.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1919
steps:
2020
- name: Download diffs
21-
uses: actions/github-script@v8
21+
uses: actions/github-script@v9
2222
with:
2323
script: |
2424
const fs = require('fs');
@@ -44,7 +44,7 @@ jobs:
4444
4545
- name: Post comment
4646
id: post-comment
47-
uses: actions/github-script@v8
47+
uses: actions/github-script@v9
4848
with:
4949
github-token: ${{ secrets.GITHUB_TOKEN }}
5050
script: |

.github/workflows/stubsabot.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,27 @@ jobs:
1919
if: github.repository == 'python/typeshed'
2020
runs-on: ubuntu-latest
2121
steps:
22-
- uses: actions/checkout@v6
22+
- uses: actions/checkout@v7
2323
with:
2424
# use an ssh key so that checks automatically run on stubsabot PRs
2525
ssh-key: ${{ secrets.STUBSABOT_SSH_PRIVATE_KEY }}
2626
fetch-depth: 0
27-
- uses: actions/setup-python@v6
28-
with:
29-
python-version: "3.13"
30-
- uses: astral-sh/setup-uv@v7
27+
- uses: astral-sh/setup-uv@v8.2.0
3128
with:
3229
version-file: "requirements-tests.txt"
3330
- name: git config
3431
run: |
3532
git config --global user.name stubsabot
3633
git config --global user.email '<>'
37-
- name: Install dependencies
38-
run: uv pip install -r requirements-tests.txt --system
3934
- name: Run stubsabot
40-
run: GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} python scripts/stubsabot.py --action-level everything
35+
run: |
36+
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} \
37+
uv run \
38+
--python=3.13 \
39+
--no-project \
40+
--with-requirements=requirements-tests.txt \
41+
scripts/stubsabot.py \
42+
--action-level=everything
4143
4244
# https://github.community/t/run-github-actions-job-only-if-previous-job-has-failed/174786/2
4345
create-issue-on-failure:
@@ -46,7 +48,7 @@ jobs:
4648
needs: [stubsabot]
4749
if: ${{ github.repository == 'python/typeshed' && always() && (needs.stubsabot.result == 'failure') }}
4850
steps:
49-
- uses: actions/github-script@v8
51+
- uses: actions/github-script@v9
5052
with:
5153
github-token: ${{ secrets.GITHUB_TOKEN }}
5254
script: |

.github/workflows/stubtest_stdlib.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
fail-fast: false
4040

4141
steps:
42-
- uses: actions/checkout@v6
42+
- uses: actions/checkout@v7
4343
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
4444
uses: actions/setup-python@v6
4545
with:

.github/workflows/stubtest_third_party.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
fail-fast: false
3737

3838
steps:
39-
- uses: actions/checkout@v6
39+
- uses: actions/checkout@v7
4040
with:
4141
fetch-depth: 0
4242
- uses: actions/setup-python@v6

.github/workflows/tests.yml

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,16 @@ jobs:
2626
name: Check typeshed structure
2727
runs-on: ubuntu-latest
2828
steps:
29-
- uses: actions/checkout@v6
30-
- uses: actions/setup-python@v6
31-
with:
32-
python-version: "3.13"
33-
- uses: astral-sh/setup-uv@v7
29+
- uses: actions/checkout@v7
30+
- uses: astral-sh/setup-uv@v8.2.0
3431
with:
3532
version-file: "requirements-tests.txt"
36-
- run: uv pip install -r requirements-tests.txt --system
37-
- run: python ./tests/check_typeshed_structure.py
33+
- run: |
34+
uv run \
35+
--python=3.13 \
36+
--no-project \
37+
--with-requirements=requirements-tests.txt \
38+
./tests/check_typeshed_structure.py
3839
3940
mypy:
4041
name: "mypy: Check stubs"
@@ -45,12 +46,12 @@ jobs:
4546
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]
4647
fail-fast: false
4748
steps:
48-
- uses: actions/checkout@v6
49+
- uses: actions/checkout@v7
4950
- uses: actions/setup-python@v6
5051
with:
5152
python-version: ${{ matrix.python-version }}
5253
allow-prereleases: true
53-
- uses: astral-sh/setup-uv@v7
54+
- uses: astral-sh/setup-uv@v8.2.0
5455
with:
5556
version-file: "requirements-tests.txt"
5657
- run: uv pip install -r requirements-tests.txt --system
@@ -68,15 +69,18 @@ jobs:
6869
name: "mypy: Run test cases"
6970
runs-on: ubuntu-latest
7071
steps:
71-
- uses: actions/checkout@v6
72-
- uses: actions/setup-python@v6
73-
with:
74-
python-version: "3.14"
75-
- uses: astral-sh/setup-uv@v7
72+
- uses: actions/checkout@v7
73+
- uses: astral-sh/setup-uv@v8.2.0
7674
with:
7775
version-file: "requirements-tests.txt"
78-
- run: uv pip install -r requirements-tests.txt --system
79-
- run: python ./tests/regr_test.py --all --verbosity QUIET
76+
- run: |
77+
uv run \
78+
--python=3.14 \
79+
--no-project \
80+
--with-requirements=requirements-tests.txt \
81+
./tests/regr_test.py \
82+
--all \
83+
--verbosity=QUIET
8084
8185
pyright:
8286
name: "pyright: Run test cases"
@@ -89,11 +93,11 @@ jobs:
8993
python-version: ["3.11", "3.12", "3.13", "3.14"]
9094
fail-fast: false
9195
steps:
92-
- uses: actions/checkout@v6
96+
- uses: actions/checkout@v7
9397
- uses: actions/setup-python@v6
9498
with:
9599
python-version: "3.13"
96-
- uses: astral-sh/setup-uv@v7
100+
- uses: astral-sh/setup-uv@v8.2.0
97101
with:
98102
version-file: "requirements-tests.txt"
99103
- name: Install typeshed test-suite requirements
@@ -148,23 +152,18 @@ jobs:
148152
runs-on: ubuntu-latest
149153
steps:
150154
- name: Checkout typeshed
151-
uses: actions/checkout@v6
155+
uses: actions/checkout@v7
152156
with:
153157
path: typeshed
154158
- name: Checkout stub_uploader
155-
uses: actions/checkout@v6
159+
uses: actions/checkout@v7
156160
with:
157161
repository: typeshed-internal/stub_uploader
158162
path: stub_uploader
159-
- uses: actions/setup-python@v6
160-
with:
161-
# Keep in sync with stub_uploader's check_scripts.yml workflow.
162-
python-version: "3.13"
163-
- uses: astral-sh/setup-uv@v7
163+
- uses: astral-sh/setup-uv@v8.2.0
164164
with:
165165
version-file: "typeshed/requirements-tests.txt"
166166
- name: Run tests
167167
run: |
168168
cd stub_uploader
169-
uv pip install -r requirements.txt --system
170-
python -m pytest tests
169+
uv run --python=3.13 --no-project --with-requirements=requirements.txt -m pytest tests

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repos:
1111
args: [--fix=lf]
1212
- id: check-case-conflict
1313
- repo: https://github.com/astral-sh/ruff-pre-commit
14-
rev: v0.15.9 # must match requirements-tests.txt
14+
rev: v0.15.20 # must match requirements-tests.txt
1515
hooks:
1616
- id: ruff
1717
name: Run ruff on stubs, tests and scripts
@@ -27,7 +27,7 @@ repos:
2727
- "--unsafe-fixes"
2828
files: '.*test_cases/.+\.py$'
2929
- repo: https://github.com/psf/black-pre-commit-mirror
30-
rev: 26.5.0
30+
rev: 26.5.1
3131
hooks:
3232
- id: black
3333
- repo: https://github.com/pycqa/flake8

lib/ts_utils/metadata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ def update_metadata(distribution: str, **new_values: object) -> dict[str, object
376376
new_key = key.replace("_", "-")
377377
data[new_key] = data.pop(key)
378378
with path.open("w", encoding="UTF-8") as f:
379-
tomlkit.dump(data, f) # pyright: ignore[reportUnknownMemberType] # tomlkit.dump has partially unknown Mapping type
379+
tomlkit.dump(data, f)
380380
return data
381381

382382

0 commit comments

Comments
 (0)