Skip to content

Skips dependency installation for directories with no extension.toml #2216

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

Merged
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
12 changes: 6 additions & 6 deletions tools/install_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,17 @@ def install_apt_packages(paths: list[str]):
paths: A list of paths to the extension's root.

Raises:
FileNotFoundError: If the extension.toml file is not found.
SystemError: If 'apt' is not a known command. This is a system error.
"""
for path in paths:
if shutil.which("apt"):
# Check if the extension.toml file exists
if not os.path.exists(f"{path}/config/extension.toml"):
raise FileNotFoundError(
"During the installation of 'apt' dependencies, unable to find a"
print(
"[WARN] During the installation of 'apt' dependencies, unable to find a"
f" valid file at: {path}/config/extension.toml."
)
continue
# Load the extension.toml file and check for apt_deps
with open(f"{path}/config/extension.toml") as fd:
ext_toml = toml.load(fd)
Expand Down Expand Up @@ -94,18 +94,18 @@ def install_rosdep_packages(paths: list[str], ros_distro: str = "humble"):
ros_distro: The ROS distribution to use for rosdep. Default is 'humble'.

Raises:
FileNotFoundError: If the extension.toml file is not found under the path.
FileNotFoundError: If a valid ROS workspace is not found while installing ROS dependencies.
SystemError: If 'rosdep' is not a known command. This is raised if 'rosdep' is not installed on the system.
"""
for path in paths:
if shutil.which("rosdep"):
# Check if the extension.toml file exists
if not os.path.exists(f"{path}/config/extension.toml"):
raise FileNotFoundError(
"During the installation of 'rosdep' dependencies, unable to find a"
print(
"[WARN] During the installation of 'rosdep' dependencies, unable to find a"
f" valid file at: {path}/config/extension.toml."
)
continue
# Load the extension.toml file and check for ros_ws
with open(f"{path}/config/extension.toml") as fd:
ext_toml = toml.load(fd)
Expand Down