Skip to content

Commit 401456a

Browse files
authored
Merge branch 'main' into rm-function
2 parents 0096eae + a7f0a82 commit 401456a

1,574 files changed

Lines changed: 14065 additions & 14382 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/renovate.json5

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"suppressNotifications": ["prEditedNotification"],
55
"extends": ["config:recommended"],
66
"labels": ["bot: dependencies"],
7+
"rebaseLabel": ["bot: rebase"],
78
"semanticCommits": "disabled",
89
"separateMajorMinor": false,
910
"prHourlyLimit": 10,

.github/workflows/daily.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +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"]
39+
exclude:
40+
# https://github.com/python/typeshed/issues/15694
41+
- os: "windows-latest"
42+
python-version: "3.10"
3943
fail-fast: false
4044

4145
steps:

.github/workflows/meta_tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ jobs:
6161
version-file: "requirements-tests.txt"
6262
- run: uv pip install -r requirements-tests.txt --system
6363
- name: Run pyright on typeshed
64-
uses: jakebailey/pyright-action@v2
64+
uses: jakebailey/pyright-action@v3
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

.github/workflows/mypy_primer.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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@v6
65+
uses: actions/upload-artifact@v7
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@v6
73+
uses: actions/upload-artifact@v7
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@v6
87+
uses: actions/upload-artifact/merge@v7
8888
with:
8989
name: mypy_primer_diffs
9090
pattern: mypy_primer_diffs-*

.github/workflows/stubtest_stdlib.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +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"]
35+
exclude:
36+
# https://github.com/python/typeshed/issues/15694
37+
- os: "windows-latest"
38+
python-version: "3.10"
3539
fail-fast: false
3640

3741
steps:

.github/workflows/tests.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ 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:
4848
- uses: actions/checkout@v6
@@ -84,7 +84,7 @@ 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:
9090
- uses: actions/checkout@v6
@@ -118,22 +118,22 @@ jobs:
118118
- name: List 3rd-party stub dependencies installed
119119
run: uv pip freeze
120120
- name: Run pyright with basic settings on all the stubs
121-
uses: jakebailey/pyright-action@v2
121+
uses: jakebailey/pyright-action@v3
122122
with:
123123
version: PATH
124124
python-platform: ${{ matrix.python-platform }}
125125
python-version: ${{ matrix.python-version }}
126126
annotate: ${{ matrix.python-version == '3.13' && matrix.python-platform == 'Linux' }} # Having each job create the same comment is too noisy.
127127
- name: Run pyright with stricter settings on some of the stubs
128-
uses: jakebailey/pyright-action@v2
128+
uses: jakebailey/pyright-action@v3
129129
with:
130130
version: PATH
131131
python-platform: ${{ matrix.python-platform }}
132132
python-version: ${{ matrix.python-version }}
133133
annotate: ${{ matrix.python-version == '3.13' && matrix.python-platform == 'Linux' }} # Having each job create the same comment is too noisy.
134134
project: ./pyrightconfig.stricter.json
135135
- name: Run pyright on the test cases
136-
uses: jakebailey/pyright-action@v2
136+
uses: jakebailey/pyright-action@v3
137137
with:
138138
version: PATH
139139
python-platform: ${{ matrix.python-platform }}

.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.14.10 # must match requirements-tests.txt
14+
rev: v0.15.9 # 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.12.0
30+
rev: 26.3.1
3131
hooks:
3232
- id: black
3333
- repo: https://github.com/pycqa/flake8

CONTRIBUTING.md

