Skip to content

Commit 4e18a7a

Browse files
authored
Merge branch 'main' into main
2 parents 490e437 + 64685c8 commit 4e18a7a

File tree

203 files changed

+1658
-3704
lines changed

Some content is hidden

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

203 files changed

+1658
-3704
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: 1 addition & 1 deletion
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

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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"stubs/grpcio-reflection/grpc_reflection/v1alpha",
4545
"stubs/grpcio-status/grpc_status",
4646
"stubs/grpcio/grpc/__init__.pyi",
47+
"stubs/gunicorn/gunicorn/dirty",
4748
"stubs/hdbcli/hdbcli/dbapi.pyi",
4849
"stubs/html5lib",
4950
"stubs/httplib2",
@@ -66,7 +67,6 @@
6667
"stubs/opentracing/opentracing/span.pyi",
6768
"stubs/paramiko/paramiko/_winapi.pyi",
6869
"stubs/parsimonious/parsimonious/nodes.pyi",
69-
"stubs/passlib",
7070
"stubs/peewee",
7171
"stubs/pexpect",
7272
"stubs/pika",

stdlib/@tests/stubtest_allowlists/common.txt

Lines changed: 40 additions & 1 deletion
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,11 +181,22 @@ 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
@@ -217,6 +229,7 @@ argparse.Namespace.__getattr__ # The whole point of this class is its attribute
217229
_?ast.AST.__init__
218230
_?ast.excepthandler.__init__
219231
_?ast.expr.__init__
232+
_?ast.pattern.__init__
220233
_?ast.stmt.__init__
221234

222235
_ast.ImportFrom.level # None on the class, but never None on instances
@@ -235,6 +248,7 @@ asyncio.locks.Condition.locked
235248
asyncio.locks.Condition.release
236249

237250
builtins.memoryview.__contains__ # C type that implements __getitem__
251+
builtins.property.__set_name__ # Doesn't actually exist
238252
builtins.reveal_locals # Builtins that type checkers pretends exist
239253
builtins.reveal_type # Builtins that type checkers pretends exist
240254

@@ -251,6 +265,7 @@ codecs.CodecInfo.streamwriter
251265
codecs.StreamReaderWriter.\w+
252266
codecs.StreamRecoder.\w+
253267

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

305+
dataclasses.KW_ONLY # white lies around defaults
306+
290307
# __all__-related weirdness (see #6523)
291308
email.__all__
292309
email.base64mime
@@ -317,6 +334,8 @@ http.HTTPStatus.description # set in __new__; work-around for enum wierdness
317334
http.HTTPStatus.phrase # set in __new__; work-around for enum wierdness
318335
imaplib.IMAP4_SSL.ssl # Depends on the existence and flags of SSL
319336

337+
importlib._abc.Loader.exec_module # See Lib/importlib/_abc.py. Might be defined for backwards compatibility
338+
320339
# runtime is *args, **kwargs due to a wrapper; we have more accurate signatures in the stubs
321340
importlib._bootstrap_external.ExtensionFileLoader.get_filename
322341
importlib._bootstrap_external.FileLoader.get_filename
@@ -326,6 +345,8 @@ importlib.abc.FileLoader.get_filename
326345
importlib.abc.FileLoader.load_module
327346
importlib.machinery.ExtensionFileLoader.get_filename
328347

348+
importlib.metadata._meta.SimplePath.joinpath # Runtime definition of protocol is incorrect
349+
329350
# We can't distinguish not having a default value from having a default value of inspect.Parameter.empty
330351
inspect.Parameter.__init__
331352
inspect.Signature.__init__
@@ -446,6 +467,8 @@ traceback.TracebackException.from_exception # explicitly expanding arguments go
446467
turtle.ScrolledCanvas.find_all # Dynamically created, has unnecessary *args
447468
turtle.ScrolledCanvas.select_clear # Dynamically created, has unnecessary *args
448469
turtle.ScrolledCanvas.select_item # Dynamically created, has unnecessary *args
470+
# this is implemented with *args having a minimum size so arguments before it must be positional (but stubtest doesn't see that)
471+
tkinter.ttk.Style.element_create
449472

450473
types.GenericAlias.__call__ # Would be complicated to fix properly, Any could silence problems. #6392
451474
types.GenericAlias.__getattr__
@@ -516,6 +539,17 @@ typing(_extensions)?\.(Async)?ContextManager
516539
typing(_extensions)?\.IO\.__iter__
517540
typing(_extensions)?\.IO\.__next__
518541

542+
# typing.IO uses positional-or-keyword arguments, but in the stubs we prefer
543+
# to mark these as positional-only for compatibility with existing sub-classes.
544+
typing(_extensions)?\.BinaryIO\.write
545+
typing(_extensions)?\.IO\.read
546+
typing(_extensions)?\.IO\.readline
547+
typing(_extensions)?\.IO\.readlines
548+
typing(_extensions)?\.IO\.seek
549+
typing(_extensions)?\.IO\.truncate
550+
typing(_extensions)?\.IO\.write
551+
typing(_extensions)?\.IO\.writelines
552+
519553
types.MethodType.__closure__ # read-only but not actually a property; stubtest thinks it doesn't exist.
520554
types.MethodType.__code__ # read-only but not actually a property; stubtest thinks it doesn't exist.
521555
types.MethodType.__defaults__ # read-only but not actually a property; stubtest thinks it doesn't exist.
@@ -550,3 +584,8 @@ xml.etree.cElementTree.XMLParser.__init__ # Defined in C so has general signatu
550584
# These would ideally be special-cased by type checkers; see https://github.com/python/mypy/issues/2220
551585
xml.etree.ElementTree.Element.__iter__
552586
xml.etree.cElementTree.Element.__iter__
587+
588+
# These three have a pos-or-keyword first parameter at runtime, but deliberately have a pos-only first parameter in the stub. #6812
589+
posixpath.join
590+
ntpath.join
591+
os.path.join

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

Lines changed: 0 additions & 83 deletions
This file was deleted.

0 commit comments

Comments
 (0)