diff options
author | Shyamnath Premnadh <shyamnath.premnadh@qt.io> | 2023-04-04 16:18:47 +0200 |
---|---|---|
committer | Shyamnath Premnadh <shyamnath.premnadh@qt.io> | 2023-04-17 11:12:55 +0200 |
commit | 0e40c7af91df19a2ac20d88b55d4ef4d71845c55 (patch) | |
tree | b1002ad68cba00384ea0ee5c390c088ea630afe1 /sources/pyside-tools/android_deploy.py | |
parent | b80c7822c61b70d9704b42db64db0d9637fa7079 (diff) |
Deployment: Refactoring
- Fix --dry-run in Android deployment
- Add option to control raising a warning when adding new entries
to config file
- Remove unnecessary code and comments
Pick-to: 6.5
Task-number: PYSIDE-1612
Change-Id: I5975d76024d6289fe6b9af1caeca374acb81e8cc
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside-tools/android_deploy.py')
-rw-r--r-- | sources/pyside-tools/android_deploy.py | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/sources/pyside-tools/android_deploy.py b/sources/pyside-tools/android_deploy.py index b3d09cd94..b1ea32064 100644 --- a/sources/pyside-tools/android_deploy.py +++ b/sources/pyside-tools/android_deploy.py @@ -60,11 +60,10 @@ def main(name: str = None, pyside_wheel: Path = None, shiboken_wheel: Path = Non main_file = Path.cwd() / "main.py" generated_files_path = None if not main_file.exists(): - print(dedent(""" + raise RuntimeError(dedent(""" [DEPLOY] For android deployment to work, the main entrypoint Python file should be named - 'main.py' + 'main.py' and it should be run from the application directory """)) - return # check if ndk and sdk path given, else use default if ndk_path and sdk_path: @@ -75,17 +74,10 @@ def main(name: str = None, pyside_wheel: Path = None, shiboken_wheel: Path = Non android_data = AndroidData(wheel_pyside=pyside_wheel, wheel_shiboken=shiboken_wheel, ndk_path=ndk_path, sdk_path=sdk_path) - if config_file and Path(config_file).exists(): - config_file = Path(config_file).resolve() - python = setup_python(dry_run=dry_run, force=force, init=init) config = get_config(python_exe=python.exe, dry_run=dry_run, config_file=config_file, main_file=main_file, android_data=android_data, is_android=True) - if config.project_dir != Path.cwd(): - raise RuntimeError("[DEPLOY] For Android deployment, pyside6-deploy should be run from" - f"{config.project_dir}") - if not config.wheel_pyside and not config.wheel_shiboken: raise RuntimeError(f"[DEPLOY] No PySide{MAJOR_VERSION} and Shiboken{MAJOR_VERSION} wheels" "found") @@ -191,7 +183,8 @@ if __name__ == "__main__": formatter_class=argparse.RawTextHelpFormatter, ) - parser.add_argument("-c", "--config-file", type=str, help="Path to the .spec config file") + parser.add_argument("-c", "--config-file", type=lambda p: Path(p).absolute(), + help="Path to the .spec config file") parser.add_argument( "--init", action="store_true", |