From d09c020572342f0b5214c72ee93b3cc3e74a77cb Mon Sep 17 00:00:00 2001 From: rechen Date: Mon, 30 Nov 2020 20:44:11 -0800 Subject: [PATCH] Move targets in pytype/tools/ into their own directories. Moves targets containing src files in pytype/tools, pytype/tools/analyze_project, and pytype/tools/merge_pyi into BUILD/CMakeLists.txt files in their respective directories. After this, we'll only have one more directory (pytype/typegraph) plus a rename (pytype/stubs) to deal with. PiperOrigin-RevId: 344942930 --- pytype/CMakeLists.txt | 30 --------------------- pytype/tools/CMakeLists.txt | 23 +++++++++++++--- pytype/tools/analyze_project/CMakeLists.txt | 23 +++++++++++++--- pytype/tools/annotate_ast/CMakeLists.txt | 2 +- pytype/tools/xref/CMakeLists.txt | 4 +-- 5 files changed, 41 insertions(+), 41 deletions(-) diff --git a/pytype/CMakeLists.txt b/pytype/CMakeLists.txt index 98ac40ad7..42f19bc3a 100644 --- a/pytype/CMakeLists.txt +++ b/pytype/CMakeLists.txt @@ -247,36 +247,6 @@ py_library( pytype.typegraph.cfg ) -py_library( - NAME - tools - SRCS - tools/arg_parser.py - tools/config.py - tools/environment.py - tools/runner.py - tools/tool_utils.py - DEPS - .config - .utils - pytype.pytd.typeshed -) - -py_library( - NAME - analyze_project - SRCS - tools/analyze_project/config.py - tools/analyze_project/environment.py - tools/analyze_project/parse_args.py - tools/analyze_project/pytype_runner.py - DEPS - .config - .io - .tools - .utils -) - # This library is disabled because cfg.py can conflict with the typegraph.cfg # extension module. # py_library( diff --git a/pytype/tools/CMakeLists.txt b/pytype/tools/CMakeLists.txt index 4c432f5ee..b4ab402d9 100644 --- a/pytype/tools/CMakeLists.txt +++ b/pytype/tools/CMakeLists.txt @@ -1,13 +1,28 @@ add_package() +py_library( + NAME + tools + SRCS + arg_parser.py + config.py + environment.py + runner.py + tool_utils.py + DEPS + pytype.config + pytype.utils + pytype.pytd.typeshed +) + py_test( NAME arg_parser_test SRCS arg_parser_test.py DEPS + .tools pytype.config - pytype.tools ) py_test( @@ -16,7 +31,7 @@ py_test( SRCS config_test.py DEPS - pytype.tools + .tools pytype.utils ) @@ -26,7 +41,7 @@ py_test( SRCS environment_test.py DEPS - pytype.tools + .tools pytype.utils ) @@ -36,7 +51,7 @@ py_test( SRCS tool_utils_test.py DEPS - pytype.tools + .tools pytype.utils ) diff --git a/pytype/tools/analyze_project/CMakeLists.txt b/pytype/tools/analyze_project/CMakeLists.txt index b02e32fd7..48f0103cf 100644 --- a/pytype/tools/analyze_project/CMakeLists.txt +++ b/pytype/tools/analyze_project/CMakeLists.txt @@ -1,12 +1,27 @@ add_package() +py_library( + NAME + analyze_project + SRCS + config.py + environment.py + parse_args.py + pytype_runner.py + DEPS + pytype.config + pytype.io + pytype.utils + pytype.tools.tools +) + py_test( NAME config_test SRCS config_test.py DEPS - pytype.analyze_project + .analyze_project pytype.utils ) @@ -16,7 +31,7 @@ py_test( SRCS parse_args_test.py DEPS - pytype.analyze_project + .analyze_project ) py_test( @@ -25,7 +40,7 @@ py_test( SRCS pytype_runner_test.py DEPS - pytype.analyze_project + .analyze_project pytype.config pytype.utils ) @@ -38,5 +53,5 @@ toplevel_py_binary( MAIN main.py DEPS - pytype.analyze_project + .analyze_project ) diff --git a/pytype/tools/annotate_ast/CMakeLists.txt b/pytype/tools/annotate_ast/CMakeLists.txt index 0bdc5025f..5f67e0e80 100644 --- a/pytype/tools/annotate_ast/CMakeLists.txt +++ b/pytype/tools/annotate_ast/CMakeLists.txt @@ -10,7 +10,7 @@ toplevel_py_binary( DEPS .annotate_ast pytype.ast.visitor - pytype.tools + pytype.tools.tools ) py_library( diff --git a/pytype/tools/xref/CMakeLists.txt b/pytype/tools/xref/CMakeLists.txt index 96e1cce6b..bf9f5bca8 100644 --- a/pytype/tools/xref/CMakeLists.txt +++ b/pytype/tools/xref/CMakeLists.txt @@ -17,7 +17,7 @@ py_library( pytype.errors pytype.io pytype.libvm - pytype.tools + pytype.tools.tools pytype.tools.traces.traces ) @@ -36,8 +36,8 @@ py_library( DEPS .indexer pytype.config - pytype.tools pytype.utils + pytype.tools.tools ) py_library(