aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside-tools/deploy.py
diff options
context:
space:
mode:
authorShyamnath Premnadh <Shyamnath.Premnadh@qt.io>2023-09-28 16:51:02 +0200
committerShyamnath Premnadh <Shyamnath.Premnadh@qt.io>2023-10-11 10:47:04 +0200
commit6337e4a306babdb4015c248a14ad734b320ed2c1 (patch)
tree535e2d30d8c74e835f3d3b0846365f95c1e09e3b /sources/pyside-tools/deploy.py
parentdb1b6c991e48e0ccfc71c44154e634a547c8e67b (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.py')
-rw-r--r--sources/pyside-tools/deploy.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/sources/pyside-tools/deploy.py b/sources/pyside-tools/deploy.py
index 51c10664b..e13d97385 100644
--- a/sources/pyside-tools/deploy.py
+++ b/sources/pyside-tools/deploy.py
@@ -75,6 +75,10 @@ def main(main_file: Path = None, name: str = None, config_file: Path = None, ini
install_python_dependencies(config=config, python=python, init=init,
packages="packages")
+ # required by Nuitka for pyenv Python
+ if python.is_pyenv_python():
+ config.extra_args += " --static-libpython=no"
+
# writing config file
# in the case of --dry-run, we use default.spec as reference. Do not save the changes
# for --dry-run
@@ -93,7 +97,7 @@ def main(main_file: Path = None, name: str = None, config_file: Path = None, ini
command_str = python.create_executable(
source_file=source_file,
- extra_args=config.get_value("nuitka", "extra_args"),
+ extra_args=config.extra_args,
config=config,
)
except Exception:
@@ -116,6 +120,7 @@ if __name__ == "__main__":
)
parser.add_argument("-c", "--config-file", type=lambda p: Path(p).absolute(),
+ default=(Path.cwd() / "pysidedeploy.spec"),
help="Path to the .spec config file")
parser.add_argument(