-
Notifications
You must be signed in to change notification settings - Fork 4
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 install is inconsistent, does not resolve all constraints #20
Comments
You're absolutely right and this touches on a tension between ROS workspaces and Poetry. I think ideally the solution here would be to give each package its own virtual environment. The main challenge here would be to ensure that the virtual environment is entered when a node in that package is started. |
I wonder if there's a fusion between the ideas behind If we could figure out how to make the node executables execute the same way |
I've been thinking about the per-package venv solution before considering poetry. (Our current pip-based solution resolves the constraints across an entire workspace, which has caused some headache when different packages truly did want different versions of dependencies)
A solution I thought about is to have the dependency installer modify or wrap the "entry point" scripts, overriding the python executable and/or PYTHONPATH. It's less clear to me how to deal with library-like packages and cascading dependencies though |
@joncppl Are you familiar with
Pipx seems to do nearly exactly that. The idea with Here's what the
The key I think is the inclusion of the Perhaps if |
I've had some success prototyping this, but I did it outside of the context of colcon. One of the considerations I wanted to make is to be able to install python dependencies in a sourceless environment (eg. post install, src and build are deleted but install is left). allowing dependency installation to be a post-install operation for distributed packages.
This is working in a minimal demo workspace with some token dependencies. The concern I have left is how to expose the venv to a developer for: cli/repl and for IDE completion. A simple command could wrap |
The strategy of installing the dependencies of each package sequentially can lead to not all packages' dependent versions being satisified.
Take for example the simple case where my workspace contains two projects, that each depend on (just for sake of example) numpy. One package explicitly requests version 1.19 and the other version 1.20.
Running
python3 -m colcon_poetry_ros.dependencies.install ...
will appear to install both versions. However, after the install only version 1.19 is in site-packages.In this scenario surely there should be a warning about unresolvable version constraints.
A second example; project1 requests numpy
1.19
and project2 requests numpy<=1.20
. There is a version of numpy that satisfies both of these constraints (1.19). However... guess which version ends up in site-packages. It's 1.20The text was updated successfully, but these errors were encountered: