aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside-tools/deploy_lib/nuitka_helper.py
Commit message (Collapse)AuthorAgeFilesLines
* pyside6-deploy: 3. Rename project folder to project_libJaime Resano2025-01-221-1/+1
| | | | | | | | | | | | | This is a refactor in order to improve the code clarity. In the testing of the pyside6-project command, importlib.import_module is used to import the project_lib folder. Currently, importlib.import_module("project") is ambiguous because it may refer to both the file and the folder. It chooses the folder over the file. Task-number: PYSIDE-1612 Pick-to: 6.8 Change-Id: I8903ea9d2112cf2eb7a68d0e302d3c74edcf2c22 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* pyside6-deploy: 2. Improve deployment of Design Studio projectsJaime Resano2025-01-221-31/+25
| | | | | | | | | | | | 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-2/+1
| | | | | | | | | | 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>
* Desktop Deployment: Disregard more non existent pluginsShyamnath Premnadh2024-12-061-5/+2
| | | | | | | | | | | - 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>
* Desktop Deployment: Upgrade Nuitka to 2.5.1Shyamnath Premnadh2024-11-271-0/+7
| | | | | | | | | | | | | | - 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-5/+1
| | | | | | | | | | | | - 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>
* Deployment: Use include-data-dirShyamnath Premnadh2024-10-151-3/+16
| | | | | | | | | | | | | | | | - Use --include-data-dir to include the QML modules. This would reduce the command length significantly. - Additionally, package all the subdirectories of the application directory. The user may have other relevant resources required by the application eg: images, fonts, etc. - Add two new directories for directories to be ignored - docs and examples. These directories are not required for the application to run. Pick-to: 6.8 Task-number: PYSIDE-1612 Change-Id: I6269f77c0fd94a54e3b7a44f317bc144bd68e5ec Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Deployment: Support Design Studio projectsShyamnath Premnadh2024-10-071-9/+18
| | | | | | | | | | | | | | | | | | - new class 'DesignStudio' to handle Design Studio projects. - Currently uses a way of monkey patching to override the 'main.py' to use 'main_patch.py' which has the same content but with 'app_dir' set to the parent of `main.py``. The reason for doing this is that Nuitka requires the `main.py` to be in the same directory as other resources required for the project. Once the corresponding patch, to alternate between evaluating 'app_dir' based on whether the application is deployed or called through the Python interpreter, is merged then this temporary fix of creating 'main_patch.py' can be removed. - Add tests. Pick-to: 6.7 Change-Id: I79e6572bdbbf4576fbdd9039a4922997a22139f8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Desktop Deployment: Unify API design of Config classShyamnath Premnadh2024-09-021-1/+1
| | | | | | | | | | | | | | - Implements a comment suggestion from 11064d4dcd688db1d54d7273ad700761fabe3f50 - _find_and_set_** methods renamed to _find_** methods. They now return the required property. - Property setters now update the value in the config class as well. This also aligns with the design of certain other properties. - Adjust tests. Task-number: PYSIDE-1612 Pick-to: 6.7 Change-Id: I135d0a64928381a863cbf7235240efc45421324a Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Desktop Deployment: Handle long command lines on WindowsShyamnath Premnadh2024-08-061-0/+43
| | | | | | | | | | | | | | | | | | | | - When the Nuitka command line becomes more than 8191 characters in Windows, the subprocess call fails with the error message "The command line is too long". This patch fixes the issue. - The patch involves moving the contents of the main Python file to an intermediate file called 'deploy_main.py' and modifying the deploy_main.py file to start with '# nuitka_project: <nuitka_option>'. This way, Nuitka picks up the option directly from deploy_main.py rather than the command line. - Add relevant tests to consider the scenario. Pick-to: 6.7 Task-number: PYSIDE-1612 Fixes: PYSIDE-2803 Change-Id: Iacdaa66283cb41dee6df99c9015b4679e299b02e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* deploy: use shlex to split argsCristián Maureira-Fredes2024-07-301-1/+3
| | | | | | | | | Pick-to: 6.7 6.5 6.2 Fixes: PYSIDE-2814 Change-Id: I88aa5ecf6a22808fe5efd2c52fd6675b153da936 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Use modern typing syntaxAdrian Herrmann2024-06-201-4/+3
| | | | | | | | | | | | We can already use the modern typing syntax introduced with Python 3.10 in 3.9 via future statement definitions, even before we raise the minimum Python version to 3.10. Note that direct expressions with "|" don't work yet. Task-number: PYSIDE-2786 Change-Id: Ie36c140fc960328322502ea29cf6868805a7c558 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Python-3.10: Allow the new syntax for Python 3.9Christian Tismer2024-06-201-0/+1
| | | | | | | | Add a future statement to all Python source files. Task-number: PYSIDE-2786 Change-Id: Icd6688c7795a9e16fdcaa829686d57792df27690 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
* Desktop Deployment: Enable Nuitka --standalone modeShyamnath Premnadh2024-06-101-2/+8
| | | | | | | | | | | | | - enables the standalone mode of Nuitka for pyside6-deploy - the mode can be set either through the command line or the config file - adapt tests - update documentation Pick-to: 6.7 Fixes: PYSIDE-2622 Task-number: PYSIDE-1612 Change-Id: I5a10c857d3e79174d2643139eb2e4f7b5e10d955 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Desktop Deployment: ignore .qsb, .webp, .cpp.o and .qen filesShyamnath Premnadh2024-05-211-0/+14
| | | | | | | | | | | | | | | - These files have to be ignored in the deployment process because Nuitka is not able to recognize these file formats and considers them to the dlls instead of data files. - The missing .webp files breaks the usage of BusyIndicator type of QtQuick Controls. Hence, a bug report for that is raised in Nuitka : https://github.com/Nuitka/Nuitka/issues/2854 - Adapt tests Pick-to: 6.7 6.5 Change-Id: Ic4b3b6c65e059ec618a26361caa62b9d7c608690 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Deployment: add permission support and create macOS bundle applicationShyamnath Premnadh2024-03-111-2/+11
| | | | | | | | | | | | | | | | | | - Look at the ast of the python files of the application to identify the permissions used by the application. Once the permissions are identified, pass the necessary NS property list key to be added to the Info.plist file to Nuitka. - For macOS, when deploying create a macOS application bundle (.app) by default. This makes it align more with Apple recommendations and Qt deployment. - Fix tests. - Fix wheel_tester.py to consider .app for macOS. Task-number: PYSIDE-1612 Task-number: PYSIDE-2468 Change-Id: Ie225c9a92c845b432a8e7eaa791a8aeb86ecd988 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Desktop Deployment: Optimize the plugins includedShyamnath Premnadh2024-03-071-2/+31
| | | | | | | | | | | | | | | | - Applications that use certain modules like Multimedia does not work because the plugins for it were not included. However, including all the plugins can make the application executable huge. This patch filters out the necessary plugins by looking at PySide6_Essentials.json and PySide6_Addons.json shipped with the wheels and only bundles these necessary plugins with the application. - Adjust tests. Task-number: PYSIDE-1612 Task-number: PYSIDE-2597 Change-Id: I35c74907a1782ae5101fb7c0861adcb97db5792d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Deployment: Add icon for applicationShyamnath Premnadh2023-12-041-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | - For Android deployment, by default kivy's icon is used when the application is deployed. This patch makes use of PySide icon as the default for all applications created with pyside6-android-deploy. - Icon formats accepted by Nutika windows: .ico macOS: .icns (contains a 128x128 .png file) linux: all standard image formats. We use .jpg - For Desktop deployment - change the option --linux-onefile-icon to --linux-icon. Both are the same. - Add icon options for macOS and Windows. - Adapt deployment test accordingly. - As an addition, add a default value to the --config-file option so that it picks up the one in the project directory automatically, if it exists. It aligns with the desktop deployment tool as per 6337e4a306babdb4015c248a14ad734b320ed2c1 - As another extra, remove an unused typing import from config.py Pick-to: 6.6 Task-number: PYSIDE-1612 Change-Id: Ia67ea96f94ddffe4bc65652f91c8b394c4e56a33 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Deployment: Relative path bug fixShyamnath Premnadh2023-11-231-2/+3
| | | | | | | | | | | | | | | | | | | | - The qml files are identified and stored as relative path and line under consideration tries to do a 'relative_to()' on an absolute path which causes the error ValueError: {qml_file} is not in the subpath of 'project_path' OR one path is relative and the other is absolute. The error only appears on the first run of pyside6-deploy with a project that does not have a .pyproject file. For the subsequent runs, absolute path are used because the path is fetched from the deploy config file. - This patch fixes this error by using absolute path for each qml_file Pick-to: 6.6 6.5 Task-number: PYSIDE-1612 Change-Id: Ib54edded404bd1be87ab5f22f61e2d30416b7dae Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Deployment cleanup: isort and flake8Shyamnath Premnadh2023-10-231-2/+2
| | | | | | | | Task-number: PYSIDE-1612 Pick-to: 6.6 Change-Id: I620582409749b1ce1e36721f1308005c4f6d2828 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* deploy: keep structure of qml filesCristián Maureira-Fredes2023-04-121-1/+5
| | | | | | | | | | | This avoids using the filename without a directory structure as destination directory when include them in the deployed application. Fixes: PYSIDE-2293 Pick-to: 6.5 Change-Id: I9515c6cb63d9008fa95d6749cd6e77d595b276fc Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Deployment: Refactor to enable Android supportShyamnath Premnadh2023-03-291-1/+2
| | | | | | | | | | | | | | | | | | - moving code into functions so that Android can re-use them - new file "deploy_util.py" to store all the common utility functions that can be reused for Android deployment tool - new option "--name" to set the application name - Change some print statements to log statements - Adapt depoyment tests - In default.spec, rename "packages" to "desktop_packages" - Fix relative Qml file error in config.py i.e. it errors when the path is already relative Task-number: PYSIDE-1612 Pick-to: 6.5 Change-Id: Iaaea8837cc362b3cc8035b96247194c4a9679579 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Deploy tool: Reduce QML executable size + testsShyamnath Premnadh2022-12-291-8/+10
| | | | | | | | | | | | | | - Added more Nuitka options to reduce the size of QML executable. Some binaries which cause the QML executable to become heavy eg: QtWebEngine are removed, if they are not used - Add new log messages for --verbose option - Add deploy.pyproject file - Modifies pyside6-deploy tests to consider the QML options, by mocking pyside6-qmlimportscanner Task-number: PYSIDE-1612 Change-Id: Id2e94217e99eedbf41ecfc8de1a37e94c7edaa52 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* deploy tool: return Nuitka command for --dry-runShyamnath Premnadh2022-12-291-1/+2
| | | | | | | | | - In the case of dry_run==True, the initial call returns the Nuitka command being run to the main function Task-number: PYSIDE-1612 Change-Id: I48a6d686346dee691f01911c07901fac7f3af4c2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Rename folder: deploy to deploy_libShyamnath Premnadh2022-12-221-0/+51
| | | | | | | | | | - to distinguish between deploy.py and deploy folder, since both are Python modules. This is especially useful when testing since our tests are located in sources/pyside6/tests/tools. Task-number: PYSIDE-1612 Change-Id: Ideb35b23f454ec64415421e00464cfb1f7055401 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* create pyside-tools2 with qt5 branchChristian Tismer2015-06-101-0/+0
|
* Remap examples and tools submodules from gitorious to githubRoman Lacko2013-08-011-0/+0
|
* Initial commit (copy of lck/pyside-dist repo)Roman Lacko2012-06-041-0/+0