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

Stop using python_cmake_module. #93

Draft
wants to merge 2 commits into
base: rolling
Choose a base branch
from

Conversation

clalancette
Copy link

We really don't need it anymore, and can just use the builtin find_package(Python3).

This must be merged before ros2/ros2#1524 ; see that pull request for more information about this change.

@jonbinney
Copy link
Contributor

@clalancette thank you for doing this! It looks like this PR removes the usage of python_cmake_module but doesn't add find_package(Python3). Is that because that is handled by find_package(ament_cmake_pytest REQUIRED)?

@clalancette
Copy link
Author

@clalancette thank you for doing this! It looks like this PR removes the usage of python_cmake_module but doesn't add find_package(Python3). Is that because that is handled by find_package(ament_cmake_pytest REQUIRED)?

That's a really good question. Most of the other places I did this already had separate calls to find_package(Python3), but this one didn't. I did run some preliminary CI on this, and that seemed to pass. But I'll take a closer look to see what is happening here.

@clalancette
Copy link
Author

Ah, I see. So it turns out that deep in the bowels of ament_cmake_core, we do a find_package(Python3), which the rest of the CMakeLists.txt is inheriting. So that makes it work in my testing.

But it doesn't seem right to depend on that; theoretically, someday ament_cmake_core could remove it. I'll discuss with some others and see if we should add it to ament_cmake_install_python or something like that.

Relatedly, I realize that this package is missing a dependency on ament_cmake_python, so I'll add that as well.

@clalancette
Copy link
Author

So we discussed this.

First, it is our feeling that downstream packages that just depend on ament_cmake_python should not have to call find_package(Python3) themselves, unless they directly reference it. Given that this package does not directly reference any of the Python3 things from CMake, this PR is correct as-is.

The other question had to do about whether we should explicitly do find_package(Python3) within ament_cmake_python. At the end of the day, we decided not to mess with what is working, and so we compromised and just added a comment in ament/ament_cmake#510 that explains that we expect it to be there via ament_cmake_core.

So I think this PR is generally ready to go. It still needs CI run on it, and we'll almost certainly have to merge in ros2/ci#755 first, but I think it is otherwise OK. @jonbinney let me know what you think.

@jonbinney
Copy link
Contributor

@clalancette that sounds good to me and this seems mergeable, but I realized this isn't actually one of the packages I maintain so @mabelzhang should make the call on merging.

Copy link
Collaborator

@quarkytale quarkytale left a comment

Choose a reason for hiding this comment

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

LGTM, will run CI after the ros2/ci PR gets merged

@clalancette clalancette marked this pull request as draft April 12, 2024 15:34
We really don't need it anymore, and can just use the
builtin find_package(Python3).

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
Signed-off-by: Chris Lalancette <clalancette@gmail.com>
@clalancette clalancette force-pushed the clalancette/remove-python-cmake-module branch from 5377535 to 3969274 Compare May 14, 2024 13:42
@clalancette clalancette force-pushed the clalancette/remove-python-cmake-module branch from 3969274 to cb69be1 Compare June 4, 2024 18:00
@clalancette clalancette force-pushed the clalancette/remove-python-cmake-module branch from cb69be1 to 3969274 Compare June 25, 2024 13:22
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.

3 participants