how to install real python modules in dist-packages?

asked 2019-07-03 12:28:55 -0500

zacwitte gravatar image

updated 2019-07-03 13:58:54 -0500

I've followed this documentation on how to use setup.py and CMakeLists.txt to use python modules in a catkin package. It pretty much "works" but I've observed that it actually puts a fake __init__.py into python2.7/dist-packages/my_package, which will modify my python path at runtime to include my module's src dir. This works OK for actually running the code, but static code analysis (eg. pylint) doesn't execute the code that changes the path and therefore can't find my modules.

I've noticed that other ROS python packages have the real python files in dist-packages so my question is how do I do that? I suspect that it has something to do with the catkin build type being Release, but I'm pretty sure my build script is already using RelWithDebInfo.

edit retag flag offensive close merge delete

Comments

What documentation are you following?

jayess gravatar image jayess  ( 2019-07-03 13:06:30 -0500 )edit
zacwitte gravatar image zacwitte  ( 2019-07-03 13:56:29 -0500 )edit
1

Afaik "real python files" will only be copied to an install space with catkin.

Either run catkin_make install or configure catkin build to also run the install phase of everything (catkin config --install).

gvdhoorn gravatar image gvdhoorn  ( 2019-07-03 15:12:17 -0500 )edit