Lines changed: 37 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -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
@@ -165,33 +163,33 @@ supported:
165163
When the stubs are updated to a newer version
166164
of the library, the version of the stub should be bumped (note that
167165
previous versions are still available on PyPI).
168-
* `requires` (optional): A list of other stub packages or packages with type
166+
* `dependencies` (optional): A list of other stub packages or packages with type
169167
information that are imported by the stubs in this package. Only packages
170168
generated by typeshed or required by the upstream package are allowed to
171169
be listed here, for security reasons. See
172170
[this issue](https://github.com/typeshed-internal/stub_uploader/issues/90)
173171
for more information about what external dependencies are allowed.
174-
* `extra_description` (optional): Can be used to add a custom description to
172+
* `extra-description` (optional): Can be used to add a custom description to
175173
the package's long description. It should be a multi-line string in
176174
Markdown format.
177-
* `stub_distribution` (optional): Distribution name to be uploaded to PyPI.
175+
* `stub-distribution` (optional): Distribution name to be uploaded to PyPI.
178176
This defaults to `types-<distribution>` and should only be set in special
179177
cases.
180-
* `upstream_repository` (recommended): The URL of the upstream repository.
181-
* `obsolete_since` (optional): This field is part of our process for
178+
* `upstream-repository` (recommended): The URL of the upstream repository.
179+
* `obsolete-since` (optional): This field is part of our process for
182180
[removing obsolete third-party libraries](#third-party-library-removal-policy).
183181
It contains the first version of the corresponding library that ships
184182
its own `py.typed` file.
185-
* `no_longer_updated` (optional): This field is set to `true` before removing
183+
* `no-longer-updated` (optional): This field is set to `true` before removing
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.
191-
* `partial_stub` (optional): This field marks the type stub package as
189+
* `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
193191
3rd-party stubs that don't cover the entirety of the package's public API.
194-
* `requires_python` (optional): The minimum version of Python required to install
192+
* `requires-python` (optional): The minimum version of Python required to install
195193
the type stub package. It must be in the form `>=3.*`. If omitted, the oldest
196194
Python version supported by typeshed is used.
197195

@@ -200,36 +198,36 @@ This has the following keys:
200198
* `skip` (default: `false`): Whether stubtest should be run against this
201199
package. Please avoid setting this to `true`, and add a comment if you have
202200
to.
203-
* `ignore_missing_stub`: When set to `true`, this will add the
204-
`--ignore_missing_stub` option to the stubtest call. See
201+
* `ignore-missing-stub`: When set to `true`, this will add the
202+
`--ignore-missing-stub` option to the stubtest call. See
205203
[tests/README.md](./tests/README.md) for more information. In most cases,
206-
this field should be identical to `partial_stub`.
207-
* `stubtest_requirements` (default: `[]`): A list of Python packages that need
204+
this field should be identical to `partial-stub`.
205+
* `stubtest-dependencies` (default: `[]`): A list of Python packages that need
208206
to be installed for stubtest to run successfully. These packages are installed
209-
in addition to the requirements in the `requires` field.
210-
* `apt_dependencies` (default: `[]`): A list of Ubuntu APT packages
207+
in addition to the dependencies in the `dependencies` field.
208+
* `apt-dependencies` (default: `[]`): A list of Ubuntu APT packages
211209
that need to be installed for stubtest to run successfully.
212-
* `brew_dependencies` (default: `[]`): A list of MacOS Homebrew packages
210+
* `brew-dependencies` (default: `[]`): A list of MacOS Homebrew packages
213211
that need to be installed for stubtest to run successfully
214-
* `choco_dependencies` (default: `[]`): A list of Windows Chocolatey packages
212+
* `choco-dependencies` (default: `[]`): A list of Windows Chocolatey packages
215213
that need to be installed for stubtest to run successfully
216-
* `supported_platforms` (default: all platforms): A list of OSes on which
214+
* `supported-platforms` (default: all platforms): A list of OSes on which
217215
stubtest can be run. When a package is not platform-specific, this should
218216
not be set. If the package is platform-specific, this should usually be set
219217
to the supported platforms, unless stubtest is known to fail on a
220218
specific platform.
221-
* `ci_platforms` (default: `["linux"]`): A list of OSes on which to run
219+
* `ci-platforms` (default: `["linux"]`): A list of OSes on which to run
222220
stubtest as part of our continuous integration (CI) tests. Can contain
223221
`win32`, `linux`, and `darwin` values. If not specified, stubtest is run
224222
only on `linux`. Only add extra OSes to the test if there are
225223
platform-specific branches in a stubs package.
226-
* `mypy_plugins` (default: `[]`): A list of Python modules to use as mypy plugins
227-
when running stubtest. For example: `mypy_plugins = ["mypy_django_plugin.main"]`
228-
* `mypy_plugins_config` (default: `{}`): A dictionary mapping plugin names to their
224+
* `mypy-plugins` (default: `[]`): A list of Python modules to use as mypy plugins
225+
when running stubtest. For example: `mypy-plugins = ["mypy_django_plugin.main"]`
226+
* `mypy-plugins-config` (default: `{}`): A dictionary mapping plugin names to their
229227
configuration dictionaries for use by mypy plugins. For example:
230-
`mypy_plugins_config = {"django-stubs" = {"django_settings_module" = "@tests.django_settings"}}`
228+
`mypy-plugins-config = {"django-stubs" = {"django_settings_module" = "@tests.django_settings"}}`
231229

232-
`*_dependencies` are usually packages needed to `pip install` the implementation
230+
`*-dependencies` are usually packages needed to `pip install` the implementation
233231
distribution.
234232

235233
The format of all `METADATA.toml` files can be checked by running
@@ -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`)
@@ -438,7 +436,7 @@ following criteria is met:
438436

439437
Case 1: If a package ships its own `py.typed` file, please follow these steps:
440438

441-
1. Make sure **stubsabot** open a PR that sets the `obsolete_since` field in the
439+
1. Make sure **stubsabot** open a PR that sets the `obsolete-since` field in the
442440
`METADATA.toml` file to the first version of the package that shipped `py.typed`.
443441
2. After at least six months, make sure **stubsabot** open a PR to remove the stubs.
444442

@@ -448,7 +446,7 @@ these steps:
448446
1. Open an issue explaining why the stubs should be removed.
449447
2. A maintainer will add the
450448
["stubs: removal" label](https://github.com/python/typeshed/labels/%22stubs%3A%20removal%22).
451-
3. Open a PR that sets the `no_longer_updated` field in the `METADATA.toml`
449+
3. Open a PR that sets the `no-longer-updated` field in the `METADATA.toml`
452450
file to `true`.
453451
4. When a new version of the package was automatically uploaded to PyPI (which
454452
can take up to a day), make sure **stubsabot** open a PR to remove the stubs.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ the project the stubs are for, but instead report them here to typeshed.**
2121
Further documentation on stub files, typeshed, and Python's typing system in
2222
general, can also be found at https://typing.readthedocs.io/en/latest/.
2323

24-
Typeshed supports Python versions 3.9 to 3.14.
24+
Typeshed supports Python versions 3.10 to 3.14.
2525

2626
## Using
2727

@@ -38,7 +38,7 @@ you can install the type stubs using
3838
$ pip install types-html5lib types-requests
3939
```
4040

41-
These PyPI packages follow [PEP 561](http://www.python.org/dev/peps/pep-0561/)
41+
These PyPI packages follow [the typing spec standards](https://typing.python.org/en/latest/spec/distributing.html)
4242
and are automatically released (up to once a day) by
4343
[typeshed internal machinery](https://github.com/typeshed-internal/stub_uploader).
4444

0 commit comments

Comments
 (0)