diff options
| author | Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> | 2023-02-08 16:58:39 +0100 |
|---|---|---|
| committer | Shyamnath Premnadh <shyamnath.premnadh@qt.io> | 2023-03-31 13:29:32 +0200 |
| commit | 95abfa776411b6d7cd4296adf63bc7abce2270b6 (patch) | |
| tree | 74e51c8c6d28044a60011158215919ab223d6fa5 /sources/pyside-tools/deploy_lib/deploy_util.py | |
| parent | 94b30c7207bea2467f0d7e41e99af27ecc749ed5 (diff) | |
Deployment: New pyside6-android-deploy tool
- Preliminary support for PySide6 Android deployment
- Uses jinja2 to create PySide6 and shiboken6 recipes, to be used
by buildozer when python_for_android builds the app distribution
- Classes for Buildozer config interaction
- Run deployment to android. Typical command looks like:
"""
pyside6-android-deploy
--wheel-pyside=./PySide6-6.5.0a1-6.5.0-cp37-abi3-android_x86_64.whl
--wheel-shiboken=./shiboken6-6.5.0a1-6.5.0-cp37-abi3-android_x86_64.whl
--name=stringlistmodel
"""
- New entrypoint for pyside6-android-deploy
- Helper functinos for Android Deployment
- Remove unused function main_py_exists()
- Added the new files to deploy.pyproject
- Remove dry_run argument from install_python_dependencies()
- new Python packages added in requirements.txt to enable the
deploy and cross compile tool
Note: python-for-android uses my local fork. This will be changed
once it is merged into python-for-android dev.
Task-number: PYSIDE-1612
Pick-to: 6.5
Change-Id: I7eb96fa5507a476b4e86ec0195a5e9869f0f85fd
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'sources/pyside-tools/deploy_lib/deploy_util.py')
| -rw-r--r-- | sources/pyside-tools/deploy_lib/deploy_util.py | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/sources/pyside-tools/deploy_lib/deploy_util.py b/sources/pyside-tools/deploy_lib/deploy_util.py index 843a21f5a..de545e3a5 100644 --- a/sources/pyside-tools/deploy_lib/deploy_util.py +++ b/sources/pyside-tools/deploy_lib/deploy_util.py @@ -19,7 +19,7 @@ def config_option_exists(): return False -def cleanup(generated_files_path: Path, config: Config): +def cleanup(generated_files_path: Path, config: Config, is_android: bool = False): """ Cleanup the generated build folders/files """ @@ -29,9 +29,20 @@ def cleanup(generated_files_path: Path, config: Config): elif not config.dry_run: logging.info(f"[DEPLOY] {generated_files_path} does not exist") + if is_android: + buildozer_spec: Path = config.project_dir / "buildozer.spec" + if buildozer_spec.exists(): + buildozer_spec.unlink() + logging.info(f"[DEPLOY] {str(buildozer_spec)} removed") + + buildozer_build: Path = config.project_dir / ".buildozer" + if buildozer_build.exists(): + shutil.rmtree(buildozer_build) + logging.info(f"[DEPLOY] {str(buildozer_build)} removed") + def get_config(python_exe: Path, dry_run: bool = False, config_file: Path = None, main_file: - Path = None): + Path = None, android_data = None, is_android: bool = False): """ Sets up a new deployment configuration or use an existing config file """ @@ -42,7 +53,7 @@ def get_config(python_exe: Path, dry_run: bool = False, config_file: Path = None config_file = Path.cwd() / "pysidedeploy.spec" config = Config(config_file=config_file, source_file=main_file, python_exe=python_exe, - dry_run=dry_run) + dry_run=dry_run, android_data=android_data, is_android=is_android) return config @@ -70,7 +81,7 @@ def setup_python(dry_run: bool, force: bool, init: bool): def install_python_dependencies(config: Config, python: PythonExecutable, init: bool, - packages: str): + packages: str, is_android: bool = False): """ Installs the python package dependencies for the target deployment platform """ @@ -80,13 +91,14 @@ def install_python_dependencies(config: Config, python: PythonExecutable, init: packages = config.get_value("python", packages).split(",") python.install(packages=packages) # nuitka requires patchelf to make patchelf rpath changes for some Qt files - if sys.platform.startswith("linux"): + if sys.platform.startswith("linux") and not is_android: python.install(packages=["patchelf"]) def finalize(generated_files_path: Path, config: Config): """ Copy the executable into the final location + For Android deployment, this is done through buildozer """ generated_exec_path = generated_files_path / (config.source_file.stem + EXE_FORMAT) if generated_exec_path.exists() and config.exe_dir: |
