diff --git a/.flake8 b/.flake8 index 6e9aa5d97..a645d6cf3 100644 --- a/.flake8 +++ b/.flake8 @@ -8,15 +8,14 @@ extend-ignore = Y090 per-file-ignores = # We should only need to noqa Y and F821 codes in .pyi files *.py: NQA - # TODO: Remove bare "Incomplete"s from stubs (Y065) - *.pyi: Y065 # Generated protobuf files: # Y021: Include docstrings # Y023: Alias typing as typing_extensions # Y026: Have implicit type aliases # Y053: have literals >50 characters long - # Y065: bare "Incomplete"s used - *_pb2.pyi: Y021, Y023, Y026, Y053, Y065 + stubs/*_pb2.pyi: Y021, Y023, Y026, Y053 + # TODO: Remove bare "Incomplete"s from stubs (Y065) + stubs/*.pyi: Y065 exclude = .venv*,.git noqa_require_code = true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 584f91c3c..801b915f7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -43,7 +43,7 @@ repos: - id: flake8 additional_dependencies: - "flake8-noqa==1.4.0" # must match requirements-tests.txt - - "flake8-pyi==24.3.1" # must match requirements-tests.txt + - "flake8-pyi==24.4.0" # must match requirements-tests.txt types: [file] types_or: [python, pyi] - repo: meta diff --git a/requirements-tests.txt b/requirements-tests.txt index 2770130b4..46d0427ae 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -4,7 +4,7 @@ black==24.3.0 # must match .pre-commit-config.yaml flake8==7.0.0 # must match .pre-commit-config.yaml flake8-noqa==1.4.0 # must match .pre-commit-config.yaml -flake8-pyi==24.3.1 # must match .pre-commit-config.yaml +flake8-pyi==24.4.0 # must match .pre-commit-config.yaml mypy==1.9.0 pre-commit-hooks==4.5.0 # must match .pre-commit-config.yaml pyright==1.1.358 diff --git a/stubs/tensorflow/tensorflow/saved_model/experimental.pyi b/stubs/tensorflow/tensorflow/saved_model/experimental.pyi index e6ac6bf40..2d3d7df17 100644 --- a/stubs/tensorflow/tensorflow/saved_model/experimental.pyi +++ b/stubs/tensorflow/tensorflow/saved_model/experimental.pyi @@ -34,7 +34,7 @@ class TrackableResource(CapturableResource): class VariablePolicy(Enum): EXPAND_DISTRIBUTED_VARIABLES = "expand_distributed_variables" - NONE = None # noqa: Y026 + NONE = None SAVE_VARIABLE_DEVICES = "save_variable_devices" def read_fingerprint(export_dir: str) -> Fingerprint: ...