Skip to content

Commit f2aa6be

Browse files
authored
Merge branch 'main' into tarfile-debug
2 parents 86ebca9 + a9fbf47 commit f2aa6be

File tree

304 files changed

+3341
-5266
lines changed

Some content is hidden

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

304 files changed

+3341
-5266
lines changed

.github/workflows/daily.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ 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:

.github/workflows/meta_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ 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

.github/workflows/stubtest_stdlib.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ 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:

.github/workflows/tests.yml

Lines changed: 2 additions & 2 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

CONTRIBUTING.md

Lines changed: 0 additions & 2 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

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

pyproject.toml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# https://github.com/astral-sh/uv/issues/8666
44
name = "typeshed"
55
version = "0"
6-
requires-python = ">=3.9" # Minimum version to run tests, used by uv run
6+
requires-python = ">=3.10" # Minimum version to run tests, used by uv run
77

88
[tool.black]
99
line-length = 130
@@ -12,8 +12,6 @@ skip-magic-trailing-comma = true
1212

1313
[tool.ruff]
1414
line-length = 130
15-
# Oldest supported Python version
16-
target-version = "py39"
1715
fix = true
1816
exclude = [
1917
# virtual environment
@@ -149,6 +147,12 @@ extend-safe-fixes = [
149147
"UP036", # Remove unnecessary `sys.version_info` blocks
150148
]
151149
ignore = [
150+
###
151+
# TODO: Disabled temporarily, until Python 3.9 support is fully removed in
152+
# May 2026.
153+
###
154+
"UP035", # import from typing
155+
"UP036", # Remove unnecessary `sys.version_info` blocks
152156
###
153157
# Rules that can conflict with the formatter (Black)
154158
# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
@@ -255,12 +259,10 @@ extra-standard-library = [
255259
"_typeshed",
256260
"typing_extensions",
257261
# Extra modules not recognized by Ruff
258-
# Added in Python 3.9
259-
"zoneinfo",
260262
# Added in Python 3.14
261263
"compression",
262264
]
263265
known-first-party = ["_utils", "ts_utils"]
264266

265267
[tool.typeshed]
266-
oldest_supported_python = "3.9"
268+
oldest_supported_python = "3.10"

pyrightconfig.stricter.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
"stubs/opentracing/opentracing/span.pyi",
6868
"stubs/paramiko/paramiko/_winapi.pyi",
6969
"stubs/parsimonious/parsimonious/nodes.pyi",
70-
"stubs/passlib",
7170
"stubs/peewee",
7271
"stubs/pexpect",
7372
"stubs/pika",
@@ -79,7 +78,6 @@
7978
"stubs/pycurl",
8079
"stubs/Pygments",
8180
"stubs/PyMySQL",
82-
"stubs/python-dateutil",
8381
"stubs/python-jose",
8482
"stubs/pywin32",
8583
"stubs/PyYAML",

stdlib/@tests/stubtest_allowlists/common.txt

Lines changed: 60 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ _frozen_importlib_external.WindowsRegistryFinder.REGISTRY_KEY
5959
_frozen_importlib_external.WindowsRegistryFinder.REGISTRY_KEY_DEBUG
6060

6161
builtins.OSError.characters_written # GetSetDescriptor that always raises AttributeError
62+
builtins.ellipsis # does not exist at runtime, see https://github.com/python/typeshed/issues/7580
6263
builtins.float.__getformat__ # Internal method for CPython test suite
6364

6465
# These super() dunders don't seem to be particularly useful,
@@ -180,20 +181,49 @@ sys.tracebacklimit # Must be set first
180181
# ==========================================================
181182

182183
# async at runtime, deliberately not in the stub, see #7491
183-
_collections_abc.AsyncGenerator.asend # pos-only differences also.
184+
_collections_abc.AsyncGenerator.asend # pos-only differences also
184185
_collections_abc.AsyncGenerator.__anext__
185186
_collections_abc.AsyncGenerator.aclose
187+
_collections_abc.AsyncGenerator.athrow # pos-only differences also
186188
_collections_abc.AsyncIterator.__anext__
187189

190+
# positional-only complaints caused by differences between typing aliases and the "real" classes in the stdlib
191+
_collections_abc.Coroutine.send
192+
_collections_abc.Coroutine.throw
193+
_collections_abc.Generator.send
194+
_collections_abc.Generator.throw
195+
196+
# These are not positional-only at runtime, but we treat them as positional-only to match dict.
197+
_collections_abc.MutableMapping.pop
198+
_collections_abc.MutableMapping.setdefault
199+
188200
# Pretend typing.ByteString is a Union, to better match its documented semantics.
189201
# As a side effect, this changes the definition of collections.abc.ByteString, which is okay,
190202
# because it's not an ABC that makes any sense and was deprecated in 3.12
191203
_collections_abc\.ByteString
192204
typing\.ByteString
193205

194206
_collections_abc.Callable # Typing-related weirdness
195-
_collections_abc.Mapping.get # Adding None to the Union messed up mypy
196-
_collections_abc.Sequence.index # Supporting None in end is not mandatory
207+
208+
# While the implementation in _collections_abc.py uses positional-or-keyword args,
209+
# this is unsafe as canonical types list/dict/set etc. only support positional args.
210+
# See: https://github.com/python/typeshed/issues/14071
211+
# See: https://github.com/python/cpython/issues/135312
212+
_collections_abc.Mapping.get
213+
_collections_abc.MutableSequence.append
214+
_collections_abc.MutableSequence.extend
215+
_collections_abc.MutableSequence.insert
216+
_collections_abc.MutableSequence.pop
217+
_collections_abc.MutableSequence.remove
218+
_collections_abc.MutableSet.add
219+
_collections_abc.MutableSet.discard
220+
_collections_abc.MutableSet.remove
221+
_collections_abc.Sequence.count
222+
_collections_abc.Sequence.index
223+
_collections_abc.Set.isdisjoint
224+
_collections_abc.Set._from_iterable
225+
_collections_abc.ItemsView._from_iterable
226+
_collections_abc.KeysView._from_iterable
197227

198228
_ctypes.CFuncPtr # stubtest erroneously thinks it can't be subclassed
199229

@@ -217,6 +247,7 @@ argparse.Namespace.__getattr__ # The whole point of this class is its attribute
217247
_?ast.AST.__init__
218248
_?ast.excepthandler.__init__
219249
_?ast.expr.__init__
250+
_?ast.pattern.__init__
220251
_?ast.stmt.__init__
221252

222253
_ast.ImportFrom.level # None on the class, but never None on instances
@@ -235,6 +266,7 @@ asyncio.locks.Condition.locked
235266
asyncio.locks.Condition.release
236267

237268
builtins.memoryview.__contains__ # C type that implements __getitem__
269+
builtins.property.__set_name__ # Doesn't actually exist
238270
builtins.reveal_locals # Builtins that type checkers pretends exist
239271
builtins.reveal_type # Builtins that type checkers pretends exist
240272

@@ -251,6 +283,7 @@ codecs.CodecInfo.streamwriter
251283
codecs.StreamReaderWriter.\w+
252284
codecs.StreamRecoder.\w+
253285

286+
collections.UserList.index # ignoring pos-or-keyword parameter
254287
collections.UserList.sort # Runtime has *args but will error if any are supplied
255288
collections.abc.* # Types are re-exported from _collections_abc, so errors should be fixed there
256289
configparser.SectionProxy.__getattr__ # SectionProxy can have arbitrary attributes when custom converters are used
@@ -287,6 +320,8 @@ _?ctypes.Union.__setattr__ # doesn't exist, but makes things easy if we pretend
287320
# These would ideally be special-cased by type checkers; see https://github.com/python/mypy/issues/2220
288321
_?ctypes.Array.__iter__
289322

323+
dataclasses.KW_ONLY # white lies around defaults
324+
290325
# __all__-related weirdness (see #6523)
291326
email.__all__
292327
email.base64mime
@@ -317,6 +352,8 @@ http.HTTPStatus.description # set in __new__; work-around for enum wierdness
317352
http.HTTPStatus.phrase # set in __new__; work-around for enum wierdness
318353
imaplib.IMAP4_SSL.ssl # Depends on the existence and flags of SSL
319354

355+
importlib._abc.Loader.exec_module # See Lib/importlib/_abc.py. Might be defined for backwards compatibility
356+
320357
# runtime is *args, **kwargs due to a wrapper; we have more accurate signatures in the stubs
321358
importlib._bootstrap_external.ExtensionFileLoader.get_filename
322359
importlib._bootstrap_external.FileLoader.get_filename
@@ -326,6 +363,8 @@ importlib.abc.FileLoader.get_filename
326363
importlib.abc.FileLoader.load_module
327364
importlib.machinery.ExtensionFileLoader.get_filename
328365

366+
importlib.metadata._meta.SimplePath.joinpath # Runtime definition of protocol is incorrect
367+
329368
# We can't distinguish not having a default value from having a default value of inspect.Parameter.empty
330369
inspect.Parameter.__init__
331370
inspect.Signature.__init__
@@ -446,6 +485,8 @@ traceback.TracebackException.from_exception # explicitly expanding arguments go
446485
turtle.ScrolledCanvas.find_all # Dynamically created, has unnecessary *args
447486
turtle.ScrolledCanvas.select_clear # Dynamically created, has unnecessary *args
448487
turtle.ScrolledCanvas.select_item # Dynamically created, has unnecessary *args
488+
# this is implemented with *args having a minimum size so arguments before it must be positional (but stubtest doesn't see that)
489+
tkinter.ttk.Style.element_create
449490

450491
types.GenericAlias.__call__ # Would be complicated to fix properly, Any could silence problems. #6392
451492
types.GenericAlias.__getattr__
@@ -516,6 +557,17 @@ typing(_extensions)?\.(Async)?ContextManager
516557
typing(_extensions)?\.IO\.__iter__
517558
typing(_extensions)?\.IO\.__next__
518559

560+
# typing.IO uses positional-or-keyword arguments, but in the stubs we prefer
561+
# to mark these as positional-only for compatibility with existing sub-classes.
562+
typing(_extensions)?\.BinaryIO\.write
563+
typing(_extensions)?\.IO\.read
564+
typing(_extensions)?\.IO\.readline
565+
typing(_extensions)?\.IO\.readlines
566+
typing(_extensions)?\.IO\.seek
567+
typing(_extensions)?\.IO\.truncate
568+
typing(_extensions)?\.IO\.write
569+
typing(_extensions)?\.IO\.writelines
570+
519571
types.MethodType.__closure__ # read-only but not actually a property; stubtest thinks it doesn't exist.
520572
types.MethodType.__code__ # read-only but not actually a property; stubtest thinks it doesn't exist.
521573
types.MethodType.__defaults__ # read-only but not actually a property; stubtest thinks it doesn't exist.
@@ -550,3 +602,8 @@ xml.etree.cElementTree.XMLParser.__init__ # Defined in C so has general signatu
550602
# These would ideally be special-cased by type checkers; see https://github.com/python/mypy/issues/2220
551603
xml.etree.ElementTree.Element.__iter__
552604
xml.etree.cElementTree.Element.__iter__
605+
606+
# These three have a pos-or-keyword first parameter at runtime, but deliberately have a pos-only first parameter in the stub. #6812
607+
posixpath.join
608+
ntpath.join
609+
os.path.join

stdlib/@tests/stubtest_allowlists/darwin-py310.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ tarfile.TarFile.makelink_with_filter
6464

6565
# Incompatible changes introduced in Python 3.10.20
6666
# (Remove once 3.10.20 becomes available for GitHub Actions)
67+
email._header_value_parser.make_parenthesis_pairs
6768
html.parser.HTMLParser.__init__ # parameter `scripting`
6869
pyexpat.XMLParserType.SetAllocTrackerActivationThreshold
6970
pyexpat.XMLParserType.SetAllocTrackerMaximumAmplification

0 commit comments

Comments
 (0)