Skip to content

Commit 7e107d7

Browse files
authored
Merge branch 'main' into fix-termios-glibc-baud
2 parents 5d29918 + b9808cc commit 7e107d7

79 files changed

Lines changed: 349 additions & 218 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: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,37 @@
3737
{
3838
groupName: "most test/lint dependencies",
3939
matchManagers: ["pip_requirements", "pre-commit"],
40-
matchPackageNames: ["!pyright"],
4140
description: "Quarterly update of most test dependencies",
4241
schedule: ["every 3 months on the first day of the month"]
4342
},
43+
{
44+
groupName: "ruff",
45+
matchManagers: ["pip_requirements", "pre-commit"],
46+
matchPackageNames: ["ruff", "astral-sh/ruff-pre-commit"],
47+
description: "Quarterly update of Ruff",
48+
schedule: ["every 3 months on the first day of the month"]
49+
},
50+
{
51+
groupName: "ty",
52+
matchManagers: ["pip_requirements"],
53+
matchPackageNames: ["ty"],
54+
description: "Daily update of ty",
55+
schedule: ["before 4am"]
56+
},
57+
{
58+
groupName: "pyrefly",
59+
matchManagers: ["pip_requirements"],
60+
matchPackageNames: ["pyrefly"],
61+
description: "Daily update of pyrefly",
62+
schedule: ["before 4am"]
63+
},
64+
{
65+
groupName: "mypy",
66+
matchManagers: ["pip_requirements"],
67+
matchPackageNames: ["mypy"],
68+
description: "Daily update of mypy",
69+
schedule: ["before 4am"]
70+
},
4471
{
4572
"groupName": "pyright",
4673
"matchManagers": ["pip_requirements"],

‎.pre-commit-config.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ repos:
1818
additional_dependencies: ["json5==0.15.0"]
1919
- repo: https://github.com/astral-sh/ruff-pre-commit
2020
# The Ruff version must match requirements-tests.txt.
21-
rev: c59bba8fb259db0fec2bbb77ad8ba51ea7341b56 # frozen: v0.15.20
21+
rev: 2eeb5678de71a00c0902cbda7105d328432f72cb # frozen: v0.16.8
2222
hooks:
2323
- id: ruff
2424
name: Run ruff on stubs, tests and scripts

‎requirements-tests.txt‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Type checkers that we test our stubs against. These should always
22
# be pinned to a specific version to make failure reproducible.
33
mypy==2.3.1
4-
pyrefly==1.3.0.dev1
4+
pyrefly==1.3.1
55
pyright==1.1.414
6-
ty==0.0.59
6+
ty==0.0.83
77

88
# Libraries used by our various scripts.
99
aiohttp==3.14.3
@@ -12,7 +12,7 @@ mypy-protobuf==5.1.0; python_version < "3.15"
1212
packaging==26.3
1313
pathspec>=1.1.1
1414
pre-commit
15-
ruff==0.15.20
15+
ruff==0.16.8
1616
# Required by create_baseline_stubs.py.
1717
# stubdefaulter depends on libcst, which does not yet install cleanly on Python 3.15.
1818
stubdefaulter==0.1.0; python_version < "3.15"

‎stdlib/_interpreters.pyi‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def get_config(id: SupportsIndex, *, restrict: bool = False) -> types.SimpleName
3333
def whence(id: SupportsIndex) -> _Whence: ...
3434
def exec(
3535
id: SupportsIndex, code: str | types.CodeType | Callable[[], object], shared: _SharedDict = {}, *, restrict: bool = False
36-
) -> None | types.SimpleNamespace: ...
36+
) -> types.SimpleNamespace | None: ...
3737
def call(
3838
id: SupportsIndex,
3939
callable: Callable[..., _R],

‎stdlib/_ssl.pyi‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class _SSLContext:
7979
post_handshake_auth: bool
8080
protocol: int
8181
security_level: int
82-
sni_callback: Callable[[SSLObject, str, SSLContext], None | int] | None
82+
sni_callback: Callable[[SSLObject, str, SSLContext], int | None] | None
8383
verify_flags: int
8484
verify_mode: int
8585
def __new__(cls, protocol: int, /) -> Self: ...

‎stdlib/_typeshed/__init__.pyi‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ class SupportsTrunc(Protocol):
170170

171171
# The second and third overload could technically be combined, but splitting
172172
# them works better with some type checkers.
173-
class SupportsGet(Protocol[_KT_contra, _VT_co]): # type: ignore[misc] # Covariant type as parameter
173+
class SupportsGet(Protocol[_KT_contra, _VT_co]): # type: ignore[misc] # ty:ignore[invalid-protocol] # Covariant type as parameter
174174
@overload
175175
def get(self, key: _KT_contra, /) -> _VT_co | None: ...
176176
@overload
@@ -189,6 +189,18 @@ class SupportsKeysAndGetItem(Protocol[_KT, _VT_co]):
189189
def keys(self) -> Iterable[_KT]: ...
190190
def __getitem__(self, key: _KT, /) -> _VT_co: ...
191191

192+
class SupportsKeysAndGet(Protocol[_KT, _VT_co]): # type: ignore[misc] # ty:ignore[invalid-protocol] # Covariant type as parameter
193+
def keys(self) -> Iterable[_KT]: ...
194+
195+
@overload
196+
def get(self, key: _KT, /) -> _VT_co | None: ...
197+
@overload
198+
def get( # pyrefly: ignore[invalid-variance]
199+
self, key: _KT, default: _VT_co, / # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] # Covariant type as parameter
200+
) -> _VT_co: ...
201+
@overload
202+
def get(self, key: _KT, default: _T, /) -> _VT_co | _T: ...
203+
192204
# stable
193205
class SupportsGetItem(Protocol[_KT_contra, _VT_co]):
194206
def __getitem__(self, key: _KT_contra, /) -> _VT_co: ...

‎stdlib/ast.pyi‎

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,7 @@ if sys.version_info >= (3, 14):
11071107
**kwargs: Unpack[_Attributes],
11081108
) -> Self: ...
11091109

