aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6
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/pyside6
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/pyside6')
-rw-r--r--sources/pyside6/doc/deployment/deployment-pyside6-deploy.rst6
-rw-r--r--sources/pyside6/tests/tools/pyside6-deploy/test_pyside6_deploy.py10
2 files changed, 16 insertions, 0 deletions
diff --git a/sources/pyside6/doc/deployment/deployment-pyside6-deploy.rst b/sources/pyside6/doc/deployment/deployment-pyside6-deploy.rst
index 980fe2dd1..3b602babc 100644
--- a/sources/pyside6/doc/deployment/deployment-pyside6-deploy.rst
+++ b/sources/pyside6/doc/deployment/deployment-pyside6-deploy.rst
@@ -144,6 +144,12 @@ The relevant parameters for ``pyside6-deploy`` are:
NSCameraUsageDescription:CameraAccess
+ * ``mode``: Accepts one of the options: ``onefile`` or ``standalone``. The default is ``onefile``.
+ This option corresponds to the mode in which Nuitka is run. The onefile mode creates a single
+ executable file, while the standalone mode creates a directory with the executable and all the
+ necessary files. The standalone mode is useful when you want to distribute the application as a
+ directory with dependencies and other files required by the app.
+
* ``extra_args``: Any extra Nuitka arguments specified. It is specified as space-separated
command line arguments i.e. just like how you would specify it when you use Nuitka through
the command line. By default, it contains the following arguments::
diff --git a/sources/pyside6/tests/tools/pyside6-deploy/test_pyside6_deploy.py b/sources/pyside6/tests/tools/pyside6-deploy/test_pyside6_deploy.py
index db60c8c3f..a5d122a37 100644
--- a/sources/pyside6/tests/tools/pyside6-deploy/test_pyside6_deploy.py
+++ b/sources/pyside6/tests/tools/pyside6-deploy/test_pyside6_deploy.py
@@ -174,6 +174,16 @@ class TestPySide6DeployWidgets(DeployTestBase):
self.deploy.main(main_file=fake_main_file, config_file=self.config_file)
self.assertTrue("Directory does not contain main.py file." in str(context.exception))
+ def testStandaloneMode(self, mock_plugins):
+ mock_plugins.return_value = self.all_plugins
+ # remove --onefile from self.expected_run_cmd and replace it with --standalone
+ self.expected_run_cmd = self.expected_run_cmd.replace(" --onefile", " --standalone")
+ # test standalone mode
+ original_output = self.deploy.main(self.main_file, mode="standalone", dry_run=True,
+ force=True)
+
+ self.assertEqual(original_output, self.expected_run_cmd)
+
@unittest.skipIf(sys.platform == "darwin" and int(platform.mac_ver()[0].split('.')[0]) <= 11,
"Test only works on macOS version 12+")