Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-21712

Add pure-pybind11 approach to deprecation

    XMLWordPrintable

    Details

    • Type: Story
    • Status: To Do
    • Resolution: Unresolved
    • Fix Version/s: None
    • Component/s: utils
    • Labels:
    • Story Points:
      2
    • Team:
      Data Release Production

      Description

      Deprecating a C++ function wrapped with pybind11 currently requires a pure-Python file to be added so deprecate_pybind11 can be used on the wrapped function.  This is an unfortunate amount of boilerplate for something we want to keep lightweight, and it also ensures that a deprecation warning is still emitted when compiling the pybind11 module.

      It should be possible to have a pure-C++ way to invoke deprecate_pybind11 (i.e. by importing it using pybind11 APIs) while squashing compiler warnings.  The latter may require that this be a macro - we'll see - but that's a price worth paying to avoid spurious compiler warnings.

      Kian-Tat Lim, before I spend any time on this, did you try anything like this when putting together deprecate_pybind11?

        Attachments

          Issue Links

            Activity

            Hide
            krzys Krzysztof Findeisen added a comment - - edited

            Leaving the side the question of whether we want to suppress warnings from pybind11 wrappers, last I checked (~a year ago) GCC's warning-suppression #pragma s were broken, and had been for over a major version at that point. So it may not be possible to do this completely.

            Show
            krzys Krzysztof Findeisen added a comment - - edited Leaving the side the question of whether we want to suppress warnings from pybind11 wrappers, last I checked (~a year ago) GCC's warning-suppression #pragma s were broken, and had been for over a major version at that point. So it may not be possible to do this completely.
            Hide
            ktl Kian-Tat Lim added a comment -

            (Much later, but...) I didn't try anything like this for deprecate_pybind11.  It's possible that additional work on the C++ side could get around the immutability of pybind11 docstrings, but it's also possible that it could founder on that problem.

            Show
            ktl Kian-Tat Lim added a comment - (Much later, but...) I didn't try anything like this for deprecate_pybind11 .  It's possible that additional work on the C++ side could get around the immutability of pybind11 docstrings, but it's also possible that it could founder on that problem.
            Hide
            jbosch Jim Bosch added a comment -

            It looks like the gcc pragma limitations have been removed, at least to the extent that we now recommend using them under certain conditions in the dev guide. Aside from that I think this continues to be a low priority, but a feature request Matthias Wittgen should know about. Hopefully by the time we get to this, maybe it'll need to be a nanobind ticket instead of a pybind11 one.

            Show
            jbosch Jim Bosch added a comment - It looks like the gcc pragma limitations have been removed, at least to the extent that we now recommend using them under certain conditions in the dev guide . Aside from that I think this continues to be a low priority, but a feature request Matthias Wittgen should know about. Hopefully by the time we get to this, maybe it'll need to be a nanobind ticket instead of a pybind11 one.

              People

              Assignee:
              jbosch Jim Bosch
              Reporter:
              jbosch Jim Bosch
              Watchers:
              Jim Bosch, Kian-Tat Lim, Krzysztof Findeisen
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:

                  Jenkins

                  No builds found.