Skip to content

Commit 4ae6d38

Browse files
authored
Use latest Python for stubtest in CI (#10641)
1 parent a785041 commit 4ae6d38

File tree

13 files changed

+35
-12
lines changed

13 files changed

+35
-12
lines changed

.github/workflows/daily.yml

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ jobs:
4848
cache: pip
4949
cache-dependency-path: requirements-tests.txt
5050
allow-prereleases: true
51+
check-latest: true
5152
- name: Install dependencies
5253
run: pip install -r requirements-tests.txt
5354
- name: Run stubtest

.github/workflows/stubtest_stdlib.yml

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ jobs:
4444
cache: pip
4545
cache-dependency-path: requirements-tests.txt
4646
allow-prereleases: true
47+
check-latest: true
4748
- name: Install dependencies
4849
run: pip install -r requirements-tests.txt
4950
- name: Run stubtest

stdlib/enum.pyi

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ if sys.version_info >= (3, 11):
3333
"verify",
3434
]
3535

36-
if sys.version_info >= (3, 12):
36+
if sys.version_info >= (3, 11):
3737
__all__ += ["pickle_by_enum_name", "pickle_by_global_name"]
3838

3939
_EnumMemberT = TypeVar("_EnumMemberT")
@@ -188,7 +188,7 @@ class Enum(metaclass=EnumMeta):
188188
def __hash__(self) -> int: ...
189189
def __format__(self, format_spec: str) -> str: ...
190190
def __reduce_ex__(self, proto: Unused) -> tuple[Any, ...]: ...
191-
if sys.version_info >= (3, 12):
191+
if sys.version_info >= (3, 11):
192192
def __copy__(self) -> Self: ...
193193
def __deepcopy__(self, memo: Any) -> Self: ...
194194

@@ -294,6 +294,6 @@ class auto(IntFlag):
294294
def value(self) -> Any: ...
295295
def __new__(cls) -> Self: ...
296296

297-
if sys.version_info >= (3, 12):
297+
if sys.version_info >= (3, 11):
298298
def pickle_by_global_name(self: Enum, proto: int) -> str: ...
299299
def pickle_by_enum_name(self: _EnumMemberT, proto: int) -> tuple[Callable[..., Any], tuple[type[_EnumMemberT], str]]: ...

stdlib/os/__init__.pyi

+6-1
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,12 @@ def isatty(__fd: int) -> bool: ...
602602
if sys.platform != "win32" and sys.version_info >= (3, 11):
603603
def login_tty(__fd: int) -> None: ...
604604

605-
def lseek(__fd: int, __position: int, __how: int) -> int: ...
605+
if sys.version_info >= (3, 11):
606+
def lseek(__fd: int, __position: int, __whence: int) -> int: ...
607+
608+
else:
609+
def lseek(__fd: int, __position: int, __how: int) -> int: ...
610+
606611
def open(path: StrOrBytesPath, flags: int, mode: int = 0o777, *, dir_fd: int | None = None) -> int: ...
607612
def pipe() -> tuple[int, int]: ...
608613
def read(__fd: int, __length: int) -> bytes: ...

stdlib/pydoc.pyi

+2-2
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def render_doc(
198198
thing: str | object, title: str = "Python Library Documentation: %s", forceload: bool = ..., renderer: Doc | None = None
199199
) -> str: ...
200200

201-
if sys.version_info >= (3, 12):
201+
if sys.version_info >= (3, 11):
202202
def doc(
203203
thing: str | object,
204204
title: str = "Python Library Documentation: %s",
@@ -230,7 +230,7 @@ class Helper:
230230
def __call__(self, request: str | Helper | object = ...) -> None: ...
231231
def interact(self) -> None: ...
232232
def getline(self, prompt: str) -> str: ...
233-
if sys.version_info >= (3, 12):
233+
if sys.version_info >= (3, 11):
234234
def help(self, request: Any, is_cli: bool = False) -> None: ...
235235
else:
236236
def help(self, request: Any) -> None: ...

stdlib/ssl.pyi

+6-4
Original file line numberDiff line numberDiff line change
@@ -201,12 +201,13 @@ class Options(enum.IntFlag):
201201
OP_NO_RENEGOTIATION: int
202202
if sys.version_info >= (3, 8):
203203
OP_ENABLE_MIDDLEBOX_COMPAT: int
204-
if sys.platform == "linux":
205-
OP_IGNORE_UNEXPECTED_EOF: int
206204
if sys.version_info >= (3, 12):
207205
OP_LEGACY_SERVER_CONNECT: int
208206
if sys.version_info >= (3, 12) and sys.platform != "linux":
209207
OP_ENABLE_KTLS: int
208+
if sys.version_info >= (3, 11):
209+
OP_IGNORE_UNEXPECTED_EOF: int
210+
elif sys.version_info >= (3, 8) and sys.platform == "linux":
210211
OP_IGNORE_UNEXPECTED_EOF: int
211212

212213
OP_ALL: Options
@@ -224,12 +225,13 @@ OP_NO_TICKET: Options
224225
OP_NO_RENEGOTIATION: Options
225226
if sys.version_info >= (3, 8):
226227
OP_ENABLE_MIDDLEBOX_COMPAT: Options
227-
if sys.platform == "linux":
228-
OP_IGNORE_UNEXPECTED_EOF: Options
229228
if sys.version_info >= (3, 12):
230229
OP_LEGACY_SERVER_CONNECT: Options
231230
if sys.version_info >= (3, 12) and sys.platform != "linux":
232231
OP_ENABLE_KTLS: Options
232+
if sys.version_info >= (3, 11):
233+
OP_IGNORE_UNEXPECTED_EOF: Options
234+
elif sys.version_info >= (3, 8) and sys.platform == "linux":
233235
OP_IGNORE_UNEXPECTED_EOF: Options
234236

235237
HAS_NEVER_CHECK_COMMON_NAME: bool

tests/stubtest_allowlists/darwin-py312.txt

+3
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,6 @@ xxlimited.Xxo.x_exports
2828
(locale.dgettext)?
2929
(locale.gettext)?
3030
(locale.textdomain)?
31+
32+
# should be removable once 3.12.0rc2 is released:
33+
posix.lseek

tests/stubtest_allowlists/linux-py312.txt

+3
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,6 @@ tty.__all__
4444
tty.cfmakecbreak
4545
tty.cfmakeraw
4646
xxlimited.Xxo.x_exports
47+
48+
# should be removable once 3.12.0rc2 is released:
49+
posix.lseek

tests/stubtest_allowlists/py310.txt

+2
Original file line numberDiff line numberDiff line change
@@ -160,3 +160,5 @@ asynchat.async_chat.use_encoding
160160
asynchat.find_prefix_at_end
161161
pkgutil.ImpImporter\..*
162162
pkgutil.ImpLoader\..*
163+
164+
types.CodeType.replace # stubtest thinks default values are None but None doesn't work at runtime

tests/stubtest_allowlists/py312.txt

+4
Original file line numberDiff line numberDiff line change
@@ -173,3 +173,7 @@ typing\._SpecialForm.*
173173
typing\.NamedTuple
174174
typing\.LiteralString
175175
typing\.Annotated
176+
177+
# These two should be removable after 3.12rc2 is released:
178+
types.CodeType.replace # stubtest thinks default values are None but None doesn't work at runtime
179+
os.lseek # a pos-only parameter name changed in py311/py312

tests/stubtest_allowlists/py38.txt

+2
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,5 @@ asynchat.async_chat.use_encoding
158158
asynchat.find_prefix_at_end
159159
pkgutil.ImpImporter\..*
160160
pkgutil.ImpLoader\..*
161+
162+
types.CodeType.replace # stubtest thinks default values are None but None doesn't work at runtime

tests/stubtest_allowlists/py39.txt

+2
Original file line numberDiff line numberDiff line change
@@ -149,3 +149,5 @@ asynchat.async_chat.use_encoding
149149
asynchat.find_prefix_at_end
150150
pkgutil.ImpImporter\..*
151151
pkgutil.ImpLoader\..*
152+
153+
types.CodeType.replace # stubtest thinks default values are None but None doesn't work at runtime

tests/stubtest_allowlists/py3_common.txt

-2
Original file line numberDiff line numberDiff line change
@@ -659,5 +659,3 @@ typing(_extensions)?\.IO\.__iter__ # See https://github.com/python/typeshed/com
659659

660660
# Omit internal _KEEP argument
661661
tarfile.TarInfo.replace
662-
663-
types.CodeType.replace # stubtest thinks default values are None but None doesn't work at runtime

0 commit comments

Comments
 (0)