-
Notifications
You must be signed in to change notification settings - Fork 280
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
Fix package dir location #751
Conversation
package_dir: {'foo':'lib'} means 'lib/__init__.py' and not 'lib/foo/__init__.py'
I tested this by running :
on my package that was causing problem before :
Everything seems to behave as expected with this pull request 👍 I also agree that the root location check had a problem, but I didn't check your fix in details yet. Especially how it would behave on sub-sub-packages ( need to make sure it checks two levels of directories I think... ) Anyway I ll use this version from now on with my projects, and I ll let you know if I see any issues... Thanks a lot for the fix ! |
OK so I think I found a few issues with that location fix. Here is the output of catkin_make, with print added in the location check : locations = _get_locations(pkgs, package_dir)
for pkgname, location in locations.items():
print("checking package {0} in {1}".format(pkgname, location))
if not '.' in pkgname:
continue
splits = pkgname.split('.')
# hack: ignore write-combining setup.py files for msg and srv files
if splits[1] in ['msg', 'srv']:
continue
# check every child has the same root folder as its parent
root_name = splits[0]
root_location = location
for _ in range(len(splits) - 1):
root_location = os.path.dirname(root_location)
print("checking {0} != {1}".format(root_location, locations[root_name]))
if root_location != locations[root_name]:
raise RuntimeError(
"catkin_export_python does not support setup.py files that combine across multiple directories: %s in %s, %s in %s" % (pkgname, location, root_name, locations[root_name])) On that revision https://github.com/asmodehn/flask-ext-catkin/commit/59120f6246806bab25f5e4c2fea06bd847b28e52
Please let me know if my expectation is correct and if you can confirm that is a problem. |
Also please let me know if you can reproduce and confirm this behavior. |
Interestingly I am experiencing another (related ? ) problem with that version : If my generate_distutils_setup() call contains a py_modules parameter, all the python modules listed in it are not present in devel/. You might be able to reproduce it ( with this catkin version ) on this version : https://github.com/asmodehn/flask-ext-catkin/commit/e3ffc19a0c30ebc7327f5cc6a22efe776b96d77c No time to investigate now though. I ll get back to it another time, but please let me know if you find something in the meantime. |
Looking at the list of checks performed this is exactly what I expected. For each package only the most parent package location is checked. That's why the code does:
and
This ensures that a subpackage is also a subfolder (and not being located somewhere independently). Regarding your second comment about |
Okay thanks for the link I didnt know about this devel space limitations... i ll have to find a work around on my side then. |
This replaces #747.