diff options
| author | Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> | 2023-09-28 16:51:02 +0200 |
|---|---|---|
| committer | Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> | 2023-10-11 10:47:04 +0200 |
| commit | 6337e4a306babdb4015c248a14ad734b320ed2c1 (patch) | |
| tree | 535e2d30d8c74e835f3d3b0846365f95c1e09e3b /sources/pyside-tools/deploy_lib/deploy_util.py | |
| parent | db1b6c991e48e0ccfc71c44154e634a547c8e67b (diff) | |
Deployment tool: Code fixes
- `--config-file` now defaults to pysidedeploy.spec. This enables to
automatically find the config file, in case if it is present,
without specifying it through the `--config-file` option.
- Use `pip freeze` also to check if a Python package in installed. This
is useful for packages like `patchelf` which does not provide
a Python module, but only an executable.
- Change some `logging.exception()` to actual exceptions because the
the exception requires some manual intervention for resolution.
- Some of the config options were earlier reevaluated even when an
existing config file exists. This is now adapted to skip the
reevaluation when a config file exists.
- In case of pyenv python, add `--static-libpython=no` as extra argument
accepted by Nuitka. This is because pyenv Python uses `--enable-shared`
by default since release 2.3.10 -
https://github.com/pyenv/pyenv/pull/2554
- Some general fixes related to logging.
Task-number: PYSIDE-1612
Pick-to: 6.6
Change-Id: Ib0fa0ca0ec3a08c07140c0c2fa32f422658d04d8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside-tools/deploy_lib/deploy_util.py')
| -rw-r--r-- | sources/pyside-tools/deploy_lib/deploy_util.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sources/pyside-tools/deploy_lib/deploy_util.py b/sources/pyside-tools/deploy_lib/deploy_util.py index bb986344c..02a7ed39e 100644 --- a/sources/pyside-tools/deploy_lib/deploy_util.py +++ b/sources/pyside-tools/deploy_lib/deploy_util.py @@ -26,8 +26,6 @@ def cleanup(generated_files_path: Path, config: Config, is_android: bool = False if generated_files_path.exists(): shutil.rmtree(generated_files_path) logging.info("[DEPLOY] Deployment directory purged") - 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" @@ -68,7 +66,8 @@ def get_config(python_exe: Path, dry_run: bool = False, config_file: Path = None config_file = Path(__file__).parent / "default.spec" config = Config(config_file=config_file, source_file=main_file, python_exe=python_exe, - dry_run=dry_run, android_data=android_data, is_android=is_android) + dry_run=dry_run, android_data=android_data, is_android=is_android, + existing_config_file=config_file_exists) return config @@ -102,7 +101,7 @@ def install_python_dependencies(config: Config, python: PythonExecutable, init: """ if not init: # install packages needed for deployment - logging.info("[DEPLOY] Installing dependencies \n") + logging.info("[DEPLOY] Installing dependencies") packages = config.get_value("python", packages).split(",") python.install(packages=packages) # nuitka requires patchelf to make patchelf rpath changes for some Qt files |
