Ever wish your catkin package could painlessly depend on any python library under the sun?
Presenting catkin_virtualenv, a tool to define and bundle python dependencies with your catkin python packages.
We’ve been running an internal ros_buildfarm instance at Locus Robotics for almost 2 years (thanks OSRF!). One ongoing pain point was managing python package dependencies that aren’t in the Debian/Ubuntu apt repositories.
The workflow for catkin_virtualenv fits fairly well on top of the existing ROS Python-via-CMake pattern:
declare a set of python requirements in
generate a virtualenv at build time by calling CMake macro
install your python scripts via
- add a dependency to your nosetests and rostests.
More detail is provided in the README, or see the provided test packages for toy usage examples. Behind the scenes:
- the generated virtualenv will work transparently in devel- and install-space, and be bundled in any released debian packages.
- package requirements will be propagated to any dependent catkin packages.
- your python scripts will be wrapped in a loader that will work transparently with
- adding the
catkin_generate_virtualenvwill enable your python scripts to run in python3. This mostly ‘just works’ with a lot of existing ROS components, but does have a few caveats at the moment.
One important thing to note is that the catkin_virtualenv approach does make your package artifacts noticeably ‘fatter’ due to the dependency bundling, so be wary of pulling in large dependency trees, and please continue to use rosdep+apt dependencies when possible.
Please enjoy, and I’m looking forward to feedback from anyone who finds this package useful!