aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside-tools/deploy_lib/__init__.py
Commit message (Collapse)AuthorAgeFilesLines
* pyside6-deploy: 2. Improve deployment of Design Studio projectsJaime Resano2025-01-221-1/+0
| | | | | | | | | | | | 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>
* Desktop Deployment: Disregard more non existent pluginsShyamnath Premnadh2024-12-061-0/+4
| | | | | | | | | | | - 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>
* Avoid including dev folders in deployed executableJaime Resano2024-11-201-2/+2
| | | | | | | | | | | The .git, __pycache__ and .vscode folders should not be included in the deployed executable. Windows, it causes permission errors when the cleanup is performed Pick-to: 6.8 Task-number: PYSIDE-1612 Change-Id: Icfcbe6aa0d3cb2b869a0bb9a68dbe8d1e1d9a5ec Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Deployment: Use include-data-dirShyamnath Premnadh2024-10-151-1/+2
| | | | | | | | | | | | | | | | - 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-0/+1
| | | | | | | | | | | | | | | | | | - 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: Ignore directoriesShyamnath Premnadh2024-07-081-0/+2
| | | | | | | | | | | | | | | | - Among the directories ".qtcreator", "site-packages", "deployment" etc were excluded when finding the QML files and the Python files in the project. - Simplify find_and_set_qml_files(self) function by removing the unnecessary code. - Memoize pyside_module_imports(). Pick-to: 6.7 Task-number: PYSIDE-1612 Change-Id: I55ccb67300c27de73843ad9996da655ba04403fb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* 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>
* Deployment: add permission support and create macOS bundle applicationShyamnath Premnadh2024-03-111-2/+2
| | | | | | | | | | | | | | | | | | - 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>
* Deployment: Find dependent modulesShyamnath Premnadh2024-03-061-4/+24
| | | | | | | | | | | | | | | | | | | | - Based on the desktop platform, find all the Qt module dependencies of the application just like Android. These dependencies can help in optimizing the plugins packaged with the application. - Desktop deployment has new cl arguments: --extra-ignore-dirs and --extra-modules that further complements finding the Qt modules used by the application. - Since the Qt dependencies are also required for desktop deployment, 'modules' field in pysidedeploy.spec is moved from under 'buildozer' key to 'qt' key. - dependency finding code moved to dependency_util.py. This also helps in list the imports without conflicts in deploy_lib/__init__.py. - Fix tests. Skip the deploy tests for macOS 11 as the CI does not include dyld_info either via XCode or CommandLineTools. Task-number: PYSIDE-1612 Change-Id: I3524e1996bfec76c5635d1b35ccbc4ecd6ba7b8d Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
* Deployment: More Refactoring and minor bug fixesShyamnath Premnadh2024-03-011-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | - setup_python() moved to constructor of PythonExecutable. -install_python_dependencies() moved under PythonExecutable in python_helper.py. - create_executable() of PythonExecutable removed. Instead, we call Nuitka.create_executable() directly. This removes unncessary import problems when using PythonExecutable class for Android Deployment. - nuitka==1.8.0 changed to Nuitka=1.8 in default.spec to match with the installed version. Otherwise, it forces the reinstall of Nuitka==1.8 every time (bug). - Remove recomputation of qt_plugins and local_libs. If the values exist in pysidedeploy.spec, then they should not be computed again. This serves the purposes of speeding up the deployment and also to no modifying the already existing pysidedeploy.spec. - find_pyside_modules() moved from python_helper.py to deploy_util.py. - Adapt tests. - Remove os.fspath wrapping from python.exe. This is not needed as python.exe is already pathlib.Path. Pick-to: 6.5 6.6 Task-number: PYSIDE-1612 Change-Id: Ic598e57cd2f2779c410b12fc9584cf60c5e94505 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Deployment: RefactoringShyamnath Premnadh2024-02-291-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | - Functions in buildozer.py for finding the local_libs, plugin and Qt module dependencies of the application are related to the overall config of the application and not buildozer. Hence, these functions are moved to android_config.py. - `ALL_PYSIDE_MODULES` moved to a function under deploy_lib/__init__.py and `platform_map` moved to deploy_lib/android/__init__.py. - Enable the user to pass both arm64-v8a and aarch64 as the architecture type. Same for all the other architecures that are synonymous. - `verify_and_set_recipe_dir()` is now called explicitly from android_deploy.py due to `cleanup()` deleting the recipe directories during config initialization. - New property `dependency_files` for AndroidConfig class. - Fix --dry-run for Android Deployment. - Adapt tests. Pick-to: 6.6 Task-number: PYSIDE-1612 Change-Id: Icdf14001ae2b07dc8614af3f458f9cad11eafdac Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PySide Tools: Fix flake8 warningsShyamnath Premnadh2024-02-021-1/+0
| | | | | | | | | | | | - Fix general flake8 warnings in pyside-tools. - add F401 to .flake8 to ignore unused imports from __init__.py files - add E402 from __init__.py to prevent errors related to partial initialization of modules. Pick-to: 6.6 6.5 Change-Id: Ia848b08ff6f0d2808e04f6a83c46636e2d167c02 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Deployment: Add icon for applicationShyamnath Premnadh2023-12-041-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | - 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: Code RefactoringShyamnath Premnadh2023-11-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | - Move android related configurations into a new class AndroidConfig. This class inherits from the class Config. - Move configuration related code sections from `android_deploy.py` to `android_config.py` - get_config() renamed to create_config_file(). This simplifies a lot of code and makes Android deployment independent of Desktop deployment. - Move `generated_files_path` to `config.py`. As a result, `generated_files_path` does not need to be passed as parameter to to functions like `cleanup()`, `finalize()`, `Buildozer.initialize()` as config is already passed. - generated_files_path expression changed. This is because we assume the project_dir is always the parent of the source_file (i.e. main.py) - `Buildozer` import removed from `android/__init__.py` to prevent circular import issues. - Change buildozer commands to use "python -m" as prefix. Pick-to: 6.6 Task-number: PYSIDE-1612 Change-Id: Ie460dc459908dab44de82c3e269b806aff2c27c5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Deployment cleanup: isort and flake8Shyamnath Premnadh2023-10-231-3/+3
| | | | | | | | 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>
* Android Deployment: find PySide and Qt dependenciesShyamnath Premnadh2023-09-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Use llvm-readelf to recursively find the dependencies of a dependent Qt binary. All the Qt dependencies are loaded at startup when loading the Android application. - Parse the revelant Python files of the project into ast, and find the used Python modules. Once the Python file is parsed into an ast, we find the imports of the following form: from PySide6 import Qt<module> from PySide6.Qt<module> import <classname> This is then used to identify the module used, and we try to load the binaries of this module. If the modules does not exist in Qt for Android, then an error is thrown. - The easiest way to find the relevant Python files in the project is using a .pyproject file which lists all the relevant files. If this is not there, then we find all the Python files in the project folder excluding the following folders: [".hg", ".svn", ".git", ".tox", "__pycache__", "env", "venv", "deployment",".buildozer"] - A new cli argument --extra-ignore-dirs, that lists the extra directories to ignore when searching for all the relevant python files in the project. - A new cli argument --extra-modules, that lists the extra modules to be added manually to the application incase they are not found by `pyside6-android-deploy` automatically. Adding a module using this argument means that the module binary is loaded by the Android application on startup. - sdk and ndk cli options are now mandatory to find the dependencies. These two options will be removed later when pyside6-android-deploy can automatically download them. Task-number: PYSIDE-1612 Change-Id: Ifbdc20cbc70ab0935a23157ccc8cb7fde6992df2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Deployment: Refactor to enable Android supportShyamnath Premnadh2023-03-291-1/+5
| | | | | | | | | | | | | | | | | | - 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-0/+2
| | | | | | | | | | | | | | - 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>
* Rename folder: deploy to deploy_libShyamnath Premnadh2022-12-221-0/+7
| | | | | | | | | | - 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