1110-
_ConstantValue: typing_extensions.TypeAlias = str | bytes | bool | int | float | complex | None | EllipsisType
1110+
_ConstantValue: typing_extensions.TypeAlias = str | bytes | bool | int | float | complex | EllipsisType | None
11111111

11121112
class Constant(expr):
11131113
__match_args__ = ("value", "kind")
@@ -1741,7 +1741,7 @@ if sys.version_info >= (3, 15):
17411741
mode: Literal["exec", "eval", "func_type", "single"] = "exec",
17421742
*,
17431743
type_comments: bool = False,
1744-
feature_version: None | int | tuple[int, int] = None,
1744+
feature_version: int | tuple[int, int] | None = None,
17451745
optimize: Literal[-1, 0, 1, 2] = -1,
17461746
module: str | None = None,
17471747
) -> _T: ...
@@ -1752,7 +1752,7 @@ if sys.version_info >= (3, 15):
17521752
mode: Literal["exec"] = "exec",
17531753
*,
17541754
type_comments: bool = False,
1755-
feature_version: None | int | tuple[int, int] = None,
1755+
feature_version: int | tuple[int, int] | None = None,
17561756
optimize: Literal[-1, 0, 1, 2] = -1,
17571757
module: str | None = None,
17581758
) -> Module: ...
@@ -1763,7 +1763,7 @@ if sys.version_info >= (3, 15):
17631763
mode: Literal["eval"],
17641764
*,
17651765
type_comments: bool = False,
1766-
feature_version: None | int | tuple[int, int] = None,
1766+
feature_version: int | tuple[int, int] | None = None,
17671767
optimize: Literal[-1, 0, 1, 2] = -1,
17681768
module: str | None = None,
17691769
) -> Expression: ...
@@ -1774,7 +1774,7 @@ if sys.version_info >= (3, 15):
17741774
mode: Literal["func_type"],
17751775
*,
17761776
type_comments: bool = False,
1777-
feature_version: None | int | tuple[int, int] = None,
1777+
feature_version: int | tuple[int, int] | None = None,
17781778
optimize: Literal[-1, 0, 1, 2] = -1,
17791779
module: str | None = None,
17801780
) -> FunctionType: ...
@@ -1785,7 +1785,7 @@ if sys.version_info >= (3, 15):
17851785
mode: Literal["single"],
17861786
*,
17871787
type_comments: bool = False,
1788-
feature_version: None | int | tuple[int, int] = None,
1788+
feature_version: int | tuple[int, int] | None = None,
17891789
optimize: Literal[-1, 0, 1, 2] = -1,
17901790
module: str | None = None,
17911791
) -> Interactive: ...
@@ -1795,7 +1795,7 @@ if sys.version_info >= (3, 15):
17951795
*,
17961796
mode: Literal["eval"],
17971797
type_comments: bool = False,
1798-
feature_version: None | int | tuple[int, int] = None,
1798+
feature_version: int | tuple[int, int] | None = None,
17991799
optimize: Literal[-1, 0, 1, 2] = -1,
18001800
module: str | None = None,
18011801
) -> Expression: ...
@@ -1805,7 +1805,7 @@ if sys.version_info >= (3, 15):
18051805
*,
18061806
mode: Literal["func_type"],
18071807
type_comments: bool = False,
1808-
feature_version: None | int | tuple[int, int] = None,
1808+
feature_version: int | tuple[int, int] | None = None,
18091809
optimize: Literal[-1, 0, 1, 2] = -1,
18101810
module: str | None = None,
18111811
) -> FunctionType: ...
@@ -1815,7 +1815,7 @@ if sys.version_info >= (3, 15):
18151815
*,
18161816
mode: Literal["single"],
18171817
type_comments: bool = False,
1818-
feature_version: None | int | tuple[int, int] = None,
1818+
feature_version: int | tuple[int, int] | None = None,
18191819
optimize: Literal[-1, 0, 1, 2] = -1,
18201820
module: str | None = None,
18211821
) -> Interactive: ...
@@ -1826,7 +1826,7 @@ if sys.version_info >= (3, 15):
18261826
mode: str = "exec",
18271827
*,
18281828
type_comments: bool = False,
1829-
feature_version: None | int | tuple[int, int] = None,
1829+
feature_version: int | tuple[int, int] | None = None,
18301830
optimize: Literal[-1, 0, 1, 2] = -1,
18311831
module: str | None = None,
18321832
) -> mod: ...
@@ -1838,7 +1838,7 @@ elif sys.version_info >= (3, 13):
18381838
mode: Literal["exec", "eval", "func_type", "single"] = "exec",
18391839
*,
18401840
type_comments: bool = False,
1841-
feature_version: None | int | tuple[int, int] = None,
1841+
feature_version: int | tuple[int, int] | None = None,
18421842
optimize: Literal[-1, 0, 1, 2] = -1,
18431843
) -> _T: ...
18441844
@overload
@@ -1848,7 +1848,7 @@ elif sys.version_info >= (3, 13):
18481848
mode: Literal["exec"] = "exec",
18491849
*,
18501850
type_comments: bool = False,
1851-
feature_version: None | int | tuple[int, int] = None,
1851+
feature_version: int | tuple[int, int] | None = None,
18521852
optimize: Literal[-1, 0, 1, 2] = -1,
18531853
) -> Module: ...
18541854
@overload
@@ -1858,7 +1858,7 @@ elif sys.version_info >= (3, 13):
18581858
mode: Literal["eval"],
18591859
*,
18601860
type_comments: bool = False,
1861-
feature_version: None | int | tuple[int, int] = None,
1861+
feature_version: int | tuple[int, int] | None = None,
18621862
optimize: Literal[-1, 0, 1, 2] = -1,
18631863
) -> Expression: ...
18641864
@overload
@@ -1868,7 +1868,7 @@ elif sys.version_info >= (3, 13):
18681868
mode: Literal["func_type"],
18691869
*,
18701870
type_comments: bool = False,
1871-
feature_version: None | int | tuple[int, int] = None,
1871+
feature_version: int | tuple[int, int] | None = None,
18721872
optimize: Literal[-1, 0, 1, 2] = -1,
18731873
) -> FunctionType: ...
18741874
@overload
@@ -1878,7 +1878,7 @@ elif sys.version_info >= (3, 13):
18781878
mode: Literal["single"],
18791879
*,
18801880
type_comments: bool = False,
1881-
feature_version: None | int | tuple[int, int] = None,
1881+
feature_version: int | tuple[int, int] | None = None,
18821882
optimize: Literal[-1, 0, 1, 2] = -1,
18831883
) -> Interactive: ...
18841884
@overload
@@ -1887,7 +1887,7 @@ elif sys.version_info >= (3, 13):
18871887
*,
18881888
mode: Literal["eval"],
18891889
type_comments: bool = False,
1890-
feature_version: None | int | tuple[int, int] = None,
1890+
feature_version: int | tuple[int, int] | None = None,
18911891
optimize: Literal[-1, 0, 1, 2] = -1,
18921892
) -> Expression: ...
18931893
@overload
@@ -1896,7 +1896,7 @@ elif sys.version_info >= (3, 13):
18961896
*,
18971897
mode: Literal["func_type"],
18981898
type_comments: bool = False,
1899-
feature_version: None | int | tuple[int, int] = None,
1899+
feature_version: int | tuple[int, int] | None = None,
19001900
optimize: Literal[-1, 0, 1, 2] = -1,
19011901
) -> FunctionType: ...
19021902
@overload
@@ -1905,7 +1905,7 @@ elif sys.version_info >= (3, 13):
19051905
*,
19061906
mode: Literal["single"],
19071907
type_comments: bool = False,
1908-
feature_version: None | int | tuple[int, int] = None,
1908+
feature_version: int | tuple[int, int] | None = None,
19091909
optimize: Literal[-1, 0, 1, 2] = -1,
19101910
) -> Interactive: ...
19111911
@overload
@@ -1915,7 +1915,7 @@ elif sys.version_info >= (3, 13):
19151915
mode: str = "exec",
19161916
*,
19171917
type_comments: bool = False,
1918-
feature_version: None | int | tuple[int, int] = None,
1918+
feature_version: int | tuple[int, int] | None = None,
19191919
optimize: Literal[-1, 0, 1, 2] = -1,
19201920
) -> mod: ...
19211921
else:
@@ -1926,7 +1926,7 @@ else:
19261926
mode: Literal["exec", "eval", "func_type", "single"] = "exec",
19271927
*,
19281928
type_comments: bool = False,
1929-
feature_version: None | int | tuple[int, int] = None,
1929+
feature_version: int | tuple[int, int] | None = None,
19301930
) -> _T: ...
19311931
@overload
19321932
def parse(
@@ -1935,7 +1935,7 @@ else:
19351935
mode: Literal["exec"] = "exec",
19361936
*,
19371937
type_comments: bool = False,
1938-
feature_version: None | int | tuple[int, int] = None,
1938+
feature_version: int | tuple[int, int] | None = None,
19391939
) -> Module: ...
19401940
@overload
19411941
def parse(
@@ -1944,7 +1944,7 @@ else:
19441944
mode: Literal["eval"],
19451945
*,
19461946
type_comments: bool = False,
1947-
feature_version: None | int | tuple[int, int] = None,
1947+
feature_version: int | tuple[int, int] | None = None,
19481948
) -> Expression: ...
19491949
@overload
19501950
def parse(
@@ -1953,7 +1953,7 @@ else:
19531953
mode: Literal["func_type"],
19541954
*,
19551955
type_comments: bool = False,
1956-
feature_version: None | int | tuple[int, int] = None,
1956+
feature_version: int | tuple[int, int] | None = None,
19571957
) -> FunctionType: ...
19581958
@overload
19591959
def parse(
@@ -1962,31 +1962,31 @@ else:
19621962
mode: Literal["single"],
19631963
*,
19641964
type_comments: bool = False,
1965-
feature_version: None | int | tuple[int, int] = None,
1965+
feature_version: int | tuple[int, int] | None = None,
19661966
) -> Interactive: ...
19671967
@overload
19681968
def parse(
19691969
source: str | ReadableBuffer,
19701970
*,
19711971
mode: Literal["eval"],
19721972
type_comments: bool = False,
1973-
feature_version: None | int | tuple[int, int] = None,
1973+
feature_version: int | tuple[int, int] | None = None,
19741974
) -> Expression: ...
19751975
@overload
19761976
def parse(
19771977
source: str | ReadableBuffer,
19781978
*,
19791979
mode: Literal["func_type"],
19801980
type_comments: bool = False,
1981-
feature_version: None | int | tuple[int, int] = None,
1981+
feature_version: int | tuple[int, int] | None = None,
19821982
) -> FunctionType: ...
19831983
@overload
19841984
def parse(
19851985
source: str | ReadableBuffer,
19861986
*,
19871987
mode: Literal["single"],
19881988
type_comments: bool = False,
1989-
feature_version: None | int | tuple[int, int] = None,
1989+
feature_version: int | tuple[int, int] | None = None,
19901990
) -> Interactive: ...
19911991
@overload
19921992
def parse(
@@ -1995,7 +1995,7 @@ else:
19951995
mode: str = "exec",
19961996
*,
19971997
type_comments: bool = False,
1998-
feature_version: None | int | tuple[int, int] = None,
1998+
feature_version: int | tuple[int, int] | None = None,
19991999
) -> mod: ...
20002000

20012001
def literal_eval(node_or_string: str | AST) -> Any: ...

‎stdlib/asyncio/base_events.pyi‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ _ProtocolT = TypeVar("_ProtocolT", bound=BaseProtocol)
2323
_Context: TypeAlias = dict[str, Any]
2424
_ExceptionHandler: TypeAlias = Callable[[AbstractEventLoop, _Context], object]
2525
_ProtocolFactory: TypeAlias = Callable[[], BaseProtocol]
26-
_SSLContext: TypeAlias = bool | None | ssl.SSLContext
26+
_SSLContext: TypeAlias = bool | ssl.SSLContext | None
2727

2828
class Server(AbstractServer):
2929
if sys.version_info >= (3, 11):

‎stdlib/asyncio/events.pyi‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ _ProtocolT = TypeVar("_ProtocolT", bound=BaseProtocol)
6666
_Context: TypeAlias = dict[str, Any]
6767
_ExceptionHandler: TypeAlias = Callable[[AbstractEventLoop, _Context], object]
6868
_ProtocolFactory: TypeAlias = Callable[[], BaseProtocol]
69-
_SSLContext: TypeAlias = bool | None | ssl.SSLContext
69+
_SSLContext: TypeAlias = bool | ssl.SSLContext | None
7070

7171
@type_check_only
7272
class _TaskFactory(Protocol):

0 commit comments

Comments
 (0)