Skip to content

Commit 823592e

Browse files
authored
Update stubtest for final checking (#7312)
Co-authored-by: hauntsaninja <>
1 parent 06a2024 commit 823592e

File tree

8 files changed

+7
-7
lines changed

8 files changed

+7
-7
lines changed

.github/workflows/stubtest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
# - get_mypy_req in tests/stubtest_third_party.py
4040
# - stubtest-stdlib in .github/workflows/stubtest.yml
4141
# - stubtest-stdlib in .github/workflows/tests.yml
42-
run: pip install $(grep tomli== requirements-tests.txt) git+git://github.com/python/mypy@b36d8cf5d4d0bb77c5a8cf783ba4def16cd9846a
42+
run: pip install $(grep tomli== requirements-tests.txt) git+git://github.com/python/mypy@080bb0e04e9d5c4d2513621d1fb62f1d61a573e9
4343
- name: Run stubtest
4444
run: python tests/stubtest_stdlib.py
4545

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ jobs:
114114
# - get_mypy_req in tests/stubtest_third_party.py
115115
# - stubtest-stdlib in .github/workflows/stubtest.yml
116116
# - stubtest-stdlib in .github/workflows/tests.yml
117-
run: pip install $(grep tomli== requirements-tests.txt) git+git://github.com/python/mypy@b36d8cf5d4d0bb77c5a8cf783ba4def16cd9846a
117+
run: pip install $(grep tomli== requirements-tests.txt) git+git://github.com/python/mypy@080bb0e04e9d5c4d2513621d1fb62f1d61a573e9
118118
- name: Run stubtest
119119
run: python tests/stubtest_stdlib.py
120120

stdlib/select.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ if sys.platform != "linux" and sys.platform != "win32":
103103
KQ_NOTE_WRITE: int
104104

105105
if sys.platform == "linux":
106+
@final
106107
class epoll:
107108
def __init__(self, sizehint: int = ..., flags: int = ...) -> None: ...
108109
def __enter__(self: Self) -> Self: ...

stdlib/sqlite3/dbapi2.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ class Row:
245245
def __ne__(self, __other): ...
246246

247247
if sys.version_info < (3, 8):
248+
@final
248249
class Statement:
249250
def __init__(self, *args, **kwargs): ...
250251

tests/stubtest_allowlists/py310.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ fractions.Fraction.__new__ # overload is too complicated for stubtest to resolv
5151
ftplib.FTP.trust_server_pasv_ipv4_address # Dangerous to use, intentionally undocumented, intentionally missing from typeshed. #6154
5252
gettext.install
5353
gettext.translation
54-
hashlib.sha3_\d+ # Can be a class or a built-in function
55-
hashlib.shake_\d+ # Can be a class or a built-in function
5654
hmac.new # Stub is a white lie; see comments in the stub
5755
http.server.SimpleHTTPRequestHandler.__init__ # *args is expanded
5856
importlib.abc.Traversable.__init__ # Inherits __init__ from typing.Protocol

tests/stubtest_allowlists/py39.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ fractions.Fraction.__new__ # overload is too complicated for stubtest to resolv
3636
ftplib.FTP.trust_server_pasv_ipv4_address # Dangerous to use, intentionally undocumented, intentionally missing from typeshed. #6154
3737
gettext.install
3838
gettext.translation
39-
hashlib.sha3_\d+
40-
hashlib.shake_\d+
4139
hmac.new # Stub is a white lie; see comments in the stub
4240
http.server.SimpleHTTPRequestHandler.__init__ # *args is expanded
4341
importlib.abc.Traversable.__init__ # Inherits __init__ from typing.Protocol

tests/stubtest_allowlists/py3_common.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ enum.Enum.value
9292
enum.Flag.name
9393
enum.Flag.value
9494
enum.IntEnum.value
95+
hashlib.sha3_\d+ # Can be a class or a built-in function, can't be subclassed at runtime
96+
hashlib.shake_\d+ # Can be a class or a built-in function, can't be subclassed at runtime
9597
http.HTTPStatus.description # set in __new__
9698
http.HTTPStatus.phrase # set in __new__
9799
http.client.HTTPConnection.response_class # the actual type at runtime is abc.ABCMeta

tests/stubtest_third_party.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def get_mypy_req():
2222
# - get_mypy_req in tests/stubtest_third_party.py
2323
# - stubtest-stdlib in .github/workflows/stubtest.yml
2424
# - stubtest-stdlib in .github/workflows/tests.yml
25-
return "git+git://github.com/python/mypy@b36d8cf5d4d0bb77c5a8cf783ba4def16cd9846a"
25+
return "git+git://github.com/python/mypy@080bb0e04e9d5c4d2513621d1fb62f1d61a573e9"
2626

2727
with open("requirements-tests.txt") as f:
2828
return next(line.strip() for line in f if "mypy" in line)

0 commit comments

Comments
 (0)