Skip to content

Conversation

@scpeters
Copy link
Member

🦟 Bug fix

Fixes a compiler warning caused by pybind11 2.12

Summary

Version 2.12 of pybind11 was recently merged to homebrew-core:

This release includes pybind/pybind11#4772, which causes a compiler warning in sdformat:

python/src/sdf/_gz_sdformat_pybind11.cc:153:25: warning: 'operator()' is deprecated: Please use py::set_error() instead (https://github.com/pybind/pybind11/pull/4772) [-Wdeprecated-declarations]
      sdfErrorsException(e.what());
                        ^
/usr/local/include/pybind11/pybind11.h:2623:5: note: 'operator()' has been explicitly marked deprecated here
    PYBIND11_DEPRECATED("Please use py::set_error() instead "
    ^
/usr/local/include/pybind11/detail/common.h:202:43: note: expanded from macro 'PYBIND11_DEPRECATED'
#    define PYBIND11_DEPRECATED(reason) [[deprecated(reason)]]
                                          ^
1 warning generated.

This adds a version check and a fix for newer versions of pybind11.

Checklist

  • Signed all commits for DCO
  • Added tests
  • 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.

@scpeters scpeters requested a review from azeey as a code owner March 28, 2024 22:50
@github-actions github-actions bot added the 🎵 harmonic Gazebo Harmonic label Mar 28, 2024
@codecov
Copy link

codecov bot commented Mar 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.42%. Comparing base (ff9b3ad) to head (d04286f).
Report is 3 commits behind head on sdf14.

Additional details and impacted files
@@           Coverage Diff           @@
##            sdf14    #1389   +/-   ##
=======================================
  Coverage   92.42%   92.42%           
=======================================
  Files         134      134           
  Lines       17751    17751           
=======================================
  Hits        16406    16406           
  Misses       1345     1345           

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

@azeey azeey merged commit 69aca59 into sdf14 Mar 29, 2024
@azeey azeey deleted the scpeters/fix_pybind_warning branch March 29, 2024 00:20
scpeters added a commit that referenced this pull request Apr 19, 2024
@scpeters scpeters mentioned this pull request Apr 19, 2024
8 tasks
scpeters added a commit that referenced this pull request Apr 19, 2024
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.

4 participants