aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix qlocale_test.py to pass after QLocale changeFriedemann Kleint2025-03-241-1/+1
| | | | | | | | | | | Floating point output now uses lower case after qtbase/05c8a48612be38a3c50bb5ed9daf1adfc221b9f2. Task-number: QTBUG-134785 Task-number: QTBUG-134768 Pick-to: 6.9 6.8 6.5 Change-Id: If6c6463b3828374a2399f6bd9d26cafebc6edaf1 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Deployment Test: Remove modules for windows win_arm64Shyamnath Premnadh2025-03-151-0/+14
| | | | | | | Pick-to: 6.8 Task-number: PYSIDE-1612 Change-Id: Iac8406d6e49c83c8f5aa1be757cf4c7fbfcf01bc Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* tests: Fix warning about QBackingStore::flush() being called without handleFriedemann Kleint2025-03-142-13/+21
| | | | | | | | | | | Call qApp->quit() delayed from the paint event. This fixes crashes on macOS and warnings: QBackingStore::flush() called for QWidgetWindow(0x600003a22460, name="MyWidgetClassWindow") which does not have a handle. Pick-to: 6.8 Change-Id: I2e5d8aa1cfc36c4c247f681b4219f52c1a618737 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Make Remote Objects usable beyond ModelsBrett Stottlemyer2025-03-139-1/+1016
| | | | | | | | | | | | While present, the Qt Remote Objects bindings to Python have not been very useful. The only usable components were those based on QAbstractItemModel, due to the lack of a way to interpret .rep files from Python. This addresses that limitation. Fixes: PYSIDE-862 Change-Id: Ice57c0c64f11c3c7e74d50ce3c48617bd9b422a3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Brett Stottlemyer <brett.stottlemyer@gmail.com>
* pyproject.toml: 3. Add pyside6-project tests for pyproject.toml changesJaime Resano2025-03-1226-56/+525
| | | | | | | | | | | | This patch adds tests for the pyside6-project CLI tool to validate the pyproject.toml changes. The tests ensure that the existing behavior is preserved and that the new features work as expected. Task-number: PYSIDE-2714 Change-Id: I096188c1d6d931a3970787f2906b83d2a987f4ed Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* pyproject.toml: 2. Add pyproject.toml support for pyside6 toolsJaime Resano2025-03-121-3/+3
| | | | | | | | | | | | | | | | | This patch adds support for pyproject.toml files to the pyside6-project tool. A new command argument is added to migrate a .pyproject JSON file to the new pyproject.toml file: `pyside6-project migrate-pyproject` The new features are tested and it is guaranteed that the current behavior is preserved. A new flag is added to the project creation operations, "--legacy-pyproject", in order to generate a .pyproject file instead of a pyproject.toml file. Note that the tomlkit library is added to the requirements.txt file. https://github.com/python-poetry/tomlkit Task-number: PYSIDE-2714 Change-Id: If33956dea73b79df0a52d4dcda3934c85e57182d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* pyproject.toml: 1. Refactor pyside6-projectJaime Resano2025-03-121-8/+10
| | | | | | | | | | | | This patch refactors the code of the pyside6-project tool to simplify the upcoming change of the project file format, pyproject.toml. The CLI tool documentation is also improved. Task-number: PYSIDE-2714 Change-Id: I010bbb58f3ed8be5ad5f38687f36b4641a4a021d Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Refactor pyside6-deployJaime Resano2025-03-111-42/+51
| | | | | | | | This patch cleans up the pyside6-deploy tool code. Adds some type hints and fixes some casing consistency issues. Change-Id: I16988ebf8a15bd3d2bfd12366ebacb3ffe4001e2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* type hints: Print erroneous PYI files, but only if COIN is presentChristian Tismer2025-02-281-1/+1
| | | | | | | | | It turned out to be boring if the PYI files are printed locally. Task-number: PYSIDE-3012 Change-Id: Ic47e1828367c1f00c263451a6090cb5e03313103 Pick-to: 6.8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix connecting signals by QMetaMethodFriedemann Kleint2025-02-281-0/+19
| | | | | | | | | | | The old implementation was calling the string-based overload, but did not add the '1'/'2' markers added by SIGNAL/SLOT. Call the QObject overload directly. Fixes: PYSIDE-1277 Pick-to: 6.8 Change-Id: I912f46c33959b622301b0a75e771057c8874f7e3 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* type hints: Print erroneous PYI files for COIN support (cleanup)Christian Tismer2025-02-271-1/+0
| | | | | | | | | Reason: We cannot find an error which happens in CI on Windows 11, only Task-number: PYSIDE-3012 Change-Id: I99a2d72e49027cc76767c70bdc94d8d3f6451782 Pick-to: 6.8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* type hints: Print erroneous PYI files for COIN supportChristian Tismer2025-02-251-1/+21
| | | | | | | | | Reason: We cannot find an error which happens in CI on Windows 11, only Task-number: PYSIDE-3012 Change-Id: I8f2e4c56ee8c81e8d3b348c624be5df80d5df275 Pick-to: 6.8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix QCanDbcFileParser parse function overloadsEce Cinucen2025-02-204-1/+58
| | | | | | | | | | | Add the overload-number attribute to parse function to execute first QString check and then QStringList. Test for parser added. Fixes: PYSIDE-3017 Pick-to: 6.8 Change-Id: I7e5a02fec50405bc3d71c5662a7909d34f4d20df Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* type hints: Make the error messages more verboseChristian Tismer2025-02-201-1/+1
| | | | | | | | | | | | | The --pretty switch shows a little context. If that does not help, we will have to send the whole PYI file back from CI. Task-number: PYSIDE-2846 Task-number: PYSIDE-3012 Change-Id: I45a4111c6ea78bf6c487077c43eb37b946602ec8 Pick-to: 6.8 Reviewed-by: Ece Cinucen <ece.cinucen@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix disconnecting a string-based connection by passing a callableFriedemann Kleint2025-02-201-8/+60
| | | | | | | | | | | | Amends cab304e70cce68bbdaa70d7f7b2bf6e95e85e6d2. Restructure the test. Pick-to: 6.8 Fixes: PYSIDE-3020 Task-number: PYSIDE-1057 Change-Id: I8954a534648ded5d476fec608d0699132a026461 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix overriding QPaintEngine virtual functions taking a C-style array of ↵Friedemann Kleint2025-02-191-0/+86
| | | | | | | | | | | | | | | | | | geometry primitives Add argument conversions PySequence<->C-style array, modelled after QGraphicsView::drawItems(). Move some templates around to the common template file and add generic conversions for lists of value types. [ChangeLog][PySide6] The virtual functions of QPaintEngine taking a C-style array of geometry primitives have been fixed. Fixes: PYSIDE-3002 Pick-to: 6.8 Change-Id: Ife8fed0e17c79091f25f57bf97bcca438452e177 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* binary size: Improve the benchmark toolChristian Tismer2025-02-171-18/+29
| | | | | | | | | | | | | | | | | | The benchmark tool now uses per default the limited API but is becoming more flexible. This will take some more checkins until it comes to convergence. The starting point stays 2025-01-27 right before a substantial change which is otherwise not measurable. The switchable size reductions will slowly vanish. The difference approach makes then no longer sense, and the --absolute switch will become the default and vanish. Task-number: PYSIDE-2701 Change-Id: I990ef26860924c10784a70ec74a2a318b4be7d41 Pick-to: 6.8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* PySide6: Add QFont.Tag(str), QFont.Tag.fromString(), QFont.Tag.fromValue()Friedemann Kleint2025-02-131-0/+5
| | | | | | | | | | The constructor is a non-type template that checks the string length. Add a function for it. Pick-to: 6.8 Fixes: PYSIDE-3013 Change-Id: I35626c29edddf38c04c5b913a35b36c540c45d6a Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix crash of signals with object-type parameter being passed by const-refFriedemann Kleint2025-02-113-0/+21
| | | | | | | | | Add a further indirection in callPythonMetaMethodHelper() when only a pointer conversion is available for a const-ref parameter. Task-number: PYSIDE-3004 Change-Id: I6ec7c5a9d4d30c8e4973ec79534d5f3eb3bf8204 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* binary size: Update the benchmark tool to absolute measurementChristian Tismer2025-02-071-9/+26
| | | | | | | | | | | | | | | | | | After sizebench.py was used successfully on relative changes (with a disable switch in the code), we now add an absolute mode. This way, we can stop to support switching. The starting point is 2025-01-27 right before a substantial change which is otherwise not measurable. The new mode is activated with --absolute / -a It works much faster since it compares against a constant. Task-number: PYSIDE-2701 Change-Id: I341a23722a304473e92f8ef38c6d16b3b69a8a92 Pick-to: 6.8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* pyside6-deploy: 5. Add Design Studio project example and testsJaime Resano2025-01-2315-0/+361
| | | | | | | | | | - Add an example of a mock Design Studio project - Add tests for pyside6-project CLI tool Task-number: PYSIDE-1612 Pick-to: 6.8 Change-Id: Ida3e469a4d2dab2fa4d8a2e473242faf1716b075 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* pyside6-deploy: 2. Improve deployment of Design Studio projectsJaime Resano2025-01-221-10/+10
| | | | | | | | | | | | Design Studio projects will specify the resources employed by the project in the .qrc file. This way, the deployment process is way simpler since all the file dependencies are stored compiled in a .py file. Task-number: PYSIDE-1612 Change-Id: Icc0047e9f9c183a4db51052a84743e5b095ec76a Pick-to: 6.8 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* pyside6-deploy: 1. Minor refactoringJaime Resano2025-01-211-1/+2
| | | | | | | | | | Just adding some type hints and a bit of code cleanup None of the existing logic should be affected by this change. Task-number: PYSIDE-1612 Pick-to: 6.8 Change-Id: I42175426a03dc463b8da82aa560c3f13ab842392 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Android Deployment: Auto download Android NDKShyamnath Premnadh2025-01-021-4/+46
| | | | | | | | | | | | | | | | | | | | | | | | - In order to prevent code duplication, a symlink to tools/cross_compile_android/android_utilities.py is created under sources/pyside-tools/deploy_lib/android. When running the script sources/pyside-tools/android_deploy.py, this works without any issues. When packaging the tools, the symlink is resolved into the actual file and the actual file is packaged into the wheels. - Remove global variable to __init__.py and remove the ones that are not used - Add tqdm to requirements.txt - Adapt tests - Additionally, include several new test cases to cover error scenarios more comprehensively Pick-to: 6.8 Task-number: PYSIDE-1612 Change-Id: I74728be30a2b8214b9a379b0b906fdacbb105833 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* PySide6/Tests: Use fully qualified enumerationsFriedemann Kleint2024-12-20113-403/+440
| | | | | | | | | As a drive-by fix flake errors. Pick-to: 6.8 Task-number: PYSIDE-1735 Change-Id: I9829b011fee78fc8edd1aefdd3066ae89e63644b Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* qpixmap_test.py: Fix warning about leaking file handleFriedemann Kleint2024-12-201-2/+8
| | | | | | | | | | | | | Port to pathlib, fixing: sources/pyside6/tests/QtGui/qpixmap_test.py:42: ResourceWarning: unclosed file <_io.BufferedReader name='/data0/frkleint/pyside-setup6i/sources/pyside6/tests/QtGui/sample.png'> data = open(os.path.join(os.path.dirname(__file__), 'sample.png'), 'rb').read() ResourceWarning: Enable tracemalloc to get the object allocation traceback Pick-to: 6.8 Change-Id: I8417719eb150aae9e04b5ff706e3934b398e7381 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* sizebench: adapt classifiers on testCristián Maureira-Fredes2024-12-181-2/+2
| | | | | | | | | | the python classifiers were removed in c5880ced5b6cfc7a07af9d4e7079af563ceae089 so the test will fail. Change-Id: I58033f387bcebed76ca8b1bba18cc991975338d1 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Remove unnecessary use of 'object' in class constructionremoteobjectsdevCristián Maureira-Fredes2024-12-1818-24/+26
| | | | | | | | | | | Considering we are not compatible with Python 2 anymore, we can drop the 'object' explicit inheritance in the class declaration. Pick-to: 6.8 Change-Id: Iac3a95aa9721c3ff1a755f457c0936ca157a8470 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix some flake8 errors in tests/examplesFriedemann Kleint2024-12-1729-46/+48
| | | | | | | | As unearthed by the whitespace change. Pick-to: 6.8 Change-Id: I58c1a38c3c4a9c91719131d7950950ddf475872b Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PySide: Add WebView for macOSShyamnath Premnadh2024-12-173-3/+40
| | | | | | | | | - caused by wrong condition check in 83603fed574fc7b0eed452b347170862b12a98f6 Pick-to: 6.8 Fixes: PYSIDE-2964 Change-Id: I1b5c441cd7448898e44f8d829b91202e68168666 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* libpyside/ PySideSignal: Fix a memory leak connecting to signalsFriedemann Kleint2024-12-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Change dc7acd1f2dc750c3c8602203ae1558b0e60a3c17 added a reference to signal senders not created in Python to fix a crash when doing something like: QAbstractItemView.selectionModel().currentChanged.connect(...) In addition, the code kept a weakref on the sender and tracked its deletion. To simplify this, keep a tracking QPointer on the sender QObject and its PyTypeObject * instead of a PyObject * . This also allows for calling QObject::connect() and other helpers directly instead of using PyObject_CallObject() on the PyObject * to forward the calls. Fixes: PYSIDE-2793 Fixes: PYSIDE-1057 Task-number: PYSIDE-79 Change-Id: I1ce6f4c35c819f3e815161788cdef964ffc6fd96 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Fix trailing empty linesFriedemann Kleint2024-12-1382-87/+0
| | | | | | Pick-to: 6.8 Change-Id: I1a5964463f703ade0657816cb974206355a5ae5b Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* tests: handle unused imports and fix type issuesCristián Maureira-Fredes2024-12-12103-306/+233
| | | | | | | | | | Many modules were imported but unused in our tests. Additionally, some type hint issues were solved. Pick-to: 6.8 Change-Id: Ic2368690e9a6ce0fffea812206185aa4f3dc3c58 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Desktop Deployment: Add more testsShyamnath Premnadh2024-12-091-0/+49
| | | | | | | | | | | | | - Added tests for extra modules and directories to ignore. These are cli options. - Fixed an issue where updating a Python set was not functioning correctly. Task-number: PYSIDE-2945 Pick-to: 6.8 Change-Id: Ia6b0e9ef98e2e0999bc4782168b3889598cca682 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Desktop Deployment: Disregard more non existent pluginsShyamnath Premnadh2024-12-061-8/+6
| | | | | | | | | | | - Amends 05b3c28099c1eaff74bba8b06004cc8205b24f45 - Also, ignores 'scenegraph' and 'networkaccess' Pick-to: 6.8 Task-number: PYSIDE-1612 Change-Id: Ibc1a0ea1525f7d56ed884bc652612d8985479258 Reviewed-by: Jaime Resano <Jaime.RESANO-AISA@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Raise Python version to 3.8Friedemann Kleint2024-12-032-14/+0
| | | | | | | | | | | | | | Fix some oversights of previous changes: - Bump limited API - Fix CMake files - Remove outdated version checks from Python code - Adapt some documentation Pick-to: 6.8 Task-number: PYSIDE-2943 Change-Id: Id8d9c4c6bb0629948de28beb3c4274991f84ff08 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix flake 8 errors in utility scriptsFriedemann Kleint2024-12-031-15/+15
| | | | | | | Pick-to: 6.8 Task-number: PYSIDE-2943 Change-Id: Iaf02a21112e3d8b89fa6396481afd584a14bd952 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Desktop Deployment: Upgrade Nuitka to 2.5.1Shyamnath Premnadh2024-11-271-13/+13
| | | | | | | | | | | | | | - Nuitka 2.5.1 imposes strict checking for the Qt plugins included through the --include-qt-plugins option by checking if the plugin actually exists in PySide6 installation. Consequently, the plugins "accessiblebridge", and "platforms/darwin" which are not required by Nuitka are removed from the list of plugins to be included. - Adapt tests. Pick-to: 6.8 Task-number: PYSIDE-1612 Change-Id: I89cef4acf102e01c229b1dd6063fc08903ea686d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Deployment: Support .webp filesShyamnath Premnadh2024-11-261-3/+3
| | | | | | | | | | | | - Ignoring .webp files are not needed in the newer Nuitka version. - Additionally, also adds a comment differentiating between the `plugins` fields used in the deployment configuration file. - Adapt tests. Pick-to: 6.8 Task-number: PYSIDE-1612 Change-Id: Ibbaab03021fa50e4777caa346a2c128fd5e1a06c Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PyPySide: Fix a garbage collector problem in a new testChristian Tismer2024-11-251-3/+7
| | | | | | | Change-Id: I82f38a1ec06b922e8554d7aac8969cf945e338ba Task-number: PYSIDE-535 Pick-to: 6.8 6.7 6.5 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PySide: Add numpy support for QtGraphsEce Cinucen2024-11-144-2/+55
| | | | | | | | | | | Added appendNp and replaceNp Added test for appendNp and replaceNp Added the missing file "qcharts_numpy_test.py" to QtCharts .pyproject Pick-to: 6.8 6.8.1 6.5 Change-Id: I55aeba0fd117a8a82c3f69e18a50358936610af9 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* type hints: add __hash__, fix __copy__, __repr__ and __dir__Christian Tismer2024-11-081-1/+3
| | | | | | | | | | | | | | | The other missing things are sequence and mapping methods which need some more support from cppgenerator. Will be added later. typing.Self is only known since Python 3.11 . We emulate that by patching it into typing and adjusting the Python version for mypy. Task-number: PYSIDE-2846 Change-Id: Icb1060c7bba355061d8f134c8e76fb14369d7dda Pick-to: 6.8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Remove traces of Python 2: tests and flake fixesCristián Maureira-Fredes2024-11-057-72/+58
| | | | | | | | | Addressing a few comments from tests that were related to the Python 2 compatibility. Pick-to: 6.8 Change-Id: I88c614549cfb91f879fe3e0d82a6988362e0ce19 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* type hints: Make the mypy cache more permanent, amendedChristian Tismer2024-11-041-1/+9
| | | | | | | | | | | | | It turned out that mypy is not loaded by COIN tests when requirements_coin.txt is used. Also enforce mypy existence in COIN to prevent further configuration errors. As a drive-by, a new cache is used that is > 10% faster. Task-number: PYSIDE-2846 Change-Id: I75a27cfd0cb0fb0d7cd44c2a121291af052b0d8f Pick-to: 6.8 6.8.0 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* setup: fix PySide6.__all__ after the wheel split, amendment 3Christian Tismer2024-11-011-2/+10
| | | | | | | | | | | | | | | | | | | | The __all__ support for the PySide6 module works just fine. But there is a last incompatibility that might strike others as it did hit ourselves when using PySide6.__dict["__all__"]: Use a derived dict type and define a __missing__ attribute. Derive further a module type, then it works without problems. A little support function in Shiboken allows to replace the dict of PySide6 with this derived type. amends 703d975f16aff95bc9014a2689a3ae824b5a552f. Pick-to: 6.8 Task-number: PYSIDE-2895 Task-number: PYSIDE-1890 Change-Id: I018228116a5fdd1401c1ebd42ceb886f6829deeb Reviewed-by: Christian Tismer <tismer@stackless.com>
* type hints: Make the mypy cache more permanentChristian Tismer2024-11-011-1/+12
| | | | | | | | | | | | | | By default, mypy stores its cache data in $(pwd)/.mypy_cache . It is better to save it in the pyside_setup folder under a version specific name. This makes the cache survive full rebuilds. We tested that this folder is really writable. Task-number: PYSIDE-2846 Change-Id: I739e74cb24b5aaa1b2b457195e8a143b56a2bc44 Pick-to: 6.8 6.8.0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Lazy Init: Support Lazy Subtypes in star imports, amendment 2Christian Tismer2024-10-211-5/+9
| | | | | | | | | | | | | | After addition of subtypes support, filtering is necessary to exclude subtypes from resolving. Deleting the subtype was a bad idea with an unordered_map. Better is to use a list of names to resolve. Task-number: PYSIDE-2404 Change-Id: Ide5b13fbd37bab44881a25d4466ec30c89cd9918 Fixes: PYSIDE-2898 Pick-to: 6.8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* type hints: Install a permanent test for error-free pyi filesChristian Tismer2024-10-172-0/+48
| | | | | | | | | | | | | | | | | Testing Mypy on the whole project costs some time, about 33 s on a Mac Studio Max M1 in debug mode. On CI with release Windows, this is about 8 sec. An option "--skip-mypy-test" is added to save time. The mypy tool is only enforced to exist in COIN. Otherwise it is optional. Task-number: PYSIDE-2846 Change-Id: Ibbabbf6b893537ac923fbbaba9ff832ebd675a21 Fixes: PYSIDE-2672 Fixes: PYSIDE-2886 Pick-to: 6.8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* type hints: Evaluate multiple signatures and Union ExpressionsChristian Tismer2024-10-171-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | The multiple signatures suffer from the problem that many are reported as error, because one larger type is evaluated before another type. An Example: PySide6.QtCore.QCborSimpleType is shadowed by int when int is listed first. That is due to the mro: int.mro() [<class 'int'>, <class 'object'>] QCborSimpleType.mro() [<enum 'QCborSimpleType'>, <enum 'IntEnum'>, <class 'int'>, <enum 'ReprEnum'>, <enum 'Enum'>, <class 'object'>] We are implementing a topological sort by mro length that puts the list into the right order. Result is from 226 down to 30. Change-Id: I155e2169c3c8ab4afd5b7bb8f3411ccf6467d440 Task-number: PYSIDE-2846 Fixes: PYSIDE-2687 Fixes: PYSIDE-2886 Pick-to: 6.8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Lazy Init: Support Lazy Subtypes, amendedChristian Tismer2024-10-142-4/+6
| | | | | | | | | | | | | | | The addition of nested types made it necessary to filter subtypes out of resolveLazyClasses because incarnateType should be called for toplevel types, only. Added a star test to pyenum_relax_options_test.py to test this case without using extra time. Task-number: PYSIDE-2404 Change-Id: I4b95c0f65c055376defb6a8e9ea888285c82a8e2 Fixes: PYSIDE-2888 Pick-to: 6.8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>