diff --git a/Makefile b/Makefile index cd70a6b96..59e5395fc 100644 --- a/Makefile +++ b/Makefile @@ -148,6 +148,9 @@ format: format_py format_scala format_md type_check: uv run mypy ${PYTHON_DIRS} --check-untyped-defs +ty_check: + uv run ty check ${PYTHON_DIRS} + lint_test: check_format assert_yaml_configs_parse @echo "Lint checks pass!" diff --git a/pyproject.toml b/pyproject.toml index d83e5587b..bf5b8b581 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -107,6 +107,7 @@ dev = [ {include-group = "test"}, {include-group = "typing-stubs"}, "pre-commit==3.3.2", + "ty>=0.0.17", ] docs = [ "astroid==3.3.11", # Newer versions of astroid are not compatible with sphinx==7.4.7 @@ -283,3 +284,34 @@ exclude = [ remove-all-unused-imports = true in-place = true recursive = true + +[tool.ty.environment] +python-version = "3.11" + +[tool.ty.src] +include = [".github/scripts", "examples", "gigl", "tests", "snapchat", "scripts", "testing"] + +[tool.ty.analysis] +# Equivalent to mypy's per-module ignore_missing_imports +allowed-unresolved-imports = [ + "kfp.*", + "kfp_server_api.*", + "networkx.*", + "networkx", + "setuptools", + "tensorflow_data_validation", + "tensorflow_metadata.*", + "tensorflow.*", + "torch_geometric.*", + "tfx_bsl.*", + "parameterized.*", + "pyarrow.*", + "matplotlib.*", + "msgpack", + "torch_sparse.*", + "absl.*", + "graphlearn_torch.*", + "google.cloud.storage.*", + "torchrec.*", + "google_cloud_pipeline_components.*", +]