diff --git a/.flake8 b/.flake8 index ea6dabada..a7bbf1b55 100644 --- a/.flake8 +++ b/.flake8 @@ -39,7 +39,7 @@ per-file-ignores = # F811 redefinition of unused '...' stdlib/typing.pyi: B, E701, E741, F401, F403, F405, F811, F822 # Generated protobuf files include docstrings - *_pb2.pyi: B, E701, E741, F401, F403, F405, F822, Y021, Y026 + *_pb2.pyi: B, E701, E741, F401, F403, F405, F822, Y021, Y026, Y053, Y054 exclude = .venv*,.git noqa_require_code = true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a98819122..667862c55 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -34,7 +34,7 @@ repos: additional_dependencies: - "flake8-bugbear==23.3.12" # must match requirements-tests.txt - "flake8-noqa==1.3.1" # must match requirements-tests.txt - - "flake8-pyi==23.3.0" # must match requirements-tests.txt + - "flake8-pyi==23.3.1" # must match requirements-tests.txt types: [file] types_or: [python, pyi] diff --git a/requirements-tests.txt b/requirements-tests.txt index 74e1a21ce..291196380 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -3,7 +3,7 @@ black==23.1.0 # must match .pre-commit-confi flake8==6.0.0; python_version >= "3.8" # must match .pre-commit-config.yaml flake8-bugbear==23.3.12; python_version >= "3.8" # must match .pre-commit-config.yaml flake8-noqa==1.3.1; python_version >= "3.8" # must match .pre-commit-config.yaml -flake8-pyi==23.3.0; python_version >= "3.8" # must match .pre-commit-config.yaml +flake8-pyi==23.3.1; python_version >= "3.8" # must match .pre-commit-config.yaml isort==5.12.0; python_version >= "3.8" # must match .pre-commit-config.yaml mypy==1.1.1 packaging==23.0 diff --git a/stdlib/_winapi.pyi b/stdlib/_winapi.pyi index e21402b80..ca1e61f0f 100644 --- a/stdlib/_winapi.pyi +++ b/stdlib/_winapi.pyi @@ -54,7 +54,10 @@ if sys.platform == "win32": HIGH_PRIORITY_CLASS: Literal[0x80] INFINITE: Literal[0xFFFFFFFF] if sys.version_info >= (3, 8): - INVALID_HANDLE_VALUE: Literal[0xFFFFFFFFFFFFFFFF] + # Ignore the flake8 error -- flake8-pyi assumes + # most numbers this long will be implementation details, + # but here we can see that it's a power of 2 + INVALID_HANDLE_VALUE: Literal[0xFFFFFFFFFFFFFFFF] # noqa: Y054 IDLE_PRIORITY_CLASS: Literal[0x40] NORMAL_PRIORITY_CLASS: Literal[0x20] REALTIME_PRIORITY_CLASS: Literal[0x100]