aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside-tools
diff options
context:
space:
mode:
authorShyamnath Premnadh <Shyamnath.Premnadh@qt.io>2022-12-20 09:42:34 +0100
committerShyamnath Premnadh <Shyamnath.Premnadh@qt.io>2022-12-29 09:01:28 +0000
commit134adfc99bf57acf84df8bfa74c545d0e43879a5 (patch)
tree6c3e5e719a0db822e35222f5ed1a239ba1f8f4cc /sources/pyside-tools
parente6f8d88d6fd4d242b613abf6d3588a3c41570ccc (diff)
deploy tool: return Nuitka command for --dry-run
- 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>
Diffstat (limited to 'sources/pyside-tools')
-rw-r--r--sources/pyside-tools/deploy.py14
-rw-r--r--sources/pyside-tools/deploy_lib/commands.py1
-rw-r--r--sources/pyside-tools/deploy_lib/nuitka_helper.py3
-rw-r--r--sources/pyside-tools/deploy_lib/python_helper.py14
4 files changed, 20 insertions, 12 deletions
diff --git a/sources/pyside-tools/deploy.py b/sources/pyside-tools/deploy.py
index f2dc21f3e..dbc0e8571 100644
--- a/sources/pyside-tools/deploy.py
+++ b/sources/pyside-tools/deploy.py
@@ -79,6 +79,9 @@ def main(main_file: Path = None, config_file: Path = None, init: bool = False,
else:
config_file = Path.cwd() / "pysidedeploy.spec"
+ # Nuitka command to run
+ command_str = None
+
logging.info("[DEPLOY] Start")
try:
@@ -139,11 +142,11 @@ def main(main_file: Path = None, config_file: Path = None, init: bool = False,
# create executable
if not dry_run:
print("[DEPLOY] Deploying application")
- python.create_executable(
- source_file=source_file,
- extra_args=config.get_value("nuitka", "extra_args"),
- config=config,
- )
+ command_str = python.create_executable(
+ source_file=source_file,
+ extra_args=config.get_value("nuitka", "extra_args"),
+ config=config,
+ )
except Exception:
print(f"Exception occurred: {traceback.format_exc()}")
finally:
@@ -160,6 +163,7 @@ def main(main_file: Path = None, config_file: Path = None, init: bool = False,
clean(generated_files_path)
logging.info("[DEPLOY] End")
+ return command_str
if __name__ == "__main__":
diff --git a/sources/pyside-tools/deploy_lib/commands.py b/sources/pyside-tools/deploy_lib/commands.py
index 92745367f..2733dd4c1 100644
--- a/sources/pyside-tools/deploy_lib/commands.py
+++ b/sources/pyside-tools/deploy_lib/commands.py
@@ -29,3 +29,4 @@ def run_command(command, dry_run: bool):
except Exception as error:
logging.exception(f"[DEPLOY]: Command {command_str} failed with error {error}")
raise
+ return command_str
diff --git a/sources/pyside-tools/deploy_lib/nuitka_helper.py b/sources/pyside-tools/deploy_lib/nuitka_helper.py
index f7114db79..1f4e434c5 100644
--- a/sources/pyside-tools/deploy_lib/nuitka_helper.py
+++ b/sources/pyside-tools/deploy_lib/nuitka_helper.py
@@ -48,4 +48,5 @@ class Nuitka:
linux_icon = str(Path(__file__).parent / "pyside_icon.jpg")
command.append(f"--linux-onefile-icon={linux_icon}")
- run_command(command=command, dry_run=dry_run)
+ command_str = run_command(command=command, dry_run=dry_run)
+ return command_str
diff --git a/sources/pyside-tools/deploy_lib/python_helper.py b/sources/pyside-tools/deploy_lib/python_helper.py
index 35c3fb35c..e92ce8e0c 100644
--- a/sources/pyside-tools/deploy_lib/python_helper.py
+++ b/sources/pyside-tools/deploy_lib/python_helper.py
@@ -73,10 +73,12 @@ class PythonExecutable:
if config.qml_files:
logging.info(f"[DEPLOY] Included QML files: {config.qml_files}")
- self.nuitka.create_executable(
- source_file=source_file,
- extra_args=extra_args,
- qml_files=config.qml_files,
- dry_run=self.dry_run,
- )
+ command_str = self.nuitka.create_executable(
+ source_file=source_file,
+ extra_args=extra_args,
+ qml_files=config.qml_files,
+ dry_run=self.dry_run,
+ )
+
+ return command_str