Priority: P3: Somewhat important
Affects Version/s: 5.15.2
Fix Version/s: None
Environment:Ubuntu Linux 18.04
Commits:6629810389d0d546a9306d7a65b4c2c20bd5b9a6 (pyside/pyside-setup/dev) 6d342a1857af6ae3a48c1b18e4d3d2730488c942 (pyside/tqtc-pyside-setup/tqtc/lts-5.15)
As part of our build process for our Python bindings, a custom script creates a .pyi file for our module. Part of this is invoking PySide2.support.signature.lib.enum_sig.HintingEnumerator(formatter).module(module_name) with the name of our module as argument.
Since our update to v5.15.2, this call raises a SystemError with the error message being implement enum instances at module level.
The error is caused by four enums in a bog-standard C++ header file. I cannot share the complete file, but I've included a shortened version that includes examples of everything included to be an accurate representation. You'll find the enums close to the bottom.
Our code defines heaps of other enums, none of which cause an error. However, these five seem to be the only ones to not be defined inside any namespace.
Removing these enums from our typesystem rids us of the error, but is not an acceptable workaround. The relevant excerpt from the typesystem:
For reference, here is the important bit of the custom script:
add_ld_library_paths and addLocalRpathToPythonBindings are helpers to add necessary information into the binary and shouldn't be of relevance. If you do need them, tell me. The Formatter class mentioned is also part of this script, same deal.
|For Gerrit Dashboard: PYSIDE-1519|
|339698,2||enum: implement enums on module level||dev||pyside/pyside-setup||Status: MERGED||+2||0|
|339727,3||enum: implement enums on module level||tqtc/lts-5.15||pyside/tqtc-pyside-setup||Status: MERGED||+2||0|
|341000,1||enum: implement enums on module level||tqtc/lts-5.15||pyside/tqtc-pyside-setup||Status: ABANDONED||+2||0|