diff --git a/catkin_tools/common.py b/catkin_tools/common.py index 24b8e27e..1f056fa2 100644 --- a/catkin_tools/common.py +++ b/catkin_tools/common.py @@ -22,7 +22,7 @@ from fnmatch import fnmatch from itertools import chain -from catkin_pkg.packages import find_packages +from catkin_pkg.packages import find_packages as find_packages_ from .terminal_color import ColorMapper @@ -524,6 +524,19 @@ def wide_log(msg, **kwargs): pass +def find_packages(*args, **kwargs): + """ + Crawls the filesystem to find package manifest files. Ignores subfolders if an ignore_marker is present (e.g. CATKIN_IGNORE). + :param basepath: The path to search in, ``str`` + :param exclude_paths: A list of paths which should not be searched, ``list`` + :param exclude_subspaces: The flag is subfolders containing a .catkin file should not be + searched, ``bool`` + :param ignore_markers: A set of filenames to be used as ignore markers, ``set`` + :returns: A list of relative paths containing package manifest files ``list`` + """ + return find_packages_(*args, ignore_markers={'CATKIN_IGNORE'}, **kwargs) + + def find_enclosing_package(search_start_path=None, ws_path=None, warnings=None, symlinks=True): """Get the package containing a specific directory. diff --git a/catkin_tools/verbs/catkin_build/build.py b/catkin_tools/verbs/catkin_build/build.py index acfbb96f..1368c49f 100644 --- a/catkin_tools/verbs/catkin_build/build.py +++ b/catkin_tools/verbs/catkin_build/build.py @@ -26,7 +26,6 @@ try: from catkin_pkg.package import parse_package from catkin_pkg.package import InvalidPackage - from catkin_pkg.packages import find_packages from catkin_pkg.topological_order import topological_order_packages except ImportError as e: sys.exit( @@ -40,6 +39,7 @@ from catkin_tools.common import get_recursive_run_depends_in_workspace from catkin_tools.common import log from catkin_tools.common import wide_log +from catkin_tools.common import find_packages from catkin_tools.execution.controllers import ConsoleStatusController from catkin_tools.execution.executor import execute_jobs diff --git a/catkin_tools/verbs/catkin_build/cli.py b/catkin_tools/verbs/catkin_build/cli.py index 268538a8..da4395fc 100644 --- a/catkin_tools/verbs/catkin_build/cli.py +++ b/catkin_tools/verbs/catkin_build/cli.py @@ -18,7 +18,6 @@ import sys try: - from catkin_pkg.packages import find_packages from catkin_pkg.topological_order import topological_order_packages except ImportError as e: sys.exit( @@ -40,6 +39,7 @@ from catkin_tools.common import log from catkin_tools.common import find_enclosing_package from catkin_tools.common import format_env_dict +from catkin_tools.common import find_packages from catkin_tools.context import Context diff --git a/catkin_tools/verbs/catkin_clean/clean.py b/catkin_tools/verbs/catkin_clean/clean.py index 4c42ba03..dc672cd1 100644 --- a/catkin_tools/verbs/catkin_clean/clean.py +++ b/catkin_tools/verbs/catkin_clean/clean.py @@ -22,7 +22,6 @@ try: - from catkin_pkg.packages import find_packages from catkin_pkg.topological_order import topological_order_packages except ImportError as e: sys.exit( @@ -38,6 +37,7 @@ from catkin_tools.common import expand_glob_package from catkin_tools.common import get_recursive_build_dependents_in_workspace from catkin_tools.common import wide_log +from catkin_tools.common import find_packages def determine_packages_to_be_cleaned(context, include_dependents, packages): diff --git a/catkin_tools/verbs/catkin_clean/cli.py b/catkin_tools/verbs/catkin_clean/cli.py index 9432aaea..e8c3d236 100644 --- a/catkin_tools/verbs/catkin_clean/cli.py +++ b/catkin_tools/verbs/catkin_clean/cli.py @@ -17,7 +17,6 @@ import sys from catkin_pkg.package import InvalidPackage -from catkin_pkg.packages import find_packages from catkin_tools.argument_parsing import add_context_args @@ -27,6 +26,7 @@ from catkin_tools.common import wide_log from catkin_tools.common import find_enclosing_package from catkin_tools.common import getcwd +from catkin_tools.common import find_packages import catkin_tools.execution.job_server as job_server diff --git a/catkin_tools/verbs/catkin_list/cli.py b/catkin_tools/verbs/catkin_list/cli.py index b20e5301..888c2cd9 100644 --- a/catkin_tools/verbs/catkin_list/cli.py +++ b/catkin_tools/verbs/catkin_list/cli.py @@ -24,8 +24,8 @@ from catkin_tools.common import get_recursive_run_dependents_in_workspace from catkin_tools.common import get_recursive_run_depends_in_workspace from catkin_tools.common import getcwd +from catkin_tools.common import find_packages -from catkin_pkg.packages import find_packages from catkin_pkg.package import InvalidPackage from catkin_pkg.topological_order import topological_order_packages diff --git a/catkin_tools/verbs/catkin_locate/cli.py b/catkin_tools/verbs/catkin_locate/cli.py index 88fd60db..0cd5a405 100644 --- a/catkin_tools/verbs/catkin_locate/cli.py +++ b/catkin_tools/verbs/catkin_locate/cli.py @@ -19,8 +19,7 @@ from catkin_tools.common import find_enclosing_package from catkin_tools.common import getcwd - -from catkin_pkg.packages import find_packages +from catkin_tools.common import find_packages from catkin_tools.argument_parsing import add_context_args from catkin_tools.context import Context