Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Use only CATKIN_IGNORE to ignore packages, not COLCON_IGNORE/AMENT_IGNORE #688

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion catkin_tools/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion catkin_tools/verbs/catkin_build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion catkin_tools/verbs/catkin_build/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion catkin_tools/verbs/catkin_clean/clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion catkin_tools/verbs/catkin_clean/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion catkin_tools/verbs/catkin_list/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions catkin_tools/verbs/catkin_locate/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down