gazebosim / sdformat

Simulation Description Format (SDFormat) parser and description files.
http://sdformat.org
Apache License 2.0
169 stars 97 forks source link

python bindings: get version from package.xml #1504

Open scpeters opened 1 week ago

scpeters commented 1 week ago

🎉 New feature

Similar to https://github.com/gazebosim/gz-math/pull/642 using https://github.com/gazebosim/gz-cmake/pull/456 from gz-cmake 4.1.0

Summary

When building python bindings separately from the main library, the major version of libsdformat has been hard-coded, but this changes it to parse the version number from the package.xml file in this repository using a gz-cmake feature added in https://github.com/gazebosim/gz-cmake/pull/456 and released in 4.1.0. We could also consider using this feature in the root CMakeLists.txt file, but for now it is just used when building python bindings separately from the main library.

Test it

  1. Configure the python folder:
cd python
mkdir build
cd build
cmake ..
  1. Verify that it found sdformat15
-- Looking for sdformat15 -- found version 15.0.0

Checklist

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.

codecov[bot] commented 5 days ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Please upload report for BASE (sdf15@4ebe022). Learn more about missing BASE report.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## sdf15 #1504 +/- ## ======================================== Coverage ? 92.47% ======================================== Files ? 138 Lines ? 18326 Branches ? 0 ======================================== Hits ? 16947 Misses ? 1379 Partials ? 0 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


🚨 Try these New Features: