aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2
Commit message (Collapse)AuthorAgeFilesLines
...
| * Use PyUnicode_GetLength instead of PyUnicode_GetSizeCristian Maureira-Fredes2019-05-032-1/+7
| | | | | | | | | | | | | | | | The function PyUnicode_GetSize is deprecated. Change-Id: I0bc0acd35424f29e1f5154deb0429dab5a4aabd4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
| * shiboken documentation: Move TOC to index pageFriedemann Kleint2019-04-302-22/+15
| | | | | | | | | | Change-Id: I0f7c6a303cb0d404c42ae96f067eece1442c4a33 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * shiboken/Generators: Cache class information lists per classFriedemann Kleint2019-04-303-30/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function ShibokenGenerator::getFunctionGroups(class) is called many times for each function during code generation and causes a slowdown for the OpenGL version function classes, which have 1000 member functions. Split away getGlobalFunctionGroups() for the case scope=0 and introduce a global-static cache for class information that is more involved to determine for use by the various generators. Speeds up the generation of the QtGui module including the OpenGL version functions from 420s to 90s. Task-number: PYSIDE-955 Change-Id: I6b6aa35ef2197aa9cddbf339db9eb0220932f361 Reviewed-by: Christian Tismer <tismer@stackless.com>
| * shiboken: Refactor progress message output handlingFriedemann Kleint2019-04-306-68/+65
| | | | | | | | | | | | | | | | | | | | | | | | In class ReportHandler, replace the step counting by a simple pair of startProgress()/endProgress() functions that check for warnings and print the appropriate terminator. Module name and timestamp are now also printed. Add a few more messages and give proper names to the generators. Change-Id: I92b4ef2854b824fbba3d371417edc1f88561a2cb Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * Avoid too much stickiness when using --reuse-buildChristian Tismer2019-04-261-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We had some unwanted cache effects and needed to manually remove certain files before building. Otherwise it could happen that a build pretended to be ok, although there was a bug that prevented generation of the ".pyi" files. Further investigation showed: Using option "--reuse-build" with "no" and then with "yes" creates errors in the signature module. This makes "reuse-build" useless in this case. We now add an "a" to "pyside3d_build" as "pside3da_build" if "--limited-api=yes" was given. (different proposals welcome.) That solved most of the stickiness problems. A left-over lock directory is removed now, since it would prevent re-computation of the .pyi files. This is implemented by a recursive call to the script, where the subprocess does the work and the main process checks if there was a crash and removes the lock. The "--skip" parameter of generate_pyi.py was refined: When set, it is checked if the time stamp of all imported modules is less than the ".pyi" file time stamp. Only then the generation is skipped. By editing any involved python file, the ".pyi" files will be regenerated. Task-number: PYSIDE-560 Change-Id: I1b1d8ffbc58db3d4b38bf65e3795efcad7e7870c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Friedemann Kleint2019-04-2518-199/+652
|\| | | | | | | Change-Id: I73efd93dfb3662aa7d420e7b45f58dfbf6725593
| * shiboken2: Enable documentation generation with libxml2/libxsltFriedemann Kleint2019-04-2515-190/+631
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As QtXmlPatterns is deprecated in Qt 5.14, the documentation build needs to be changed to work with libxml2/libxslt exclusively. Split the XML functionality into separate files for libxslt and Qt and provide an interface for XPATH queries and XSLT transformations in xmlutils.h. Adapt testmodifydocumentation to work on temporary files as libxslt cannot handle Qt resources. Change-Id: I923f5b2e7c1d2511f15788e4b80c7721daeb2bc3 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * shiboken: Output module name in "done" messageFriedemann Kleint2019-04-253-9/+21
| | | | | | | | | | | | | | | | Move the formatting of the "done" message to the report handler and add the prefix, which is the module name. Change-Id: I63aa1f48f02709d6e89d9a9a684d56a218e65fd3 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Friedemann Kleint2019-04-2455-774/+741
|\| | | | | | | Change-Id: I28805a29caa05e996b490ba46e27ddbc243cc074
| * Remove CMake dead codeAlexandru Croitor2019-04-232-49/+0
| | | | | | | | | | Change-Id: Icb2d3702972a2dc49ee296b2111811ff75b162fc Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Modernize and clean up some of the shiboken build system filesAlexandru Croitor2019-04-2015-155/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Use target_* commands instead of subdirectory based commands for adding link options, compile definitions, include directories, etc. Remove some non-used compile definitions. Move around some of the find_package() and option() calls. Simplify some of the package dependent logic. Replace the qt include and linking variables with CMake targets. Change-Id: I815595344e63a32dce3dc78652359beede3ff593 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
| * Fix shiboken not to fail building when doc dependencies are missingAlexandru Croitor2019-04-184-12/+15
| | | | | | | | | | | | | | | | | | | | | | QtXmlPatterns is now deprecated, and until we port to some other library, the CI will not have XmlPatterns anymore. Change the build system of shiboken to skip building the documentation parts if the dependency is missing. Change-Id: I75d38502cd1efa84f7ec148622ffbf26084d0c35 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
| * Declare XML files to be in encoding UTF-8Friedemann Kleint2019-04-184-4/+4
| | | | | | | | | | | | | | | | Some XML tools trip over the missing character set. Change-Id: Icbe1b2485325b70c4772b6a370a98fd529437a8a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| * Make the PepType_AS_BUFFER definition completeChristian Tismer2019-04-161-0/+1
| | | | | | | | | | | | | | | | | | | | PepType_AS_BUFFER should also be defined for the non-Limited API version to avoid ugly #ifdef constructs. This patch augments the definition and simplifies qtcore.cpp . Change-Id: Iddfb39e8afaf992f4edf72d871eec1eaf85d5963 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * shiboken: Enable including typesystem XML snippets via entitiesFriedemann Kleint2019-04-165-0/+104
| | | | | | | | | | | | | | | | | | | | | | | | Implement a QXmlStreamEntityResolver which resolves undeclared entities to file names in the type system include path. This is a work-around for the missing handling of standard externally parsed entities of QXmlStreamReader. Task-number: PYSIDE-955 Change-Id: I68ebae8ad465ae460c3a0eeadaef22dca2101e6c Reviewed-by: Christian Tismer <tismer@stackless.com>
| * Ensure that signature strings never overflow againChristian Tismer2019-04-166-39/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The signature module used to use large strings with the signatures of all functions in a class. This can lead to an overflow in MSVC, because the maximum string length funnily still is 32K unicode characters. This patch solves that by using a single string per function. Instead of a huge string, a list of strings is passed to each class. To prevent any runtime increase, the string list creation is deferred until the actual usage. At initialization time only a ssize_t holding the structure address is passed. As a result, the signature module should be even slightly faster. Task-number: PYSIDE-955 Change-Id: I99faf942a3cca03456928b8aec5e8a4b9924b8b2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Signatures: Add support for PySide2.QtCore.short/ushort/signed charFriedemann Kleint2019-04-161-0/+3
| | | | | | | | | | | | Task-number: PYSIDE-955 Change-Id: I2b4c05281cd44a32257039f62adad89004208b77 Reviewed-by: Christian Tismer <tismer@stackless.com>
| * Cleanup And Simplify the Signature Related CodeChristian Tismer2019-04-167-151/+116
| | | | | | | | | | | | Task-number: PYSIDE-510 Change-Id: I73c441b56a19a0ac836e3598ff6fc8c9ba4d1cd2 Reviewed-by: Christian Tismer <tismer@stackless.com>
| * shiboken: Enable adding call operatorsFriedemann Kleint2019-04-152-14/+28
| | | | | | | | | | | | | | | | | | | | The code parsing the add-function tag would clobber call operators (operator()(...)) since it looked for the first '(' to determine the functions name. Add a check for operator(). Change-Id: I3641f670abc0b24c92b539cfba3d227798e84fae Fixes: PYSIDE-995 Reviewed-by: Christian Tismer <tismer@stackless.com>
| * shiboken: Fix code injection not working for operator functionsFriedemann Kleint2019-04-157-23/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Searching for the function modifications of the operator function by signature failed due to the internally changed signature. Store the function modification list of user-added-functions directly in struct AddedFunction instead of the type entry of the containing class. In AbstractMetaFunction, replace the bool m_userAdded flag by a shared pointer to the AddedFunction and use that to retrieve the modifications (injected code snippets) for the user-added functions instead of searching for them by function signature. Task-number: PYSIDE-995 Change-Id: Ic4d0b257f141a450df26563d33beb397b6209d91 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * shiboken: Pass around struct AddedFunction by QSharedPointerFriedemann Kleint2019-04-156-23/+25
| | | | | | | | | | | | | | | | | | This is a preparatory step for storing it directly in AbstractMetaFunction. Task-number: PYSIDE-995 Change-Id: Ia281bb8d3d94d3d56549ec227a476d9750922323 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * shiboken: Refactor CodeModel::findItem()Friedemann Kleint2019-04-102-32/+30
| | | | | | | | | | | | | | | | | | | | Rewrite it to use a recursion, preparing for having several namespaces of the same name in the scope. Change the scope parameter to be of the ScopeModelItem type to avoid unnessary pointer casts. Change-Id: I9a06ff49d19f93fbc0aefc573544debeb813ef20 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * shiboken: Remove some special handling for QObject'sFriedemann Kleint2019-04-1013-103/+12
| | | | | | | | | | | | | | | | | | | | | | | | For types, QObjects are equivalent to objects, there is no need to differentiate. Remove the code trying to find whether a type is a QObject. Only AbstractMetaClass needs to know whether it inherits QObject. Add a simple check recursing down the base classes. Change-Id: I2365b451c8873f044b06c09b58aff29e2db3c5b7 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * shiboken/meta builder: Remove member m_namespacePrefixFriedemann Kleint2019-04-102-6/+4
| | | | | | | | | | | | | | It is only used for nested namespace names. Change-Id: Id808b6db3b20c861ed3180d6df956f31702afbde Reviewed-by: Christian Tismer <tismer@stackless.com>
| * shiboken/meta builder: Refactor type resolution parseQ_Property()Friedemann Kleint2019-04-101-21/+19
| | | | | | | | | | | | | | | | Use a list instead of splitting and joining repeatedly. Use splitRef() for the tokens. Change-Id: I0519b18126ba828a00aff6e4455c45f682928ca9 Reviewed-by: Christian Tismer <tismer@stackless.com>
| * Automatically Test Small Example With PyInstallerChristian Tismer2019-04-081-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A simple hello.py script was modified for running in PyInstaller and stopping to execute after 2 seconds. The reason is to test that PyInstaller works correctly together with the embedded mode of the signature extension on all platforms. The script did first not work on Windows. This is now solved, after an import in pyside2_config.py is fixed. Currently, there are several configuration errors in COIN. Errors are therefore skipped in the PyInstaller build. The test tests only if the generated script works. Change-Id: I7a1b1e738d523b83cc3fe5beafa7e2579f9c7f48 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * shiboken: Remove member m_currentClass from AbstractMetaBuilderPrivateFriedemann Kleint2019-04-082-108/+98
| | | | | | | | | | | | | | | | Pass the current class as function parameter instead while traversing instead of setting and restoring m_currentClass. Change-Id: I38391dff9a52ff99593c25208e1e2bf7d98d17d6 Reviewed-by: Christian Tismer <tismer@stackless.com>
| * shiboken: Allow for include paths with relative directoriesFriedemann Kleint2019-04-047-15/+71
| | | | | | | | | | | | | | | | | | | | Resolve the absolute file paths of the code model items against the include paths of shiboken to reconstruct the relative paths. Change-Id: Id0f793315b01c0fc65a4cfb26b3372f9c6688872 Fixes: PYSIDE-975 Reviewed-by: Volker Aßmann <volker.assmann@gmail.com> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * shiboken: Remove finding of the current class in metabuilderFriedemann Kleint2019-04-032-35/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | shiboken iterates over the code model items in 2 passes: The first one generates a list of classes, the second one adds the members. In the second pass, the function AbstractMetaBuilderPrivate::currentTraversedClass() was used to find the AbstractMetaClass instance for the code model item by name. This is inefficient and causes problems when extending namespaces. Therefore, replace AbstractMetaBuilderPrivate::currentTraversedClass() by a hash associating the code model items with the AbstractMetaClass instances. Change-Id: I88ea5205d0fde03558db8efb8738632aa3ab6da6 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * shiboken: Search for classes by type entry instead of nameFriedemann Kleint2019-04-033-6/+6
| | | | | | | | | | | | | | | | | | Searching by name is more efficient and has problems when extending namespaces. Search by type entry instead where possible. Change-Id: I131329a6648bb7f0a02cba08a5fbbc0531e0c51f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Friedemann Kleint2019-04-0342-1167/+106
|\| | | | | | | Change-Id: I5e802051b7451d0d39d6fdf63b673ab912f50e77
| * shiboken: Move the Api extractor documentation into shibokenFriedemann Kleint2019-04-0337-1150/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It does not really make sense to have it separately and the reference documentation is currently not accessible from the TOC. Move it over and append it to the TOC. Merge the chapters on ownership chapters (for starters, by simply concatenating). The Api extractor overview chapter is dropped as it is outdated anyways. Partially reverts 0d12d71920067be499d9237b4ad04f7f11047759. Task-number: PYSIDE-363 Change-Id: I02f6b0a4bb91fc54267fa03cefd2ac7d4049f07b Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
| * shiboken: Further refactorings related to the package nameFriedemann Kleint2019-04-023-13/+14
| | | | | | | | | | | | | | | | | | | | | | | | Let Generator::packageName() return the default package name of the type data base instead of storing it in a member variable. Instead, use a member variable for the module name which is derived from it, since it is queried many times. Use the default type system entry instead of searching for it via package name. Change-Id: I171330b3d73d2e3ceac239e4c1c6f130e9f5ee7b Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * ApiExtractor manual: Fix doc warningFriedemann Kleint2019-04-021-1/+1
| | | | | | | | | | | | | | | | Close element, fixing: sources/shiboken2/ApiExtractor/doc/typesystem_specifying_types.rst:356: WARNING: Could not lex literal_block as "xml". Highlighting skipped. Change-Id: Ie0ccfbd3871bfacd3ca45b581071c55bb92e708b Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * shiboken/embedding_generator: Silence warning about leaked fileFriedemann Kleint2019-04-021-0/+1
| | | | | | | | | | | | | | | | Close the temporary file, fixing: sources/shiboken2/libshiboken/embed/embedding_generator.py:241: ResourceWarning: unclosed file <_io.TextIOWrapper name=3 mode='w+' encoding='cp1252'> Change-Id: Idc89853fdca2a2a951e723d4b8840e3ebfb7c06c Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * shiboken: Replace unused typedef referencing QLinkedListFriedemann Kleint2019-04-021-3/+0
| | | | | | | | | | Change-Id: I350bfb27d5f7403edbe3062895df3812728e2290 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Friedemann Kleint2019-04-0223-129/+192
|\| | | | | | | Change-Id: I7fc1857f15ccf5d9667dd6d6adb8208c775c6722
| * shiboken: Refactor AbstractMetaBuilder::classesTopologicalSorted()Friedemann Kleint2019-04-016-70/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change the function parameter to be a list always, making the logic of the inner classes clearer. In the implementation, use a of QHash<AbstractMetaClass*, int> instead of hashing by name, which makes it possible to disambiguate namespaces extended in modules. This also allows for a drastic simplification of the code trying to determine the dependency given by parameter default values. Instead of trying to match by name, correctly qualifying it, the matching can be done by TypeEntry pointers. Change-Id: Ia17bf6e109576bac029fb016e5e11309777d0735 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * shiboken: Replace QLinkedList by a QVector in the Graph classFriedemann Kleint2019-04-015-21/+24
| | | | | | | | | | Change-Id: I4d76a29699867e9d4ff6138cc40fae9b1f519121 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * shiboken: Refactor code declaring and calling the type init functionsFriedemann Kleint2019-03-282-15/+22
| | | | | | | | | | | | | | | | Introduce a function for determining the init function name and simplify the code writing the module wrapper. Change-Id: I818f7a23902f1c9c1ce3cdad3d37dc18403006dd Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * Remove unused imageCristián Maureira-Fredes2019-03-271-0/+0
| | | | | | | | | | | | Change-Id: Iacb9bf179d99816e2d7be08c819c744c689c95d5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * shiboken/Typedatabase: Store type system entries separatelyFriedemann Kleint2019-03-266-21/+38
| | | | | | | | | | | | | | | | | | This makes it easier to access the default type system entry, which will always be the first one in the list. Change-Id: Ie0844cef5fa4f0cd8bc50c28898e54a42845c830 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * Update logoCristian Maureira-Fredes2019-03-262-0/+0
| | | | | | | | | | | | | | | | | | Updating to the new project logo (128x128). optipng was ran on the images: optipng -o 7 -strip all pysidelogo.png Change-Id: I75d0ef76a7fddf957a5095d74c4c836a2c1ebe31 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * shiboken/Documentation: Move brief to top of class documentationFriedemann Kleint2019-03-253-2/+44
| | | | | | | | | | | | | | | | | | | | | | Extract the <brief> element from the WebXML class description and place it at the top with an internal reference (More...) to the detailed description. For this purpose, extend QtXmlToSphinx by a <rst> element to be able to pass through rst elements as is, which might come in handy for other purposes as well. Change-Id: I8e3fd9e3ead99b205afdd5f4be948c0d34336a94 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Friedemann Kleint2019-03-2528-1271/+1773
|\| | | | | | | Change-Id: I799b9e4784722de40e53922f7355ab801b924833
| * Add contextlib to Preloaded Modules for Embedding with Python 2Christian Tismer2019-03-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While developing the embedding for installer support, some functionality was moved from loader.py to signature_bootstrap.py, especially a "with" statement, that needed a contextlib import. When using PyInstaller or cxFreeze, this gave a problem when running in virtualenv and Python 2. We extended the pre-loading to contextlib. It is not completely clear why Python 2 needs that and Python 3 doesn't. The problem did not show up without virtualenv. Perhaps some different installed packages have hidden that problem, because they loaded the contextlib, themselves. This does not happen with a freshly installed virtual environment. Change-Id: I2188cb67129e596f6492d0f5dc9b303a67bfe870 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| * Shiboken: Add "noexcept" to wrapper when wrapped function is noexceptVolker Aßmann2019-03-231-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | The clangparser was already recording the exception specifier for wrapped functions, but the code generator did not transfer the type specifier to the wrapper function. With modern compilers this leads to compile errors as the exception specifier is now part of the type. Noexcept is now added whenever the clangparser determines the source function is noexcept. Change-Id: I1f68981d997fcf4f007569c6d682e3dcf68eca60 Fixes: PYSIDE-977 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * shiboken: Fix a warning introduced by g++ 8 in the generated codeFriedemann Kleint2019-03-211-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | PySide2/QtWidgets/PySide2/QtWidgets/qgraphicsscenehoverevent_wrapper.cpp:95:12: warning: ‘char* strncpy(char*, const char*, size_t)’ output truncated before terminating nul copying 28 bytes from a string of the same length [-Wstringop-truncation] Use the correct length and use memcpy(). Change-Id: I0830cd9b499f2f49a1f3334c2407f877e79738d4 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| * Amend the Embedding Patch for cx_FreezeChristian Tismer2019-03-211-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cx_Freeze has the bug that it copies the "files.dir" folder of shiboken, but does not insert the Python files. As a quick fix, instead of testing only for existence of this directory, we now check for existence of the loader.py file. It can be assumed that all other Python files will be there as well. We could go even further and test-load all files. But then it becomes questionable if we should better always embed. Change-Id: Ib9553941c6a658fb20cb85d22f78431f99d88734 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * Implement Embedding To Make Signatures Always AvailableChristian Tismer2019-03-2017-294/+942
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Situation.. PySide works fine with normal applications. But when installers are used to pack the application together, then the signature extension cannot be loaded. This is a problem that exists since the signature extension was written. But starting with PySide 5.12.1, the signature extension is very visible, because it is used to support the __doc__ attribute. There have beed successful attempts to solve the problem for PyInstaller and Py2App. But there are more packers available, and they all need a change both in PySide and in the packer. Solution.. To solve this problem once and for all, we embed the Python support files in the binary shiboken package. When the Python files are not normally accessible, they are unpacked from a ZIP file. Details.. - The embedded files shall only be used when the normal files are not available, - The signature extension should no longer be lazily loaded. When the application starts, all files should be present. - We drop support for shiboken2.support.signature and use a single, independen folder 'shibokensupport' (proposal). This avoids problems with multiple existence of the shiboken2 folder. PySide2.support.signature remains the official interface, but it's only an alias when PySide2 exists. - The embedding is used when the normal files cannot be loaded for some reason. It can be enforced by a sys variable "pyside_uses_embedding". - Testcase is included. - Tested with PyInstaller on macOS Fixes: PYSIDE-932 Fixes: PYSIDE-942 Change-Id: Iaa62dc0623503a2e0943eedd10d2b2484c65cc2d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>