aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/shibokenmodule/files.dir
Commit message (Collapse)AuthorAgeFilesLines
* shiboken: Fix pyi generation for external modulesAndreas Beckermann2019-10-251-5/+0
| | | | | | | | | | | | | | | enum_sig.py is used to generate .pyi files (in sources/pyside2/PySide2/support/generate_pyi.py) from the bindings. The file can also be useful by external modules that were generated by shiboken, however the check for the modulename being PySide2 or shiboken2 prevents this. Remove this check, as discussed on IRC. This seems to be working internally as well and re-adds support for usages by external modules. Change-Id: I81af943c43f8f84aa0b0d89260cd99215acdb10d Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken: Fix handling of modified default expressionsFriedemann Kleint2019-10-041-1/+2
| | | | | | | | | | - Do not try to resolve modified default expressions (add enumeration scopes or similar) - Fix the signature parser to handle arbitrary expressions Fixes: PYSIDE-1095 Change-Id: I059c3a1f066687d7c2f0dad9ea7f0d93e292b1b5 Reviewed-by: Christian Tismer <tismer@stackless.com>
* signature: Support typing.Optional[T] and refine a bitChristian Tismer2019-08-295-46/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The signature was missing "typing.Optional[T]" which has to be wrapped around any argument with a default value of "None". This is the only case where the repr of a type looks different than it was written, because it renders as "typing.Union[T, NoneType]". Solving that by redefining a few typing structures was way too hard and too error prone. It was finally solved by a regex replacemet that is run as a post process in generate_pyi.py . The enumerations are now even more complete, since toplevel enums are also included. This had the effect that enums with Python keywords were revealed, and so the function "createEnumItem" had to be modified. The order of creation was also changed to avoid name clashes. The overall structure was improved, and instead of parsing the generated signatures to find out if something is a class method, this is now very cleanly implemented as an inquiry to get_signature(). I tried to make sense of the flags structure that comes with many enums. PyQt5 has a standard set of "__...__" methods without useful signature information. I could mimick that as well, but that would create a whole lot of pointless extra information. We should decide later if it makes sense to include that. Right now the flags structures show the class name, only. This patch will be merged with the 5.14 branch. The additions of this patch could fortunately be placed into areas which do almost not overlap with the 5.14 signature additions. Change-Id: Ie513e15917b04d746ab597fb7a9eb1fd766f7c73 Fixes: PYSIDE-1079 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix a typing bug in Python 2.7 and updateChristian Tismer2019-08-222-94/+431
| | | | | | | | | | | | | | | | | The typing module has problems if it exists twice. This gave trouble with matplotlib, when typing was imported and then called PySide indirectly. The only reliable cure appears to be to use the typing module if it is already in sys.modules . The typing27 modue was updated to the latest version of https://github.com/python/typing (original file with additional license headers). Fixes: PYSIDE-1073 Change-Id: Iebfdfe7fd51080a9334db332719928c001501381 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add QtCore.Slot.__signature__ and much more manuallyChristian Tismer2019-08-214-17/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The signature of QtCore.Slot and other classes could not automatically be generated because the function is not generated by cppgenerator.cpp . We add it manually in the C++ code into the generation process. The case of QtCore.Slot had diverse follow-up issues to be solved: - Classes which did not inherit from Shiboken were not generated. This is a long-standing omission and creates very many new simple types. - The arity of Slot has default arguments after the varargs parameter "*types". This needed an extended Python parser analysis that fixes the arguments given to the inspect module, accordingly. - The signature generation was completely new implemented and relies no longer on the restricted syntax of a Python (2) function but generates signatures directly as Parameter instances. Implemented classes with hand-made signatures: QtCore.ClassInfo QtCore.MetaFunction, QtCore.MetaSignal QtCore.Property QtCore.Signal QtCore.SignalInstance QtCore.Slot QtQml.ListProperty QtQml.VolatileBool As a side effect, many more subtypes were published. Enums are done, which concludes this work. Fixes: PYSIDE-945 Fixes: PYSIDE-1052 Change-Id: Ic09f02ece3a90325519e42e4e39719beb0c27ae9 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Fix RuntimeError: dictionary changed size during iterationJulien Schueller2019-07-191-1/+1
| | | | | | | | Seems the dictionary of modules needs to be copied before iterating Fixes https://github.com/spyder-ide/qtpy/issues/195 Change-Id: I8517e031c4a250856d3318b364b1cd5dab3f8f80 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Cleanup signature module before substantial changeChristian Tismer2019-07-175-276/+434
| | | | | | | | | | | | | | | | | | | | | | There were some refinements applied while developing "Support Pointer Primitive Types by Arrays or Result Tuples". This patch moves these changes out which are not essential for that patch. They include - sort all mapping groups by name - replace huge regex by a pattern generator - replace dictionary string entries by SimpleNameSpace - improve PEP 563 handling - simplify "zero(sometype)" substantially - better handling of "QGenericMatrix" (preview) A test for the generated pattern against a reference parser was added. Task-number: PYSIDE-795 Task-number: PYSIDE-951 Change-Id: I5a6b236850c63a7db77b7f7b88881486fd1e61be Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Signature: Try to recognize unknown modules in errorhandler.pyChristian Tismer2019-05-301-52/+42
| | | | | | | | | | | | There were unknown modules built with shiboken which mapping.py did not recognize. This is too restrictive, since we can import this module and try to produce something useful. This was rewritten to respect every binary module in sys.modules . Change-Id: I6626c69f002c307bae3eb78a557d1a7309983324 Fixes: PYSIDE-1009 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Ensure that signature strings never overflow againChristian Tismer2019-04-161-10/+4
| | | | | | | | | | | | | | | | | | | | 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-161-1/+0
| | | | | | Task-number: PYSIDE-510 Change-Id: I73c441b56a19a0ac836e3598ff6fc8c9ba4d1cd2 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Implement Embedding To Make Signatures Always AvailableChristian Tismer2019-03-209-171/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Simplify Python Imports For EmbeddingChristian Tismer2019-03-2014-0/+5266
| | | | | | | | | | | | | | | | | | | | | | After the project split, shiboken exposed its own modules, and the overall structure with shiboken2.support.signature and PySide2.support.signature was already quite complicated. When introducing embedding, it is necessary to have some support folder that gets unpacked from a zipfile. That means, the shiboken2 root directory would be in the zip file in the embedding case. This does not only increase the complexity, it further means that we must make shiboken2.so available in the shiboken2 containing zipfile! In order to avoid that, we stop the dependency from the two support directories and use shibokensupport, instead. The simplification of the loader and other modules is also significant. Task-number: PYSIDE-510 Change-Id: Ic735a8d36f10f03698378f2ac9685a5955e40b0c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* remove pyside2 and shiboken2 submodules (dev edition)Oswald Buddenhagen2017-05-221-25/+0
| | | | to be replaced by a subtree merge.
* update: bring repositories back in syncChristian Tismer2017-02-151-15/+21
| | | | | | | From time to time, it is good to update the master project. Change-Id: I50c45caf7c37ebb4ea865b4e4f5896e5cd8915fd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Update the pyside-setup submodulesChristian Tismer2016-12-121-15/+15
| | | | | | | | | | From time to time, submodules need to be updated. Actually, I would even like to update the master module after every submodule checkin, but this seems to be not easy to do all the time. Change-Id: I52f266c58086186df05ddcc85085f35e2e28ead7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix OS/X inclusion of framework headers.Alexandru Croitor2016-06-161-6/+16
| | | | | | | | | | | | | | | | | | | | | The recent change that made use of framework headers on OS/X did not work with homebrew Qt, and it didn't work with official builds either, because neither of the chosen include folders contained all the necessary headers to lead to a successful build. Fortunately shiboken actually supports being passed multiple include locations, separated by a colon on OS/X, and a semicolon on Windows. This patch makes sure to always pass the Qt include folder, and in case if the Qt build is a framework build, also passes the root frameworks location, with headers found by shiboken under frameworkName.framewework/Headers. This works for homebrew builds, official builds and custom non-installed prefix / in-source builds of Qt. Change-Id: I47b24e197839883de2ab873461efc1f4d4d33743 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add option to link with libc++ on older OSX versions.Alexandru Croitor2016-05-111-5/+8
| | | | | | | | | | | | | | Versions of OSX lower than 10.9 link libstdc++ by default. Also libstdc++ is linked when the osx minimum deployment target is lower than 10.9. The new option allows explicitly linking libc++ in the cases mentioned above. It is not enabled by default, because most libraries and executables on versions lower than 10.9 are compiled with libstdc++, and mixing standard library versions can lead to crashes. Change-Id: I7397d2bbce2cfceaeb848f25e0bbf1a24ac9bde8 Reviewed-by: Christian Tismer <tismer@stackless.com>
* a quick shiboken fix that should work, but will become obsolete with Qt 5.6.1Christian Tismer2016-04-191-11/+5
|
* fix the name pyside2uicChristian Tismer2016-04-191-5/+11
| | | | This was modified, but not corrected in setup.py
* UpdateThomas-Karl Pietrowski2016-04-021-5/+5
|
* shiboken should build with tests.Christian Tismer2016-02-231-8/+5
| | | | We will see how travis works now.
* updateChristian Tismer2015-12-291-8/+7
|
* updateChristian Tismer2015-12-281-7/+8
|
* fixing debug builds on windows.Christian Tismer2015-11-121-9/+7
| | | | | How on earth did people debug without debug builds? This must have been wrong before the move to Qt5.
* merge the new signal supportChristian Tismer2015-11-071-5/+10
|
* updateChristian Tismer2015-10-241-8/+5
|
* Merge pull request #9 from thopiekar/cmake-workChristian Tismer2015-09-281-7/+7
| | | | Fix for empty PYTHON*_VERSION_* variables
* Merge pull request #8 from thopiekar/cmake-workChristian Tismer2015-09-281-7/+7
| | | | Quick fix for last PR.
* sub-reposChristian Tismer2015-09-281-7/+7
|
* )small fixes (right wiki, name changesChristian Tismer2015-09-251-5/+8
|
* change all scripts to respect the new PySide2 module name.Christian Tismer2015-09-211-9/+5
| | | | still, there seem to be errors....
* not-so-small fix to the huge change.Christian Tismer2015-09-211-13/+8
| | | | | | I just understood what is needed to define a package: The files PySide2Config(...).cmake are crucial, the project names have little to do with that.
* huge change on project layout.Christian Tismer2015-09-211-7/+13
| | | | | | | | | | | The intention is to have PySide2 and Shiboken2 as project names, to allow for co-existence of PySide and PySide2. This is the first version that builds with these settings on OS X: $ python3 setup.py build --debug --no-examples --ignore-git --qmake=/usr/local/Cellar/qt5/5.5.0/bin/qmake --jobs=9 This is not yet tested.
* fix the repos names in setup.pyChristian Tismer2015-09-201-5/+8
|
* add/extend README.md files and add pyside2.wiki.git as a sub-repo of ↵Christian Tismer2015-09-201-13/+5
| | | | pyside2-setup.
* updateChristian Tismer2015-09-191-6/+12
|
* update sub-reposChristian Tismer2015-09-181-5/+7
|
* simplify the project structure. "qt5" is replaced by "master".Christian Tismer2015-09-171-5/+5
|\ | | | | | | For the old qt4 version, the old repository should be used.
| * small update to state that the docs are still from 4.8Christian Tismer2015-09-151-6/+17
| |
| * update sub-reposChristian Tismer2015-08-161-5/+7
| |
| * be more forgiving when file trees cannot be removed (happens often during ↵Christian Tismer2015-08-161-6/+5
| | | | | | | | window debugging)
| * update sub-reposChristian Tismer2015-07-271-7/+6
| |
| * update sub-reposChristian Tismer2015-07-211-7/+6
| |
| * update sub-reposChristian Tismer2015-07-191-12/+7
| |
| * update sub-reposChristian Tismer2015-07-081-5/+13
| |
| * transition to pyside-examples2Christian Tismer2015-07-051-5/+5
| |
| * adjust sub reposChristian Tismer2015-06-271-5/+5
|/
* update soubrettes and ignore a local folder 'explore2' with some cmake ↵Christian Tismer2015-06-171-5/+5
| | | | exploration
* update submodulesChristian Tismer2015-06-141-5/+5
|