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

Permit building python bindings separately from main library (backport #554) #555

Merged
merged 1 commit into from
Dec 9, 2024

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented Nov 10, 2024

🎉 New feature

Part of osrf/homebrew-simulation#2834, related to gazebosim/gz-math#636

Summary

This allows the python/CMakeLists.txt file to be built as a top-level cmake project against an external gz-transport library.

Test it

  1. Invoke cmake on the root CMakeLists.txt with using -DSKIP_PYBIND11=ON to build and install the libsdformat library without python bindings.
  2. Invoke cmake on python/CMakeLists.txt with -DPython_EXECUTABLE=/path/to/python to build and install python bindings for a given python version
  3. Repeat 2 with for each desired version of python

TODO: update homebrew formula using this branch in a draft PR

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.


This is an automatic backport of pull request #554 done by [Mergify](https://mergify.com).

Copy link
Author

mergify bot commented Nov 10, 2024

Cherry-pick of 250e95f has failed:

On branch mergify/bp/gz-transport13/pr-554
Your branch is up to date with 'origin/gz-transport13'.

You are currently cherry-picking commit 250e95f0.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   CMakeLists.txt
	modified:   tutorials/02_installation.md

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   python/CMakeLists.txt

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@mergify mergify bot added the conflicts label Nov 10, 2024
@mergify mergify bot requested a review from caguero as a code owner November 10, 2024 10:50
@github-actions github-actions bot added the 🎵 harmonic Gazebo Harmonic label Nov 10, 2024
Copy link

codecov bot commented Nov 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.16%. Comparing base (eac2e69) to head (0f9b052).
Report is 25 commits behind head on gz-transport13.

Additional details and impacted files
@@                Coverage Diff                 @@
##           gz-transport13     #555      +/-   ##
==================================================
- Coverage           87.69%   87.16%   -0.53%     
==================================================
  Files                  59       58       -1     
  Lines                5704     5610      -94     
==================================================
- Hits                 5002     4890     -112     
- Misses                702      720      +18     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

This allows the python/CMakeLists.txt file to be built
as a top-level cmake project against an external gz-transport
library, with documentation added to the installation tutorial.

The logic for finding pybind11 is also moved from the root
CMakeLists.txt to python/CMakeLists.txt to reduce code
duplication. When invoked through the root CMakeLists.txt,
pybind11 is treated as an optional dependency, but when
invoked from the python folder, pybind11 is treated as
required by setting the variable
CMAKE_REQUIRE_FIND_PACKAGE_pybind11 to TRUE.

Signed-off-by: Silvio Traversaro <[email protected]>
Signed-off-by: Steve Peters <[email protected]>
Co-authored-by: Silvio Traversaro <[email protected]>
(cherry picked from commit 250e95f)
@scpeters scpeters force-pushed the mergify/bp/gz-transport13/pr-554 branch from 9493198 to 307c095 Compare November 15, 2024 20:08
@scpeters
Copy link
Member

squashed 9d14160 and 9493198 into the base commit

@scpeters scpeters merged commit 0b52db6 into gz-transport13 Dec 9, 2024
9 checks passed
@scpeters scpeters deleted the mergify/bp/gz-transport13/pr-554 branch December 9, 2024 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎵 harmonic Gazebo Harmonic
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

1 participant