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

Deprecate GzPython.cmake #431

Merged
merged 2 commits into from
Jun 1, 2024
Merged

Deprecate GzPython.cmake #431

merged 2 commits into from
Jun 1, 2024

Conversation

scpeters
Copy link
Member

🎉 New feature

Part of #350

Summary

Using GzPython.cmake to find python is not ideal since it's best to find python once with the components that you need. Now that find_package(Python3) works well, it's best to just use that.

All Gazebo packages in Ionic have stopped using GzPython, so this should be safe to merge.

Test it

Compile Gazebo Ionic from source against this branch and ensure there are no cmake warnings from using GzPython and that python bindings are properly built for each package.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

It's better to call find_package(Python3) directly so the
user has better control over which COMPONENTS are requested.

Signed-off-by: Steve Peters <[email protected]>
@scpeters scpeters requested a review from j-rivero as a code owner May 24, 2024 20:39
@scpeters scpeters mentioned this pull request May 24, 2024
29 tasks
@github-actions github-actions bot added the 🏛️ ionic Gazebo Ionic label May 24, 2024
Update GzBuildTests.cmake and GzCodeCheck.cmake to
stop using GzPython.

Signed-off-by: Steve Peters <[email protected]>
set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE})
endif()
endif()
find_package(Python3 ${GZ_PYTHON_VERSION} QUIET)

# Tick-tock PYTHON_EXECUTABLE until Python3_EXECUTABLE is released
# TODO(jrivero) gz-cmake4: start the deprecation cycle of PYTHON_EXECUTABLE
Copy link
Member Author

Choose a reason for hiding this comment

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

I just noticed some uses of PYTHON_EXECUTABLE; I'll clean those up before merging this

Copy link
Member Author

Choose a reason for hiding this comment

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

primarily here: https://github.com/gazebosim/gz-sim/blob/main/python/CMakeLists.txt#L12

that's old cmake code that will be removed as part of #350, so actually it shouldn't be a problem

Copy link
Member Author

Choose a reason for hiding this comment

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

it will be removed in gazebosim/gz-sim#2420

Copy link
Member Author

Choose a reason for hiding this comment

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

that has been merged, so I'll merge this as well

@scpeters scpeters merged commit a1c15f7 into main Jun 1, 2024
8 checks passed
@scpeters scpeters deleted the scpeters/deprecate_gz_python branch June 1, 2024 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏛️ ionic Gazebo Ionic
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants