From 6df9d95aad0d66a55fb72e0589e6261fdd8fced3 Mon Sep 17 00:00:00 2001 From: Oleh Prypin Date: Tue, 22 Oct 2024 06:17:00 -0700 Subject: [PATCH] CI: Include all modules into pytype checking PiperOrigin-RevId: 688522741 --- pyproject.toml | 15 +++++---------- pytype/abstract/_classes.py | 4 +++- pytype/imports/pickle_utils.py | 4 +++- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 3d8540f7b..95ef7d84c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,19 +4,14 @@ build-backend = "setuptools.build_meta" [tool.pytype] inputs = [ - "pytype/*.py", - "pytype/overlays/", - "pytype/pyc/", - "pytype/pyi/", - "pytype/pytd/", - "pytype/tools/", - "pytype/typegraph/", + "pytype/**/*.py", "pytype_extensions/**/*.py", ] exclude = [ "**/*_test.py", "**/test_*.py", "**/*_test_*.py", - "pytype/tools/merge_pyi/test_data/", - "pytype/tools/xref/testdata/", -] \ No newline at end of file + "**/typeshed/", + "**/test_data/", + "**/testdata/", +] diff --git a/pytype/abstract/_classes.py b/pytype/abstract/_classes.py index 85215ccb3..9eb48f1c2 100644 --- a/pytype/abstract/_classes.py +++ b/pytype/abstract/_classes.py @@ -692,7 +692,9 @@ class FunctionPyTDClass(PyTDClass): """ def __init__( - self, func: "_function_base.Function", ctx: "context.Context" + self, + func: "_function_base.Function | _function_base.BoundFunction", + ctx: "context.Context", ) -> None: super().__init__( "typing.Callable", diff --git a/pytype/imports/pickle_utils.py b/pytype/imports/pickle_utils.py index d2b896dfe..9a38e9fd5 100644 --- a/pytype/imports/pickle_utils.py +++ b/pytype/imports/pickle_utils.py @@ -103,7 +103,9 @@ def DecodeAst(data: bytes) -> serialize_ast.SerializableAst: def LoadAst( filename: Path, compress: bool = False, open_function=open ) -> serialize_ast.SerializableAst: - return _Load(AstDecoder, filename, compress, open_function) + return _Load( + AstDecoder, filename, compress, open_function + ) # pytype: disable=bad-return-type def DecodeBuiltins(data: bytes) -> serialize_ast.ModuleBundle: