Skip to content

Add install commands and __init__.py #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 23, 2017
Merged

Conversation

mehditlili
Copy link
Contributor

After installing my package, I noticed that an init.py was missing and python was unable to import correctly.

Copy link
Owner

@luator luator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your input, it is very appreciated!

I have some comments on the installation of the python script (see below).
And a question to the __init__.py file: Is this really necessary for some reason? If not, I would prefer to remove it to keep this example as minimal as possible (i.e. only including parts that are necessary for getting the Boost Python bindings to work).

CMakeLists.txt Outdated
)

file(GLOB py_files "scripts/*.py")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To keep it minimalist, I would prefer to not use the file command but just use the explicit filename.

CMakeLists.txt Outdated
)

file(GLOB py_files "scripts/*.py")
install(PROGRAMS ${py_files}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the catkin_install_python macro to install python scripts. See http://docs.ros.org/kinetic/api/catkin/html/howto/format2/installing_python.html

@mehditlili
Copy link
Contributor Author

When I tried without the init.py, the mycpplib.so is installed but can't be imported in Python.

@luator
Copy link
Owner

luator commented Apr 23, 2017

Sorry for the late response, looks good now :). Thanks again.

@luator luator merged commit a2b9f5e into luator:master Apr 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants