<div>Hello,<br></div><div><br></div><div>migrating from SIP v4 build
system to SIP v5 build system I'm trying to build wheel for a simple
PyQt extension written in C++, a custom event filters.<br></div><div><br></div><div>The pyproject.toml is like this :<br></div><div><br></div><div>[build-system]<br></div><div>requires = ["sip >=5, <7", "PyQt-builder", "PyQt5"]<br></div><div>buid-backend = "sipbuild.api"<br></div><div><br></div><div>[tool.sip.metadata]<br></div><div>name = "customeventfilters"<br></div><div>version = "0.7.0"<br></div><div>description = "Custom PyQt5 event filters"<br></div><div>author = "ZephOne"<br></div><div>author-email = "<a href="mailto:zephone@protonmail.com" rel="noreferrer nofollow noopener">zephone@protonmail.com</a>"<br></div><div>license='BSD'<br></div><div>requires-dist = "PyQt5"<br></div><div><br></div><div>[tool.sip.project]<br></div><div>sdist-excludes = [<br></div><div> ".git/*",<br></div><div> ".git/*/*",<br></div><div> ".git/*/*/*",<br></div><div> ".git/*/*/*/*",<br></div><div> ".git/*/*/*/*/*",<br></div><div> ".git/*/*/*/*/*/*",<br></div><div> ".git/*/*/*/*/*/*/*"<br></div><div>]<br></div><div class="protonmail_signature_block protonmail_signature_block-empty"><div class="protonmail_signature_block-user protonmail_signature_block-empty"><br></div><div class="protonmail_signature_block-proton protonmail_signature_block-empty"><br></div></div><div><br></div><div>And the project.py which is used only to specify the location of the C++ library is like this:<br></div><div><br></div><div>"""The build configuration file for CustomEventFilters, used by sip."""<br></div><div><br></div><div>import os<br></div><div><br></div><div>from pyqtbuild import PyQtBindings, PyQtProject<br></div><div>from sipbuild import Option<br></div><div><br></div><div><br></div><div>class CustomEventFilters(PyQtProject):<br></div><div> """The Project class."""<br></div><div><br></div><div> def __init__(self):<br></div><div> """ Initialise the project. """<br></div><div><br></div><div> super().__init__()<br></div><div><br></div><div> self.bindings_factories = [MyEventFilters]<br></div><div><br></div><div><br></div><div>class MyEventFilters(PyQtBindings):<br></div><div> """ My event filters bindings. """<br></div><div><br></div><div> def __init__(self, project):<br></div><div> """ Initialise the bindings. """<br></div><div><br></div><div> super().__init__(<br></div><div> project,<br></div><div> "MyEventFilters",<br></div><div> sip_file='myeventfilters.sip'<br></div><div> )<br></div><div><br></div><div> def apply_user_defaults(self, tool):<br></div><div> """ Set default values for user options that haven't been set yet. """<br></div><div><br></div><div> if self.myeventfilters_include_dir is not None:<br></div><div> self.include_dirs.append(<br></div><div> os.path.abspath(<br></div><div> self.myeventfilters_include_dir<br></div><div> )<br></div><div> )<br></div><div><br></div><div> if self.myeventfilters_library_dir is not None:<br></div><div> self.include_dirs.append(<br></div><div> os.path.abspath(<br></div><div> self.myeventfilters_library_dir<br></div><div> )<br></div><div> )<br></div><div><br></div><div> super().apply_user_defaults(tool)<br></div><div><br></div><div> def get_options(self):<br></div><div> """ Return the list of configurable options. """<br></div><div><br></div><div> options = super().get_options()<br></div><div><br></div><div> options.append(<br></div><div> Option(<br></div><div> "myeventfilters_include_dir",<br></div><div> help="the my event filters include file directory is in DIR",<br></div><div> metavar="DIR"<br></div><div> )<br></div><div> )<br></div><div><br></div><div> options.append(<br></div><div> Option(<br></div><div> "myeventfilters_library_dir",<br></div><div> help="the my event filters library is in DIR",<br></div><div> metavar="DIR"<br></div><div> )<br></div><div> )<br></div><div><br></div><div> return options<br></div><div><br></div><div>I think there's no problem with the C++ library (I had no problem SIP4).<br></div><div><br></div><div>With these two files I have no problem building the the wheel, using sip-wheel.<br></div><div>But when I try to import it in a python console I've got this error:<br></div><div><br></div><div>ImportError: /venvdir/customeventfilters/lib/python3.9/site-packages/customeventfilters.cpython-39-x86_64-linux-gnu.so: undefined symbol: _ZTI18GenericEventFilter<br></div><div><br></div><div>GenericEventFilter is a class defined in the C++ library.<br></div><div><br></div><div>Did I miss something binding the C++ extension ?<br></div>