diff --git a/.github/workflows/stubtest.yml b/.github/workflows/stubtest.yml index 3852bb787..708692c62 100644 --- a/.github/workflows/stubtest.yml +++ b/.github/workflows/stubtest.yml @@ -39,7 +39,7 @@ jobs: # - get_mypy_req in tests/stubtest_third_party.py # - stubtest-stdlib in .github/workflows/stubtest.yml # - stubtest-stdlib in .github/workflows/tests.yml - run: pip install $(grep tomli== requirements-tests.txt) git+git://github.com/python/mypy@b36d8cf5d4d0bb77c5a8cf783ba4def16cd9846a + run: pip install $(grep tomli== requirements-tests.txt) git+git://github.com/python/mypy@080bb0e04e9d5c4d2513621d1fb62f1d61a573e9 - name: Run stubtest run: python tests/stubtest_stdlib.py diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f9ab66c51..a6c72dc9f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -114,7 +114,7 @@ jobs: # - get_mypy_req in tests/stubtest_third_party.py # - stubtest-stdlib in .github/workflows/stubtest.yml # - stubtest-stdlib in .github/workflows/tests.yml - run: pip install $(grep tomli== requirements-tests.txt) git+git://github.com/python/mypy@b36d8cf5d4d0bb77c5a8cf783ba4def16cd9846a + run: pip install $(grep tomli== requirements-tests.txt) git+git://github.com/python/mypy@080bb0e04e9d5c4d2513621d1fb62f1d61a573e9 - name: Run stubtest run: python tests/stubtest_stdlib.py diff --git a/stdlib/select.pyi b/stdlib/select.pyi index 51e70b04d..bd94cf130 100644 --- a/stdlib/select.pyi +++ b/stdlib/select.pyi @@ -103,6 +103,7 @@ if sys.platform != "linux" and sys.platform != "win32": KQ_NOTE_WRITE: int if sys.platform == "linux": + @final class epoll: def __init__(self, sizehint: int = ..., flags: int = ...) -> None: ... def __enter__(self: Self) -> Self: ... diff --git a/stdlib/sqlite3/dbapi2.pyi b/stdlib/sqlite3/dbapi2.pyi index 98debc00f..456c94362 100644 --- a/stdlib/sqlite3/dbapi2.pyi +++ b/stdlib/sqlite3/dbapi2.pyi @@ -245,6 +245,7 @@ class Row: def __ne__(self, __other): ... if sys.version_info < (3, 8): + @final class Statement: def __init__(self, *args, **kwargs): ... diff --git a/tests/stubtest_allowlists/py310.txt b/tests/stubtest_allowlists/py310.txt index 0381520aa..4c77a0274 100644 --- a/tests/stubtest_allowlists/py310.txt +++ b/tests/stubtest_allowlists/py310.txt @@ -51,8 +51,6 @@ fractions.Fraction.__new__ # overload is too complicated for stubtest to resolv ftplib.FTP.trust_server_pasv_ipv4_address # Dangerous to use, intentionally undocumented, intentionally missing from typeshed. #6154 gettext.install gettext.translation -hashlib.sha3_\d+ # Can be a class or a built-in function -hashlib.shake_\d+ # Can be a class or a built-in function hmac.new # Stub is a white lie; see comments in the stub http.server.SimpleHTTPRequestHandler.__init__ # *args is expanded importlib.abc.Traversable.__init__ # Inherits __init__ from typing.Protocol diff --git a/tests/stubtest_allowlists/py39.txt b/tests/stubtest_allowlists/py39.txt index 0aa088188..627bc106f 100644 --- a/tests/stubtest_allowlists/py39.txt +++ b/tests/stubtest_allowlists/py39.txt @@ -36,8 +36,6 @@ fractions.Fraction.__new__ # overload is too complicated for stubtest to resolv ftplib.FTP.trust_server_pasv_ipv4_address # Dangerous to use, intentionally undocumented, intentionally missing from typeshed. #6154 gettext.install gettext.translation -hashlib.sha3_\d+ -hashlib.shake_\d+ hmac.new # Stub is a white lie; see comments in the stub http.server.SimpleHTTPRequestHandler.__init__ # *args is expanded importlib.abc.Traversable.__init__ # Inherits __init__ from typing.Protocol diff --git a/tests/stubtest_allowlists/py3_common.txt b/tests/stubtest_allowlists/py3_common.txt index 6f25348ed..c37e12f26 100644 --- a/tests/stubtest_allowlists/py3_common.txt +++ b/tests/stubtest_allowlists/py3_common.txt @@ -92,6 +92,8 @@ enum.Enum.value enum.Flag.name enum.Flag.value enum.IntEnum.value +hashlib.sha3_\d+ # Can be a class or a built-in function, can't be subclassed at runtime +hashlib.shake_\d+ # Can be a class or a built-in function, can't be subclassed at runtime http.HTTPStatus.description # set in __new__ http.HTTPStatus.phrase # set in __new__ http.client.HTTPConnection.response_class # the actual type at runtime is abc.ABCMeta diff --git a/tests/stubtest_third_party.py b/tests/stubtest_third_party.py index e7f785006..017558e44 100755 --- a/tests/stubtest_third_party.py +++ b/tests/stubtest_third_party.py @@ -22,7 +22,7 @@ def get_mypy_req(): # - get_mypy_req in tests/stubtest_third_party.py # - stubtest-stdlib in .github/workflows/stubtest.yml # - stubtest-stdlib in .github/workflows/tests.yml - return "git+git://github.com/python/mypy@b36d8cf5d4d0bb77c5a8cf783ba4def16cd9846a" + return "git+git://github.com/python/mypy@080bb0e04e9d5c4d2513621d1fb62f1d61a573e9" with open("requirements-tests.txt") as f: return next(line.strip() for line in f if "mypy" in line)