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

Backport pybind11 warning fix #1404

Merged
merged 1 commit into from
Apr 19, 2024
Merged

Backport pybind11 warning fix #1404

merged 1 commit into from
Apr 19, 2024

Conversation

scpeters
Copy link
Member

@scpeters scpeters commented Apr 19, 2024

Backport #1389 to garden

Fixes a compiler warning on garden.

Original PR description:

Fix warning with 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 Rebase-and-Merge.

@scpeters scpeters requested a review from azeey as a code owner April 19, 2024 20:55
@github-actions github-actions bot added the 🌱 garden Ignition Garden label Apr 19, 2024
@scpeters scpeters enabled auto-merge (rebase) April 19, 2024 21:27
@scpeters scpeters merged commit 2799934 into sdf13 Apr 19, 2024
12 checks passed
@scpeters scpeters deleted the scpeters/pick_pybind_warning branch April 19, 2024 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌱 garden Ignition Garden
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants