Skip to content
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

python: fix python path setting in plain cmake workspaces #618

Merged
merged 1 commit into from
Apr 11, 2014

Conversation

smits
Copy link
Contributor

@smits smits commented Apr 11, 2014

In plain cmake workspaces the python install dir is set to
lib/python2/dist-packages instead of lib/python2.7/dist-packages

I checked the catkin/cmake/python.cmake file and in that file there is
an extra check for the version, so I assume that we should only use
the major version in case the major version is 3 or higher.

@smits
Copy link
Contributor Author

smits commented Apr 11, 2014

The Travis CI build also fails without my patch!

@dirk-thomas
Copy link
Member

Yes, the travis file was just added recently and a PR exists to fix the failing unit test.

The Python function to determine the folder name is obviously not in sync with the CMake equivalent: https://github.com/ros/catkin/blob/indigo-devel/cmake/python.cmake
I will add a small comment in the patch to make it exactly identical. If you could please update that (and squash your commits afterwards) I will merge this.

@@ -241,7 +241,7 @@ def get_python_install_dir():
python_use_debian_layout = os.path.exists('/etc/debian_version')
if os.name != 'nt':
python_version_xdoty = str(sys.version_info[0])
if not python_use_debian_layout:
if (not python_use_debian_layout) or (sys.version_info[0] < 3) :
python_version_xdoty += '.' + str(sys.version_info[1])
Copy link
Member

Choose a reason for hiding this comment

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

For better readability and in order to not diverge from the CMake implementation please change the lines 243-245 to:

python_version_xdoty = str(sys.version_info[0]) + '.' + str(sys.version_info[1]
if python_use_debian_layout and sys.version_info[0] == 3:
    python_version_xdoty = str(sys.version_info[0])

In plain cmake workspaces the python install dir is set to
lib/python2/dist-packages instead of lib/python2.7/dist-packages

I checked the catkin/cmake/python.cmake file and in that file there is
an extra check for the version, so I assume that we should only use
the major version in case the major version is 3 or higher.
@smits
Copy link
Contributor Author

smits commented Apr 11, 2014

Done.

@dirk-thomas
Copy link
Member

Thx!

dirk-thomas added a commit that referenced this pull request Apr 11, 2014
python: fix python path setting in plain cmake workspaces
@dirk-thomas dirk-thomas merged commit e1c76db into ros:indigo-devel Apr 11, 2014
cwecht pushed a commit to cwecht/catkin that referenced this pull request Mar 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants