You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello. Thanks for putting the effort into this project. I think it will make a fantastic addition to ROS.
I was hoping to use this with bloom to include python deps in a .deb. I was going to include the pyproject.toml and optionally the poetry.lock in the deb (via setup.py data-files) and then run python3 -m colcon_poetry_ros.dependencies.install --install-base /opt/ros/galactic/share/* to install the deps using poetry. Ideally this would install them into a virtual environment or at least not the main site-packages (so different packages with different versions of the same library are supported).
I was going down this route as I have a bunch of packages with large dependencies such as pytorch and opencv which I don't want to package into the .debs
I got some of this working back in the day but had to disable virtual environments. I'm not very familiar with bloom or how ros launch would play with virtual envs but was hoping you might have an idea.
For example, the dpkg-query for a package bloomed with:
$ python3 -m colcon_poetry_ros.dependencies.install --base-path /opt/ros/galactic/share
The lock file does not exist. Locking.
Updating dependencies
Resolving dependencies... (0.1s)
[Errno 13] Permission denied: '/opt/ros/galactic/share/template_py_publisher/poetry.lock'
Traceback (most recent call last):
File "/home/ros/.local/lib/python3.8/site-packages/colcon_poetry_ros/package.py", line 99, in get_requirements_txt
subprocess.run(
File "/usr/lib/python3.8/subprocess.py", line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['poetry', 'export', '--format', 'requirements.txt', '--output', '/tmp/tmp4nmmji81']' returned non-zero exit status 1.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/ros/.local/lib/python3.8/site-packages/colcon_poetry_ros/dependencies/install.py", line 179, in<module>main()
File "/home/ros/.local/lib/python3.8/site-packages/colcon_poetry_ros/dependencies/install.py", line 22, in main
_install_dependencies_via_pip(
File "/home/ros/.local/lib/python3.8/site-packages/colcon_poetry_ros/dependencies/install.py", line 94, in _install_dependencies_via_pip
requirements_data = project.get_requirements_txt([])
File "/home/ros/.local/lib/python3.8/site-packages/colcon_poetry_ros/package.py", line 106, in get_requirements_txt
raise RuntimeError(
RuntimeError: Failed to export Poetry dependencies in the requirements.txt format: Command '['poetry', 'export', '--format', 'requirements.txt', '--output', '/tmp/tmp4nmmji81']' returned non-zero exit status 1.
Even ignoring this permission issue - I imagine there will be problems. I could poetry shell && poetry install next to the pyproject.toml but I'm not sure how I'd tell launch which venv to use for which node.
I was wondering if anyone had any thoughts on how to get this working?
The text was updated successfully, but these errors were encountered:
That's an interesting use case. I don't know very much about Bloom either. Combining ROS with virtual environments is a bit tricky, since workspaces are already a dependency isolation mechanism of sorts and they modify some of the same Python environment stuff that virtual environments do.
I believe roslaunch is extensible. Maybe an extension could be written to enter into a virtual environment before running a node?
Sorry that I can't be of more help. This is something I want to look into more as well.
Hello. Thanks for putting the effort into this project. I think it will make a fantastic addition to ROS.
I was hoping to use this with bloom to include python deps in a
.deb
. I was going to include thepyproject.toml
and optionally thepoetry.lock
in the deb (via setup.py data-files) and then runpython3 -m colcon_poetry_ros.dependencies.install --install-base /opt/ros/galactic/share/*
to install the deps using poetry. Ideally this would install them into a virtual environment or at least not the main site-packages (so different packages with different versions of the same library are supported).I was going down this route as I have a bunch of packages with large dependencies such as pytorch and opencv which I don't want to package into the
.debs
I got some of this working back in the day but had to disable virtual environments. I'm not very familiar with bloom or how ros launch would play with virtual envs but was hoping you might have an idea.
For example, the dpkg-query for a package bloomed with:
Looks something like:
Running install over this I get:
Even ignoring this permission issue - I imagine there will be problems. I could
poetry shell && poetry install
next to thepyproject.toml
but I'm not sure how I'd tell launch which venv to use for which node.I was wondering if anyone had any thoughts on how to get this working?
The text was updated successfully, but these errors were encountered: