gerkey / ros1_external_use

64 stars 12 forks source link

python : workspace and virtual envs #8

Open asmodehn opened 8 years ago

asmodehn commented 8 years ago

When working on a python package, I usually use virtuals env, ( supported by many python tools ). However when depending on ros sources, I usually work with a catkin devel workspace.

I was wondering if there was a way to "merge" this two concepts ? Like, make ROS tools find and use a virtual env, or make virtualenv tools think the catkin devel workspace is a virtual env ?

gerkey commented 8 years ago

I'm not a virtual envs user myself, so I'm not the best person to ask. I suspect that there is some way to make virtual envs and catkin rorkspaces play together. They both seem to be directories with certain structures and setup files. It would be great if you could suggest a way of doing that as an addition to this repo.

asmodehn commented 8 years ago

After a quick preliminary research, there are at least two big differences that I am aware about:

I think this might actually make them incompatible...

And thinking about it there is likely the issue with workspace overlay when we start caring about the versions of our packages : workspace A overlays workspace B, A has package Pa and Pc v0.2, B has package Pb and Pc v0.1. I run A, which calls B. Isn't B using Pc v0.2 now ?

I might need to investigate and confirm that sometime...

asmodehn commented 8 years ago

I m currently working on https://github.com/asmodehn/catkin_pure_python to allow catkin users to manipulate python packages directly with pip ( instead of custom catkin code ).

I tried a few different approach and the working solution so far is to treat the workspace as a "prefix" from pip options. Except a small hack, everything seems to work correctly in the workspace ( devel or install ), including overlays.

I ll PR something about it to this repo sometime soon