aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside-tools/deploy_lib/nuitka_helper.py
diff options
context:
space:
mode:
authorShyamnath Premnadh <Shyamnath.Premnadh@qt.io>2024-06-04 15:48:40 +0200
committerShyamnath Premnadh <Shyamnath.Premnadh@qt.io>2024-06-10 10:20:06 +0200
commit32e353e9d91f45c23dcb07b0798237c79795cf0a (patch)
tree14d6739b4ab6c37882c220fb4a9594004730c186 /sources/pyside-tools/deploy_lib/nuitka_helper.py
parent527eec228d98f1c8e23f95dc92d6eed4d5a8725a (diff)
Desktop Deployment: Enable Nuitka --standalone mode
- enables the standalone mode of Nuitka for pyside6-deploy - the mode can be set either through the command line or the config file - adapt tests - update documentation Pick-to: 6.7 Fixes: PYSIDE-2622 Task-number: PYSIDE-1612 Change-Id: I5a10c857d3e79174d2643139eb2e4f7b5e10d955 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside-tools/deploy_lib/nuitka_helper.py')
-rw-r--r--sources/pyside-tools/deploy_lib/nuitka_helper.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/sources/pyside-tools/deploy_lib/nuitka_helper.py b/sources/pyside-tools/deploy_lib/nuitka_helper.py
index ac9a83f3f..5d0e9032f 100644
--- a/sources/pyside-tools/deploy_lib/nuitka_helper.py
+++ b/sources/pyside-tools/deploy_lib/nuitka_helper.py
@@ -1,6 +1,9 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+# enables to use typehints for classes that has not been defined yet or imported
+# used for resolving circular imports
+from __future__ import annotations
import logging
import os
import sys
@@ -8,6 +11,7 @@ from pathlib import Path
from typing import List
from . import MAJOR_VERSION, run_command
+from .config import DesktopConfig
class Nuitka:
@@ -52,10 +56,12 @@ class Nuitka:
def create_executable(self, source_file: Path, extra_args: str, qml_files: List[Path],
qt_plugins: List[str], excluded_qml_plugins: List[str], icon: str,
- dry_run: bool, permissions: List[str]):
+ dry_run: bool, permissions: List[str],
+ mode: DesktopConfig.NuitkaMode):
qt_plugins = [plugin for plugin in qt_plugins if plugin not in self.qt_plugins_to_ignore]
extra_args = extra_args.split()
+ # macOS uses the --standalone option by default to create an app bundle
if sys.platform == "darwin":
# create an app bundle
extra_args.extend(["--standalone", "--macos-create-app-bundle"])
@@ -63,7 +69,7 @@ class Nuitka:
for permission in permissions:
extra_args.append(permission_pattern.format(permission=permission))
else:
- extra_args.append("--onefile")
+ extra_args.append(f"--{mode.value}")
qml_args = []
if qml_files: