Skip to content

Commit f0c1ca6

Browse files
authored
Skips dependency installation for directories with no extension.toml (#2216)
## Description Previously empty or non-extension directories in the `source` folder caused installation to crash, forcing users to delete the empty directory. This MR replaces raising the error with a warning print. ## Type of change - Bug fix - New feature (non-breaking change which adds functionality) ## Checklist - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have updated the changelog and the corresponding version in the extension's `config/extension.toml` file - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there
1 parent 422cf35 commit f0c1ca6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tools/install_deps.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,17 @@ def install_apt_packages(paths: list[str]):
5252
paths: A list of paths to the extension's root.
5353
5454
Raises:
55-
FileNotFoundError: If the extension.toml file is not found.
5655
SystemError: If 'apt' is not a known command. This is a system error.
5756
"""
5857
for path in paths:
5958
if shutil.which("apt"):
6059
# Check if the extension.toml file exists
6160
if not os.path.exists(f"{path}/config/extension.toml"):
62-
raise FileNotFoundError(
63-
"During the installation of 'apt' dependencies, unable to find a"
61+
print(
62+
"[WARN] During the installation of 'apt' dependencies, unable to find a"
6463
f" valid file at: {path}/config/extension.toml."
6564
)
65+
continue
6666
# Load the extension.toml file and check for apt_deps
6767
with open(f"{path}/config/extension.toml") as fd:
6868
ext_toml = toml.load(fd)
@@ -94,18 +94,18 @@ def install_rosdep_packages(paths: list[str], ros_distro: str = "humble"):
9494
ros_distro: The ROS distribution to use for rosdep. Default is 'humble'.
9595
9696
Raises:
97-
FileNotFoundError: If the extension.toml file is not found under the path.
9897
FileNotFoundError: If a valid ROS workspace is not found while installing ROS dependencies.
9998
SystemError: If 'rosdep' is not a known command. This is raised if 'rosdep' is not installed on the system.
10099
"""
101100
for path in paths:
102101
if shutil.which("rosdep"):
103102
# Check if the extension.toml file exists
104103
if not os.path.exists(f"{path}/config/extension.toml"):
105-
raise FileNotFoundError(
106-
"During the installation of 'rosdep' dependencies, unable to find a"
104+
print(
105+
"[WARN] During the installation of 'rosdep' dependencies, unable to find a"
107106
f" valid file at: {path}/config/extension.toml."
108107
)
108+
continue
109109
# Load the extension.toml file and check for ros_ws
110110
with open(f"{path}/config/extension.toml") as fd:
111111
ext_toml = toml.load(fd)

0 commit comments

Comments
 (0)