aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside-tools/deploy_lib/config.py
diff options
context:
space:
mode:
authorShyamnath Premnadh <shyamnath.premnadh@qt.io>2023-03-20 10:51:56 +0100
committerShyamnath Premnadh <shyamnath.premnadh@qt.io>2023-03-27 09:01:18 +0100
commit4d4f744c570d2feb79163051d2fd4c73336f1758 (patch)
tree372f4e18fe6978d1441164352836e88f8b1647ab /sources/pyside-tools/deploy_lib/config.py
parent5529853210de3e51b2ad3c636ebee4a4d77aa54e (diff)
Deployment Tool: Remove create_venv + fix --dry-run/--init
- As the deployment tool's code base grows larger, I realized that the ability to create a venv using pyside6-deploy was a bit of over engineering. There are instances where I have to use the current Python interpreter to fetch some information from the newly created venv Python, which results in weird code. Note: The tool would still work even if the user is using a globally installed Python interpreter with PySide6 installed. - Now, the user is warned if he is not in a virtual environment and prompted the requirement to install further Python packages. If the user input's "no", then the tool exits. - dry_run used to create an empty 'pysidedeploy.spec' which can wreck the normal deployment process. This is fixed by pyside6-deploy using the 'default.spec' instead of creating a new 'pysidedeploy.spec'. Fixes: PYSIDE-2258 Task-number: PYSIDE-1612 Pick-to: 6.4 6.5 Change-Id: I376d2a6aea9f93582eab7a904a81f48426bfee18 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside-tools/deploy_lib/config.py')
-rw-r--r--sources/pyside-tools/deploy_lib/config.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/sources/pyside-tools/deploy_lib/config.py b/sources/pyside-tools/deploy_lib/config.py
index ba165d20b..03dff70bf 100644
--- a/sources/pyside-tools/deploy_lib/config.py
+++ b/sources/pyside-tools/deploy_lib/config.py
@@ -24,8 +24,11 @@ class Config:
self.config_file = config_file
self.parser = ConfigParser(comment_prefixes="/", allow_no_value=True)
if not self.config_file.exists():
- logging.info(f"[DEPLOY] Creating config file {self.config_file}")
- shutil.copy(Path(__file__).parent / "default.spec", self.config_file)
+ if not dry_run:
+ logging.info(f"[DEPLOY] Creating config file {self.config_file}")
+ shutil.copy(Path(__file__).parent / "default.spec", self.config_file)
+ else:
+ self.config_file = Path(__file__).parent / "default.spec"
else:
print(f"Using existing config file {config_file}")
self.parser.read(self.config_file)