Skip to content

Commit 376e523

Browse files
authored
Merge branch 'python:main' into main
2 parents 52f238e + bd18cc6 commit 376e523

34 files changed

Lines changed: 486 additions & 63 deletions

.github/workflows/daily.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ jobs:
3535
strategy:
3636
matrix:
3737
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
38-
# TODO: unpin the patch versions of Python 3.13/3.14 once stubtest failures are fixed
39-
python-version: ["3.10", "3.11", "3.12", "3.13.12", "3.14.3"]
38+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
4039
fail-fast: false
4140

4241
steps:

.github/workflows/stubtest_stdlib.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ jobs:
3131
strategy:
3232
matrix:
3333
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
34-
# TODO: unpin the patch versions of Python 3.13/3.14 once stubtest failures are fixed
35-
python-version: ["3.10", "3.11", "3.12", "3.13.12", "3.14.3"]
34+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
3635
fail-fast: false
3736

3837
steps:

requirements-tests.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ termcolor>=2.3
1717
tomli==2.4.1; python_version < "3.11"
1818
tomlkit==0.14.0
1919
typing_extensions>=4.15.0rc1
20-
uv==0.11.3
20+
uv==0.11.6
2121

2222
# Utilities for typeshed infrastructure scripts.
2323
ts_utils @ file:lib

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
# =============
2+
# 3.13 and 3.14
3+
# =============
4+
5+
# Starting with Python 3.13.13, these methods accept None for the "scheduler"
6+
# and "setpgroup" parameters, but would raise a TypeError with Python 3.13.12
7+
# and earlier. For compatibility reasons, we don't allow None in the stubs.
8+
os.posix_spawn
9+
os.posix_spawnp
10+
111
# =======
212
# >= 3.13
313
# =======

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
# =============
2+
# 3.13 and 3.14
3+
# =============
4+
5+
# Starting with Python 3.14.4, these methods accept None for the "scheduler"
6+
# and "setpgroup" parameters, but would raise a TypeError with Python 3.13.12
7+
# and earlier. For compatibility reasons, we don't allow None in the stubs.
8+
os.posix_spawn
9+
os.posix_spawnp
10+
111
# =========
212
# 3.14 only
313
# =========
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# =============
2+
# 3.13 and 3.14
3+
# =============
4+
5+
# Starting with Python 3.13.13, these methods accept None for the "scheduler"
6+
# and "setpgroup" parameters, but would raise a TypeError with Python 3.13.12
7+
# and earlier. For compatibility reasons, we don't allow None in the stubs.
8+
os.posix_spawn
9+
os.posix_spawnp

stdlib/@tests/stubtest_allowlists/linux-py314.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
# =============
2+
# 3.13 and 3.14
3+
# =============
4+
5+
# Starting with Python 3.14.4, these methods accept None for the "scheduler"
6+
# and "setpgroup" parameters, but would raise a TypeError with Python 3.13.12
7+
# and earlier. For compatibility reasons, we don't allow None in the stubs.
8+
os.posix_spawn
9+
os.posix_spawnp
10+
111
# =========
212
# 3.14 only
313
# =========
Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from email.headerregistry import Address
2-
from email.message import EmailMessage
1+
from email.headerregistry import Address, BaseHeader
2+
from email.message import EmailMessage, MIMEPart
33
from typing_extensions import assert_type
44

55
msg = EmailMessage()
@@ -8,3 +8,11 @@
88

99
for a in msg.iter_attachments():
1010
assert_type(a, EmailMessage)
11+
12+
generic_msg: EmailMessage[BaseHeader, str] = EmailMessage()
13+
assert_type(generic_msg.get("To"), BaseHeader | None)
14+
assert_type(generic_msg.get_body(), MIMEPart[BaseHeader, str] | None)
15+
for a in generic_msg.iter_attachments():
16+
assert_type(a, EmailMessage[BaseHeader, str])
17+
for p in generic_msg.iter_parts():
18+
assert_type(p, MIMEPart[BaseHeader, str])

stdlib/configparser.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,19 +289,19 @@ class RawConfigParser(_Parser):
289289
def getint(self, section: _SectionName, option: str, *, raw: bool = False, vars: _Section | None = None) -> int: ...
290290
@overload
291291
def getint(
292-
self, section: _SectionName, option: str, *, raw: bool = False, vars: _Section | None = None, fallback: _T = ...
292+
self, section: _SectionName, option: str, *, raw: bool = False, vars: _Section | None = None, fallback: _T
293293
) -> int | _T: ...
294294
@overload
295295
def getfloat(self, section: _SectionName, option: str, *, raw: bool = False, vars: _Section | None = None) -> float: ...
296296
@overload
297297
def getfloat(
298-
self, section: _SectionName, option: str, *, raw: bool = False, vars: _Section | None = None, fallback: _T = ...
298+
self, section: _SectionName, option: str, *, raw: bool = False, vars: _Section | None = None, fallback: _T
299299
) -> float | _T: ...
300300
@overload
301301
def getboolean(self, section: _SectionName, option: str, *, raw: bool = False, vars: _Section | None = None) -> bool: ...
302302
@overload
303303
def getboolean(
304-
self, section: _SectionName, option: str, *, raw: bool = False, vars: _Section | None = None, fallback: _T = ...
304+
self, section: _SectionName, option: str, *, raw: bool = False, vars: _Section | None = None, fallback: _T
305305
) -> bool | _T: ...
306306
def _get_conv(
307307
self,

stdlib/email/message.pyi

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,15 @@ class Message(Generic[_HeaderT_co, _HeaderParamT_contra]):
151151

152152
class MIMEPart(Message[_HeaderRegistryT_co, _HeaderRegistryParamT_contra]):
153153
def __init__(self, policy: Policy[Any] | None = None) -> None: ...
154-
def get_body(self, preferencelist: Sequence[str] = ("related", "html", "plain")) -> MIMEPart[_HeaderRegistryT_co] | None: ...
154+
def get_body(
155+
self, preferencelist: Sequence[str] = ("related", "html", "plain")
156+
) -> MIMEPart[_HeaderRegistryT_co, _HeaderRegistryParamT_contra] | None: ...
155157
def attach(self, payload: Self) -> None: ... # type: ignore[override]
156158
# The attachments are created via type(self) in the attach method. It's theoretically
157159
# possible to sneak other attachment types into a MIMEPart instance, but could cause
158160
# cause unforseen consequences.
159161
def iter_attachments(self) -> Iterator[Self]: ...
160-
def iter_parts(self) -> Iterator[MIMEPart[_HeaderRegistryT_co]]: ...
162+
def iter_parts(self) -> Iterator[MIMEPart[_HeaderRegistryT_co, _HeaderRegistryParamT_contra]]: ...
161163
def get_content(self, *args: Any, content_manager: ContentManager | None = None, **kw: Any) -> Any: ...
162164
def set_content(self, *args: Any, content_manager: ContentManager | None = None, **kw: Any) -> None: ...
163165
def make_related(self, boundary: str | None = None) -> None: ...
@@ -171,4 +173,4 @@ class MIMEPart(Message[_HeaderRegistryT_co, _HeaderRegistryParamT_contra]):
171173
def as_string(self, unixfrom: bool = False, maxheaderlen: int | None = None, policy: Policy[Any] | None = None) -> str: ...
172174
def is_attachment(self) -> bool: ...
173175

174-
class EmailMessage(MIMEPart): ...
176+
class EmailMessage(MIMEPart[_HeaderRegistryT_co, _HeaderRegistryParamT_contra]): ...

0 commit comments

Comments
 (0)