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

Make ament_python_install_package() install a flat Python egg #316

Merged
merged 13 commits into from Feb 24, 2021

Conversation

hidmic
Copy link
Contributor

@hidmic hidmic commented Jan 28, 2021

Precisely what the title says. A first stab at addressing #213 and #156.

Also connected to ros2/rosidl#565.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Copy link
Contributor

@ivanpauno ivanpauno left a comment

Choose a reason for hiding this comment

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

Looking pretty good to me!

I've left some minimal comments

@@ -13,14 +13,18 @@
# limitations under the License.

#
# Install a Python package (and its recursive subpackages).
# Install a Python package (and its recursive subpackages) as a flat Python .egg
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# Install a Python package (and its recursive subpackages) as a flat Python .egg
# Install a Python package (and its recursive subpackages) as a flat Python egg.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
@hidmic
Copy link
Contributor Author

hidmic commented Jan 29, 2021

Tested against rclpy, it works flawlessly.

Running full CI, JIC:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@hidmic hidmic requested a review from sloretz January 29, 2021 22:34
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
@hidmic
Copy link
Contributor Author

hidmic commented Feb 2, 2021

Argh, one three little details missing. Running full CI, again:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@hidmic hidmic changed the title Make ament_python_install_package() install a flat Python .egg Make ament_python_install_package() install a Python egg Feb 2, 2021
@hidmic hidmic changed the title Make ament_python_install_package() install a Python egg Make ament_python_install_package() install a flat Python egg Feb 2, 2021
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
It fails on Windows otherwise

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
@hidmic
Copy link
Contributor Author

hidmic commented Feb 9, 2021

@ivanpauno @sloretz PTAL!

@hidmic hidmic requested a review from ivanpauno February 9, 2021 13:15
where=os.path.normpath('${source_dir}/..'),
include=('${package_name}', '${package_name}.*')),
package_dir={'${package_name}': '${source_dir}'},
package_data={'': ['*.*']}
Copy link
Contributor

Choose a reason for hiding this comment

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

If this is mimicking the install rule copying the entire package dir, then it seems like the pattern should be * instead of *.* to include files without dots.

Might need something like exclude_package_data={'': ['*.pyc', '__pycache__']} to avoid copying any byte code files in the source directory like the install() rule's EXCLUDE patterns, though it seems like that might not be enough if there are byte code files in a subdirectory and exclude_package_data also doesn't support recursive glob patterns pypa/setuptools#1806 . I don't have any ideas on how to fix it, but I'm fine with not fixing it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're completely right. My implementation was biased by our use cases.

I think I got it right in 7876939 and a2f1349. PTAL !

@sloretz
Copy link
Contributor

sloretz commented Feb 13, 2021

Approach LGTM, just some nitpick comments

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
- Handle files with no extension
- Handle arbitrarily nested subdirectories

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
@hidmic
Copy link
Contributor Author

hidmic commented Feb 15, 2021

Running full CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
@hidmic
Copy link
Contributor Author

hidmic commented Feb 17, 2021

CI up to ament_cmake_python, to make sure tests now pass:

  • Windows Build Status

@hidmic hidmic requested a review from sloretz February 17, 2021 17:22
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
@hidmic
Copy link
Contributor Author

hidmic commented Feb 17, 2021

Running CI up to ament_cmake_python to cover the new tests:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@hidmic hidmic requested a review from sloretz February 17, 2021 21:45
Copy link
Contributor

@sloretz sloretz left a comment

Choose a reason for hiding this comment

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

LGTM with green CI (can't currently see CI badges because ci.ros2.org is under maintenance)

@hidmic
Copy link
Contributor Author

hidmic commented Feb 24, 2021

CI's is completely green, merging !

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.

None yet

3 participants