-
Notifications
You must be signed in to change notification settings - Fork 7
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
Dependency to other colcon packages in the ws #37
Comments
Thanks for bringing this up. As you found, this tool does not interface properly with |
Yeah, actually Just to document an use-case in order to be more verbose, in my case we have:
If I do Thanks for the prompt answer @velovix 😄 . I will try to workaround this for the moment then |
I might have found something: Here package_augmentation/poetry.py: if "build-system" in pyproject and "requires" in pyproject["build-system"]:
build_deps = pyproject["build-system"]["requires"]
else:
build_deps = set()
run_deps = project.get_dependencies(config.run_depends_extras.get())
test_deps = project.get_dependencies(config.test_depends_extras.get())
desc.dependencies["build_depends"] = set(
create_dependency_descriptor(dep) for dep in build_deps
)
desc.dependencies["run_depends"] = set(
create_dependency_descriptor(dep) for dep in run_deps
)
desc.dependencies["test_depends"] = set(
create_dependency_descriptor(dep) for dep in test_deps you are getting the build/run/test dependencies to be passed to colcon, right? So if in the [build-system]
requires = ["poetry-core", "A", "B"] The dependencies are well obtained. And that fix the issue Maybe here the package/colcon dependencies could be obtained from another key (not |
Just elaborating a bit over this idea: We could indicate in the [colcon-package]
build_depend = ["A", "B"] For doing this we should modify the code I linked and do something like(draft): if "colcon-package" in pyproject and "depend" in pyproject["colcon-package"]:
build_depend = pyproject["colcon-package"]["build_depend"]
else:
build_depend = set()
if "colcon-package" in pyproject and "exec_depend" in pyproject["colcon-package"]:
exec_depend = pyproject["colcon-package"]["exec_depend"]
else:
exec_depend = set()
if "colcon-package" in pyproject and "test_depend" in pyproject["colcon-package"]:
test_depend = pyproject["colcon-package"]["test_depend"]
else:
test_depend = set()
desc.dependencies["build_depends"] = set(
create_dependency_descriptor(dep) for dep in build_depend
)
desc.dependencies["run_depends"] = set(
create_dependency_descriptor(dep) for dep in exec_depend
)
desc.dependencies["test_depends"] = set(
create_dependency_descriptor(dep) for dep in test_depend
) |
Related to #37 ### Summary This PR introduces the ability to indicate the colcon/ros dependencies of the project via the `pyproject.toml` file. Otherwise, dependencies for the package aren't loaded up, and the ordering when building isn't respected ### Use Add to `pyproject.toml` the following section: ```toml [colcon-package] depend = ["another_pkg_1"] # This will add to both `build_depend` and `exec_depend` following `package.xml` standards build_depend = ["another_pkg_2"] exec_depend = ["another_pkg_3"] test_depend = ["another_pkg_4"] ```
Summary
Hey there, I found really interesting this tool and I wanted to give it a shot
In order to try this out I created a colcon ws and I created a couple of poetry packages.
However, I found an issue when trying to identify dependencies among the pacakges via
colcon graph
or even the order of "building" when doingpackages-up-to
I might probably be missing some configuration, I am not really poetry savvy
Replicating the issue
Basically I created a couple of packages in my ws:
ros2 pkg create --build-type ament_python my_py_pkg
ros2 pkg create --build-type ament_python my_py_pkg_2
So far (no poetry-ros so far) when doing
colcon graph
the dependencies are correctly identified:poetry init
I initalized thepyproject.toml
for each package. (Also removed the setup.py file as it is no longer needed)From here I proceeded to
colcon build
(previously installing colcon-poetry-ros extension) things are "ok"(things are built and installed).However, when checking the
dependencies
via colcon graph the dependencies aren't well identified.Consequently, the ordering of the
colcon build
executing isn't expected.The text was updated successfully, but these errors were encountered: