Managing python dependencies with pip has been especially annoying. It will be great if colcon can resolve the dependencies of all packages in the workspace and install them in a virtual environment.
Such feature existed in colcon-poetry-ros, but is limited to poetry. I did a quick prototype with UV in https://github.com/Briancbn/colcon-python-project-uv#usage. You can simply run the following command to setup a venv for your workspace
Then after build, an activate.sh file will be generated. User can simply source it and deactivate them as they like
$ source ./install/activate.sh
(colcon-ws) $ deactivate
$
This is currently just a prototype built on UV, but it supports poetry, uv_build, setuptools, scikit-build-core packages. UV also handles locking and resolving different versions of python dependencies. We have used this internally for a few months now for convenience.
We can also leverage pixi for this too and have a tighter integration with colcon-spawn-shell.
Please let me know if this is something useful for the community.
Managing python dependencies with pip has been especially annoying. It will be great if colcon can resolve the dependencies of all packages in the workspace and install them in a virtual environment.
Such feature existed in
colcon-poetry-ros, but is limited to poetry. I did a quick prototype withUVin https://github.com/Briancbn/colcon-python-project-uv#usage. You can simply run the following command to setup avenvfor your workspaceThen after build, an
activate.shfile will be generated. User can simply source it and deactivate them as they like$ source ./install/activate.sh (colcon-ws) $ deactivate $This is currently just a prototype built on
UV, but it supportspoetry,uv_build,setuptools,scikit-build-corepackages. UV also handles locking and resolving different versions of python dependencies. We have used this internally for a few months now for convenience.We can also leverage
pixifor this too and have a tighter integration withcolcon-spawn-shell.Please let me know if this is something useful for the community.