Skip to content

Commit 2946a9d

Browse files
authored
Merge branch 'main' into operator-overhaul
2 parents 8e01f1b + d6cdd5e commit 2946a9d

File tree

704 files changed

+10738
-7832
lines changed

Some content is hidden

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

704 files changed

+10738
-7832
lines changed

.github/workflows/daily.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ jobs:
3535
strategy:
3636
matrix:
3737
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
38-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
38+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
3939
fail-fast: false
4040

4141
steps:
42-
- uses: actions/checkout@v5
42+
- uses: actions/checkout@v6
4343
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
4444
uses: actions/setup-python@v6
4545
with:
@@ -63,7 +63,7 @@ jobs:
6363
shard-index: [0, 1, 2, 3]
6464
fail-fast: false
6565
steps:
66-
- uses: actions/checkout@v5
66+
- uses: actions/checkout@v6
6767
- uses: actions/setup-python@v6
6868
with:
6969
python-version: "3.13"
@@ -111,19 +111,19 @@ jobs:
111111
runs-on: ubuntu-latest
112112
steps:
113113
- name: Checkout typeshed
114-
uses: actions/checkout@v5
114+
uses: actions/checkout@v6
115115
with:
116116
path: typeshed
117117
- name: Checkout stub_uploader
118-
uses: actions/checkout@v5
118+
uses: actions/checkout@v6
119119
with:
120120
repository: typeshed-internal/stub_uploader
121121
path: stub_uploader
122122
- uses: actions/setup-python@v6
123123
with:
124124
# Keep in sync with stub_uploader's check_scripts.yml workflow.
125125
python-version: "3.13"
126-
- uses: astral-sh/setup-uv@v6
126+
- uses: astral-sh/setup-uv@v7
127127
with:
128128
version-file: "typeshed/requirements-tests.txt"
129129
- name: Run tests

.github/workflows/meta_tests.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ jobs:
3535
platform: ["linux", "win32"]
3636
fail-fast: false
3737
steps:
38-
- uses: actions/checkout@v5
38+
- uses: actions/checkout@v6
3939
- uses: actions/setup-python@v6
4040
with:
4141
python-version: "3.13"
42-
- uses: astral-sh/setup-uv@v6
42+
- uses: astral-sh/setup-uv@v7
4343
with:
4444
version-file: "requirements-tests.txt"
4545
- run: uv pip install -r requirements-tests.txt --system
@@ -52,11 +52,11 @@ jobs:
5252
python-platform: ["Linux", "Windows"]
5353
fail-fast: false
5454
steps:
55-
- uses: actions/checkout@v5
55+
- uses: actions/checkout@v6
5656
- uses: actions/setup-python@v6
5757
with:
5858
python-version: "3.13"
59-
- uses: astral-sh/setup-uv@v6
59+
- uses: astral-sh/setup-uv@v7
6060
with:
6161
version-file: "requirements-tests.txt"
6262
- run: uv pip install -r requirements-tests.txt --system
@@ -65,17 +65,17 @@ jobs:
6565
with:
6666
version: PATH
6767
python-platform: ${{ matrix.python-platform }}
68-
python-version: "3.9" # Oldest version supported for running scripts and tests
68+
python-version: "3.10" # Oldest version supported for running scripts and tests
6969
project: ./pyrightconfig.scripts_and_tests.json
7070
stubsabot-dry-run:
7171
name: Stubsabot dry run
7272
runs-on: ubuntu-latest
7373
steps:
74-
- uses: actions/checkout@v5
74+
- uses: actions/checkout@v6
7575
- uses: actions/setup-python@v6
7676
with:
7777
python-version: "3.13"
78-
- uses: astral-sh/setup-uv@v6
78+
- uses: astral-sh/setup-uv@v7
7979
with:
8080
version-file: "requirements-tests.txt"
8181
- name: Git config

.github/workflows/mypy_primer.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
shard-index: [0, 1, 2, 3]
2626
fail-fast: false
2727
steps:
28-
- uses: actions/checkout@v5
28+
- uses: actions/checkout@v6
2929
with:
3030
path: typeshed_to_test
3131
fetch-depth: 0
@@ -62,15 +62,15 @@ jobs:
6262
run: |
6363
echo ${{ github.event.pull_request.number }} | tee pr_number.txt
6464
- name: Upload mypy_primer diff + PR number
65-
uses: actions/upload-artifact@v4
65+
uses: actions/upload-artifact@v6
6666
if: ${{ matrix.shard-index == 0 }}
6767
with:
6868
name: mypy_primer_diffs-${{ matrix.shard-index }}
6969
path: |
7070
diff_${{ matrix.shard-index }}.txt
7171
pr_number.txt
7272
- name: Upload mypy_primer diff
73-
uses: actions/upload-artifact@v4
73+
uses: actions/upload-artifact@v6
7474
if: ${{ matrix.shard-index != 0 }}
7575
with:
7676
name: mypy_primer_diffs-${{ matrix.shard-index }}
@@ -84,7 +84,7 @@ jobs:
8484
contents: read
8585
steps:
8686
- name: Merge artifacts
87-
uses: actions/upload-artifact/merge@v4
87+
uses: actions/upload-artifact/merge@v6
8888
with:
8989
name: mypy_primer_diffs
9090
pattern: mypy_primer_diffs-*

.github/workflows/stubsabot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ jobs:
1919
if: github.repository == 'python/typeshed'
2020
runs-on: ubuntu-latest
2121
steps:
22-
- uses: actions/checkout@v5
22+
- uses: actions/checkout@v6
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
2727
- uses: actions/setup-python@v6
2828
with:
2929
python-version: "3.13"
30-
- uses: astral-sh/setup-uv@v6
30+
- uses: astral-sh/setup-uv@v7
3131
with:
3232
version-file: "requirements-tests.txt"
3333
- name: git config

.github/workflows/stubtest_stdlib.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ jobs:
3131
strategy:
3232
matrix:
3333
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
34-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
34+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
3535
fail-fast: false
3636

3737
steps:
38-
- uses: actions/checkout@v5
38+
- uses: actions/checkout@v6
3939
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
4040
uses: actions/setup-python@v6
4141
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@v5
39+
- uses: actions/checkout@v6
4040
with:
4141
fetch-depth: 0
4242
- uses: actions/setup-python@v6

.github/workflows/tests.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ jobs:
2626
name: Check typeshed structure
2727
runs-on: ubuntu-latest
2828
steps:
29-
- uses: actions/checkout@v5
29+
- uses: actions/checkout@v6
3030
- uses: actions/setup-python@v6
3131
with:
3232
python-version: "3.13"
33-
- uses: astral-sh/setup-uv@v6
33+
- uses: astral-sh/setup-uv@v7
3434
with:
3535
version-file: "requirements-tests.txt"
3636
- run: uv pip install -r requirements-tests.txt --system
@@ -42,15 +42,15 @@ jobs:
4242
strategy:
4343
matrix:
4444
platform: ["linux", "win32", "darwin"]
45-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
45+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
4646
fail-fast: false
4747
steps:
48-
- uses: actions/checkout@v5
48+
- uses: actions/checkout@v6
4949
- uses: actions/setup-python@v6
5050
with:
5151
python-version: ${{ matrix.python-version }}
5252
allow-prereleases: true
53-
- uses: astral-sh/setup-uv@v6
53+
- uses: astral-sh/setup-uv@v7
5454
with:
5555
version-file: "requirements-tests.txt"
5656
- run: uv pip install -r requirements-tests.txt --system
@@ -68,11 +68,11 @@ jobs:
6868
name: "mypy: Run test cases"
6969
runs-on: ubuntu-latest
7070
steps:
71-
- uses: actions/checkout@v5
71+
- uses: actions/checkout@v6
7272
- uses: actions/setup-python@v6
7373
with:
7474
python-version: "3.14"
75-
- uses: astral-sh/setup-uv@v6
75+
- uses: astral-sh/setup-uv@v7
7676
with:
7777
version-file: "requirements-tests.txt"
7878
- run: uv pip install -r requirements-tests.txt --system
@@ -84,14 +84,14 @@ jobs:
8484
strategy:
8585
matrix:
8686
python-platform: ["Linux", "Windows", "Darwin"]
87-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
87+
python-version: ["3.11", "3.12", "3.13", "3.14"]
8888
fail-fast: false
8989
steps:
90-
- uses: actions/checkout@v5
90+
- uses: actions/checkout@v6
9191
- uses: actions/setup-python@v6
9292
with:
9393
python-version: "3.13"
94-
- uses: astral-sh/setup-uv@v6
94+
- uses: astral-sh/setup-uv@v7
9595
with:
9696
version-file: "requirements-tests.txt"
9797
- name: Install typeshed test-suite requirements
@@ -146,19 +146,19 @@ jobs:
146146
runs-on: ubuntu-latest
147147
steps:
148148
- name: Checkout typeshed
149-
uses: actions/checkout@v5
149+
uses: actions/checkout@v6
150150
with:
151151
path: typeshed
152152
- name: Checkout stub_uploader
153-
uses: actions/checkout@v5
153+
uses: actions/checkout@v6
154154
with:
155155
repository: typeshed-internal/stub_uploader
156156
path: stub_uploader
157157
- uses: actions/setup-python@v6
158158
with:
159159
# Keep in sync with stub_uploader's check_scripts.yml workflow.
160160
python-version: "3.13"
161-
- uses: astral-sh/setup-uv@v6
161+
- uses: astral-sh/setup-uv@v7
162162
with:
163163
version-file: "typeshed/requirements-tests.txt"
164164
- name: Run 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.13.3 # must match requirements-tests.txt
14+
rev: v0.14.10 # 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: 25.9.0
30+
rev: 25.12.0
3131
hooks:
3232
- id: black
3333
- repo: https://github.com/pycqa/flake8

CONTRIBUTING.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ are important to the project's success.
1414
but [contact us](README.md#discussion) before starting significant work.
1515
* Create your stubs, considering [what to include](#what-to-include) and
1616
conforming to the [coding style](https://typing.readthedocs.io/en/latest/guides/writing_stubs.html#style-guide).
17-
4. Optionally [format and check your stubs](#code-formatting).
17+
4. Optionally [format and check your stubs](#stub-content-and-style).
1818
5. Optionally [run the tests](tests/README.md).
1919
6. [Submit your changes](#submitting-changes) by opening a pull request.
2020
7. Make sure that all tests in CI are passing.
@@ -55,8 +55,6 @@ Note that some tests require extra setup steps to install the required dependenc
5555
<td>Linux / macOS / WSL</td>
5656
<td>
5757

58-
On Linux and macOS, you will be able to run the full test suite on Python
59-
3.9-3.12.
6058
To install the necessary requirements, run the following commands from a
6159
terminal window:
6260

@@ -134,7 +132,7 @@ there represents a PyPI distribution, and contains the following:
134132
source distribution.
135133
* (Rarely) some docs specific to a given type stub package in `README` file.
136134

137-
When a third party stub is added or
135+
When a third-party stub is added or
138136
modified, an updated version of the corresponding distribution will be
139137
automatically uploaded to PyPI within a few hours.
140138
Each time this happens the least significant
@@ -186,7 +184,7 @@ supported:
186184
stubs for other reasons than the upstream library shipping with type
187185
information.
188186
* `upload` (optional): This field is set to `false` to prevent automatic
189-
uploads to PyPI. This should only used in special cases, e.g. when the stubs
187+
uploads to PyPI. This should only be used in special cases, e.g. when the stubs
190188
break the upload.
191189
* `partial_stub` (optional): This field marks the type stub package as
192190
[partial](https://peps.python.org/pep-0561/#partial-stub-packages). This is for
@@ -344,20 +342,20 @@ the latest mypy (`pip install -r requirements-tests.txt`) before running the scr
344342

345343
### Supported type system features
346344

347-
Since PEP 484 was accepted, there have been many other PEPs that added
348-
new features to the Python type system. In general, new features can
349-
be used in typeshed as soon as the PEP has been accepted and implemented
350-
and most type checkers support the new feature.
345+
Since [PEP 484](https://peps.python.org/pep-0484/) was accepted, there have been
346+
many other PEPs that added new features to the Python type system. In general,
347+
new features can be used in typeshed as soon as the PEP has been accepted and
348+
implemented and most type checkers support the new feature.
351349

352350
Supported features include:
353-
- [PEP 544](https://peps.python.org/pep-0544/) (Protocol)
351+
- [PEP 544](https://peps.python.org/pep-0544/) (`Protocol`)
354352
- [PEP 585](https://peps.python.org/pep-0585/) (builtin generics)
355-
- [PEP 586](https://peps.python.org/pep-0586/) (Literal)
356-
- [PEP 591](https://peps.python.org/pep-0591/) (Final/@final)
357-
- [PEP 589](https://peps.python.org/pep-0589/) (TypedDict)
353+
- [PEP 586](https://peps.python.org/pep-0586/) (`Literal`)
354+
- [PEP 591](https://peps.python.org/pep-0591/) (`Final`/`@final`)
355+
- [PEP 589](https://peps.python.org/pep-0589/) (`TypedDict`)
358356
- [PEP 604](https://peps.python.org/pep-0604/) (`Foo | Bar` union syntax)
359-
- [PEP 612](https://peps.python.org/pep-0612/) (ParamSpec)
360-
- [PEP 647](https://peps.python.org/pep-0647/) (TypeGuard):
357+
- [PEP 612](https://peps.python.org/pep-0612/) (`ParamSpec`)
358+
- [PEP 647](https://peps.python.org/pep-0647/) (`TypeGuard`):
361359
see [#5406](https://github.com/python/typeshed/issues/5406)
362360
- [PEP 655](https://peps.python.org/pep-0655/) (`Required` and `NotRequired`)
363361
- [PEP 673](https://peps.python.org/pep-0673/) (`Self`)

MAINTAINERS.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,12 @@ When rejecting a PR for a change for a future Python version, use a message
8888
like:
8989

9090
Thanks for contributing! Unfortunately, [as outlined in our CONTRIBUTING document](https://github.com/python/typeshed/blob/main/CONTRIBUTING.md#standard-library-stubs) we only accept pull requests to the standard library for future Python versions after the first beta version has been released. This is in part to prevent churn in the stubs, and in part because the testing infrastructure for the future version is not yet in place. Please feel free to open a new PR when the first beta version has been released. Alternatively, if this PR is still relevant, you can leave a comment here to reopen it.
91+
92+
### Closing requests for third-party stubs
93+
94+
We don't keep requests for third-party library stubs open. Close those
95+
requests as "not planned" with an explanation like this:
96+
97+
We gladly accept type stub contributions for third-party libraries that are published on PyPI in typeshed. To contribute a new library, please follow the steps outlined in [CONTRIBUTING.md](/python/typeshed/blob/main/CONTRIBUTING.md). The `create_baseline_stubs.py` script can be useful to create an initial version, suitable for inclusion in typeshed.
98+
99+
That said, we don't keep requests for third-party library stubs open, unless there are issues that need to be addressed before a PR can be opened. Therefore, I'm closing this issue.

0 commit comments

Comments
 (0)