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

Wrap pex_exceptions with pybind11

    XMLWordPrintable

Details

    • Story
    • Status: Done
    • Resolution: Done
    • None
    • pex_exceptions
    • None
    • 4
    • DRP F16-1, DRP F16-2
    • Data Release Production

    Description

      While wrapping these packages, pay particular attention to exception translation (see Jim's bullet point 3: https://jira.lsstcorp.org/browse/RFC-182?focusedCommentId=48644&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-48644).

      Attachments

        Issue Links

          Activity

            DM-6591 design complete and reviewed. Can now use this design to try to wrap pex_exceptions.

            pschella Pim Schellart [X] (Inactive) added a comment - DM-6591 design complete and reviewed. Can now use this design to try to wrap pex_exceptions.

            Now passes all pex_exception unit tests, except for those that depend on deriving from Python Exception. So this has to be looked at next.

            pschella Pim Schellart [X] (Inactive) added a comment - Now passes all pex_exception unit tests, except for those that depend on deriving from Python Exception. So this has to be looked at next.

            Reduced scope to be just pex_exceptions for easier review.

            pschella Pim Schellart [X] (Inactive) added a comment - Reduced scope to be just pex_exceptions for easier review.

            Now passes all unit tests with just pybind11 wrappers.
            Uses a similar workaround as with Swig to have a pure Python wrapper take care of deriving from Python Exception.
            Includes a new convenience function python::declare_exception to register custom exception types in other packages (similar in functionality to what we provided with the Swig %declareException macro).
            This all works in concert with the new exception translator support added to Python as part of DM-6783.

            pschella Pim Schellart [X] (Inactive) added a comment - Now passes all unit tests with just pybind11 wrappers. Uses a similar workaround as with Swig to have a pure Python wrapper take care of deriving from Python Exception. Includes a new convenience function python::declare_exception to register custom exception types in other packages (similar in functionality to what we provided with the Swig %declareException macro). This all works in concert with the new exception translator support added to Python as part of DM-6783 .

            Pim, I finished my review, all comments are on PR. This is the first time I had to look at pex_exceptions, and I was a bit confused by multi-level wrapping. I'm still not sure I understand everything so some of my comments may be nonsense.

            salnikov Andy Salnikov added a comment - Pim, I finished my review, all comments are on PR. This is the first time I had to look at pex_exceptions , and I was a bit confused by multi-level wrapping. I'm still not sure I understand everything so some of my comments may be nonsense.

            Thanks for all your helpful suggestions. Definitely not nonsense I will try to clean things up a bit. I ported over too much of the direct Python API stuff from the Swig solution. This can be done much nicer with pybind11 RAII indeed.

            pschella Pim Schellart [X] (Inactive) added a comment - - edited Thanks for all your helpful suggestions. Definitely not nonsense I will try to clean things up a bit. I ported over too much of the direct Python API stuff from the Swig solution. This can be done much nicer with pybind11 RAII indeed.

            Merged (onto epic branch instead of master) after implementing comments.

            pschella Pim Schellart [X] (Inactive) added a comment - - edited Merged (onto epic branch instead of master) after implementing comments.

            People

              pschella Pim Schellart [X] (Inactive)
              swinbank John Swinbank
              Andy Salnikov, Jim Bosch
              Andy Salnikov, Jim Bosch, John Swinbank, Pim Schellart [X] (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Jenkins

                  No builds found.