Skip to content

Commit 99f7bf4

Browse files
committed
Merge remote-tracking branch 'upstream/master' into bugfix/gh-19920-overload-tupleness-change-crash
2 parents 654d2e3 + fb16e93 commit 99f7bf4

File tree

98 files changed

+3604
-928
lines changed

Some content is hidden

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

98 files changed

+3604
-928
lines changed

.github/workflows/test.yml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,25 @@ jobs:
5959
toxenv: py
6060
tox_extra_args: "-n 4"
6161
test_mypyc: true
62-
- name: Test suite with py313-windows-64
63-
python: '3.13'
64-
os: windows-latest
65-
toxenv: py
66-
tox_extra_args: "-n 4"
67-
68-
- name: Test suite with py314-dev-ubuntu
69-
python: '3.14-dev'
62+
- name: Test suite with py314-ubuntu, mypyc-compiled
63+
python: '3.14'
7064
os: ubuntu-24.04-arm
7165
toxenv: py
7266
tox_extra_args: "-n 4"
73-
# allow_failure: true
7467
test_mypyc: true
68+
- name: Test suite with py314-windows-64
69+
python: '3.14'
70+
os: windows-latest
71+
toxenv: py
72+
tox_extra_args: "-n 4"
73+
74+
# - name: Test suite with py315-dev-ubuntu
75+
# python: '3.15-dev'
76+
# os: ubuntu-24.04-arm
77+
# toxenv: py
78+
# tox_extra_args: "-n 4"
79+
# # allow_failure: true
80+
# test_mypyc: true
7581

7682
- name: mypyc runtime tests with py39-macos
7783
python: '3.9.21'

.github/workflows/test_stubgenc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
- 'mypy/stubgenc.py'
1212
- 'mypy/stubdoc.py'
1313
- 'mypy/stubutil.py'
14-
- 'test-data/stubgen/**'
14+
- 'test-data/pybind11_fixtures/**'
1515

1616
permissions:
1717
contents: read

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ repos:
4141
# actionlint has a shellcheck integration which extracts shell scripts in `run:` steps from GitHub Actions
4242
# and checks these with shellcheck. This is arguably its most useful feature,
4343
# but the integration only works if shellcheck is installed
44-
- "github.com/wasilibs/go-shellcheck/cmd/[email protected].0"
44+
- "github.com/wasilibs/go-shellcheck/cmd/[email protected].1"
4545
- repo: https://github.com/woodruffw/zizmor-pre-commit
4646
rev: v1.5.2
4747
hooks:

docs/source/generics.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1165,7 +1165,7 @@ This example correctly uses a covariant type variable:
11651165
11661166
See :ref:`variance-of-generics` for more about variance.
11671167

1168-
Generic protocols can also be recursive. Example (Python 3.12 synta):
1168+
Generic protocols can also be recursive. Example (Python 3.12 syntax):
11691169

11701170
.. code-block:: python
11711171

misc/typeshed_patches/0001-Remove-use-of-LiteralString-in-builtins-13743.patch

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From 805d7fc06a8bee350959512e0908a18a87b7f8c2 Mon Sep 17 00:00:00 2001
1+
From 3229a6066cff3d80d6cb923322c2d42a300d0be3 Mon Sep 17 00:00:00 2001
22
From: Shantanu <[email protected]>
33
Date: Mon, 26 Sep 2022 12:55:07 -0700
44
Subject: [PATCH] Remove use of LiteralString in builtins (#13743)
@@ -8,7 +8,7 @@ Subject: [PATCH] Remove use of LiteralString in builtins (#13743)
88
1 file changed, 1 insertion(+), 99 deletions(-)
99

1010
diff --git a/mypy/typeshed/stdlib/builtins.pyi b/mypy/typeshed/stdlib/builtins.pyi
11-
index c7ab95482..3e93da36e 100644
11+
index 969d16876..044e264d2 100644
1212
--- a/mypy/typeshed/stdlib/builtins.pyi
1313
+++ b/mypy/typeshed/stdlib/builtins.pyi
1414
@@ -63,7 +63,6 @@ from typing import ( # noqa: Y022,UP035
@@ -19,10 +19,10 @@ index c7ab95482..3e93da36e 100644
1919
ParamSpec,
2020
Self,
2121
TypeAlias,
22-
@@ -468,31 +467,16 @@ class str(Sequence[str]):
23-
def __new__(cls, object: object = ...) -> Self: ...
22+
@@ -480,31 +479,16 @@ class str(Sequence[str]):
23+
def __new__(cls, object: object = "") -> Self: ...
2424
@overload
25-
def __new__(cls, object: ReadableBuffer, encoding: str = ..., errors: str = ...) -> Self: ...
25+
def __new__(cls, object: ReadableBuffer, encoding: str = "utf-8", errors: str = "strict") -> Self: ...
2626
- @overload
2727
- def capitalize(self: LiteralString) -> LiteralString: ...
2828
- @overload
@@ -35,23 +35,23 @@ index c7ab95482..3e93da36e 100644
3535
- def center(self: LiteralString, width: SupportsIndex, fillchar: LiteralString = " ", /) -> LiteralString: ...
3636
- @overload
3737
def center(self, width: SupportsIndex, fillchar: str = " ", /) -> str: ... # type: ignore[misc]
38-
def count(self, sub: str, start: SupportsIndex | None = ..., end: SupportsIndex | None = ..., /) -> int: ...
38+
def count(self, sub: str, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /) -> int: ...
3939
def encode(self, encoding: str = "utf-8", errors: str = "strict") -> bytes: ...
4040
def endswith(
41-
self, suffix: str | tuple[str, ...], start: SupportsIndex | None = ..., end: SupportsIndex | None = ..., /
41+
self, suffix: str | tuple[str, ...], start: SupportsIndex | None = None, end: SupportsIndex | None = None, /
4242
) -> bool: ...
4343
- @overload
4444
- def expandtabs(self: LiteralString, tabsize: SupportsIndex = 8) -> LiteralString: ...
4545
- @overload
4646
def expandtabs(self, tabsize: SupportsIndex = 8) -> str: ... # type: ignore[misc]
47-
def find(self, sub: str, start: SupportsIndex | None = ..., end: SupportsIndex | None = ..., /) -> int: ...
47+
def find(self, sub: str, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /) -> int: ...
4848
- @overload
4949
- def format(self: LiteralString, *args: LiteralString, **kwargs: LiteralString) -> LiteralString: ...
5050
- @overload
5151
def format(self, *args: object, **kwargs: object) -> str: ...
5252
def format_map(self, mapping: _FormatMapMapping, /) -> str: ...
53-
def index(self, sub: str, start: SupportsIndex | None = ..., end: SupportsIndex | None = ..., /) -> int: ...
54-
@@ -508,98 +492,34 @@ class str(Sequence[str]):
53+
def index(self, sub: str, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /) -> int: ...
54+
@@ -520,98 +504,34 @@ class str(Sequence[str]):
5555
def isspace(self) -> bool: ...
5656
def istitle(self) -> bool: ...
5757
def isupper(self) -> bool: ...
@@ -98,8 +98,8 @@ index c7ab95482..3e93da36e 100644
9898
- def removesuffix(self: LiteralString, suffix: LiteralString, /) -> LiteralString: ...
9999
- @overload
100100
def removesuffix(self, suffix: str, /) -> str: ... # type: ignore[misc]
101-
def rfind(self, sub: str, start: SupportsIndex | None = ..., end: SupportsIndex | None = ..., /) -> int: ...
102-
def rindex(self, sub: str, start: SupportsIndex | None = ..., end: SupportsIndex | None = ..., /) -> int: ...
101+
def rfind(self, sub: str, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /) -> int: ...
102+
def rindex(self, sub: str, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /) -> int: ...
103103
- @overload
104104
- def rjust(self: LiteralString, width: SupportsIndex, fillchar: LiteralString = " ", /) -> LiteralString: ...
105105
- @overload
@@ -125,7 +125,7 @@ index c7ab95482..3e93da36e 100644
125125
- @overload
126126
def splitlines(self, keepends: bool = False) -> list[str]: ... # type: ignore[misc]
127127
def startswith(
128-
self, prefix: str | tuple[str, ...], start: SupportsIndex | None = ..., end: SupportsIndex | None = ..., /
128+
self, prefix: str | tuple[str, ...], start: SupportsIndex | None = None, end: SupportsIndex | None = None, /
129129
) -> bool: ...
130130
- @overload
131131
- def strip(self: LiteralString, chars: LiteralString | None = None, /) -> LiteralString: ...
@@ -150,7 +150,7 @@ index c7ab95482..3e93da36e 100644
150150
def zfill(self, width: SupportsIndex, /) -> str: ... # type: ignore[misc]
151151
@staticmethod
152152
@overload
153-
@@ -610,39 +530,21 @@ class str(Sequence[str]):
153+
@@ -622,39 +542,21 @@ class str(Sequence[str]):
154154
@staticmethod
155155
@overload
156156
def maketrans(x: str, y: str, z: str, /) -> dict[int, int | None]: ...
@@ -192,5 +192,5 @@ index c7ab95482..3e93da36e 100644
192192
def __getnewargs__(self) -> tuple[str]: ...
193193
def __format__(self, format_spec: str, /) -> str: ...
194194
--
195-
2.50.1
195+
2.51.1
196196

misc/typeshed_patches/0001-Revert-Remove-redundant-inheritances-from-Iterator.patch

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From 438dbb1300b77331940d7db8f010e97305745116 Mon Sep 17 00:00:00 2001
1+
From 7678bc3f80e4d3f04a0ff0ee3a7d51f49ae4c465 Mon Sep 17 00:00:00 2001
22
From: Marc Mueller <[email protected]>
33
Date: Sat, 21 Dec 2024 22:36:38 +0100
44
Subject: [PATCH] Revert Remove redundant inheritances from Iterator in
@@ -36,10 +36,10 @@ index d663f5d93..f43178e4d 100644
3636
@property
3737
def _exception(self) -> BaseException | None: ...
3838
diff --git a/mypy/typeshed/stdlib/builtins.pyi b/mypy/typeshed/stdlib/builtins.pyi
39-
index f2dd00079..784ee7eac 100644
39+
index 044e264d2..6d813f172 100644
4040
--- a/mypy/typeshed/stdlib/builtins.pyi
4141
+++ b/mypy/typeshed/stdlib/builtins.pyi
42-
@@ -1209,7 +1209,7 @@ class frozenset(AbstractSet[_T_co]):
42+
@@ -1210,7 +1210,7 @@ class frozenset(AbstractSet[_T_co]):
4343
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
4444

4545
@disjoint_base
@@ -48,7 +48,7 @@ index f2dd00079..784ee7eac 100644
4848
def __new__(cls, iterable: Iterable[_T], start: int = 0) -> Self: ...
4949
def __iter__(self) -> Self: ...
5050
def __next__(self) -> tuple[int, _T]: ...
51-
@@ -1405,7 +1405,7 @@ else:
51+
@@ -1404,7 +1404,7 @@ else:
5252
exit: _sitebuiltins.Quitter
5353

5454
@disjoint_base
@@ -57,7 +57,7 @@ index f2dd00079..784ee7eac 100644
5757
@overload
5858
def __new__(cls, function: None, iterable: Iterable[_T | None], /) -> Self: ...
5959
@overload
60-
@@ -1469,7 +1469,7 @@ license: _sitebuiltins._Printer
60+
@@ -1468,7 +1468,7 @@ license: _sitebuiltins._Printer
6161

6262
def locals() -> dict[str, Any]: ...
6363
@disjoint_base
@@ -66,7 +66,7 @@ index f2dd00079..784ee7eac 100644
6666
# 3.14 adds `strict` argument.
6767
if sys.version_info >= (3, 14):
6868
@overload
69-
@@ -1776,7 +1776,7 @@ def pow(base: _SupportsSomeKindOfPow, exp: complex, mod: None = None) -> complex
69+
@@ -1775,7 +1775,7 @@ def pow(base: _SupportsSomeKindOfPow, exp: complex, mod: None = None) -> complex
7070
quit: _sitebuiltins.Quitter
7171

7272
@disjoint_base
@@ -75,15 +75,15 @@ index f2dd00079..784ee7eac 100644
7575
@overload
7676
def __new__(cls, sequence: Reversible[_T], /) -> Iterator[_T]: ... # type: ignore[misc]
7777
@overload
78-
@@ -1840,7 +1840,7 @@ def vars(object: type, /) -> types.MappingProxyType[str, Any]: ...
78+
@@ -1839,7 +1839,7 @@ def vars(object: type, /) -> types.MappingProxyType[str, Any]: ...
7979
@overload
8080
def vars(object: Any = ..., /) -> dict[str, Any]: ...
8181
@disjoint_base
8282
-class zip(Generic[_T_co]):
8383
+class zip(Iterator[_T_co]):
8484
if sys.version_info >= (3, 10):
8585
@overload
86-
def __new__(cls, *, strict: bool = ...) -> zip[Any]: ...
86+
def __new__(cls, *, strict: bool = False) -> zip[Any]: ...
8787
diff --git a/mypy/typeshed/stdlib/csv.pyi b/mypy/typeshed/stdlib/csv.pyi
8888
index 2c8e7109c..4ed0ab1d8 100644
8989
--- a/mypy/typeshed/stdlib/csv.pyi
@@ -326,5 +326,5 @@ index 6b0f1ba94..882cd143c 100644
326326
@property
327327
def connection(self) -> Connection: ...
328328
--
329-
2.51.0
329+
2.51.1
330330

mypy-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ typing_extensions>=4.6.0
44
mypy_extensions>=1.0.0
55
pathspec>=0.9.0
66
tomli>=1.1.0; python_version<'3.11'
7-
librt>=0.2.1
7+
librt>=0.3.0

0 commit comments

Comments
 (0)