diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f5590b93898d..e4ef366e7e26 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -21,7 +21,7 @@ repos: additional_dependencies: - 'flake8-bugbear==22.7.1' # must match requirements-tests.txt - 'flake8-noqa==1.2.9' # must match requirements-tests.txt - - 'flake8-pyi==22.8.1' # must match requirements-tests.txt + - 'flake8-pyi==22.8.2' # must match requirements-tests.txt ci: autofix_commit_msg: '[pre-commit.ci] auto fixes from pre-commit.com hooks' diff --git a/pyproject.toml b/pyproject.toml index a6285f887315..f32ce07c3eae 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,6 +20,7 @@ extra_standard_library = [ "_collections_abc", "_compression", "_csv", + "_ctypes", "_curses", "_heapq", "_markupbase", diff --git a/requirements-tests.txt b/requirements-tests.txt index 470b6d85f05a..e9ea3ecd8d78 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -3,13 +3,13 @@ black==22.6.0 # must match .pre-commit-config.yaml flake8==5.0.4 # must match .pre-commit-config.yaml flake8-bugbear==22.7.1 # must match .pre-commit-config.yaml flake8-noqa==1.2.9 # must match .pre-commit-config.yaml -flake8-pyi==22.8.1 # must match .pre-commit-config.yaml +flake8-pyi==22.8.2 # must match .pre-commit-config.yaml isort==5.10.1 # must match .pre-commit-config.yaml mypy==0.971 packaging==21.3 pycln==2.1.1 # must match .pre-commit-config.yaml pyyaml==6.0 -pytype==2022.8.23; platform_system != "Windows" +pytype==2022.08.30; platform_system != "Windows" termcolor tomli==1.2.2 tomlkit==0.11.4 diff --git a/stdlib/ctypes/__init__.pyi b/stdlib/ctypes/__init__.pyi index 19465e084dee..5e897272c355 100644 --- a/stdlib/ctypes/__init__.pyi +++ b/stdlib/ctypes/__init__.pyi @@ -1,14 +1,11 @@ import sys +from _ctypes import RTLD_GLOBAL as RTLD_GLOBAL, RTLD_LOCAL as RTLD_LOCAL from _typeshed import ReadableBuffer, Self, WriteableBuffer from abc import abstractmethod from collections.abc import Callable, Iterable, Iterator, Mapping, Sequence from typing import Any, ClassVar, Generic, TypeVar, Union as _UnionT, overload from typing_extensions import TypeAlias -# TODO: import these from _ctypes once it no longer breaks pytype -RTLD_GLOBAL: int -RTLD_LOCAL: int - if sys.version_info >= (3, 9): from types import GenericAlias