diff options
| author | Jaime Resano <Jaime.Resano-Aisa@qt.io> | 2025-02-26 14:55:09 +0100 |
|---|---|---|
| committer | Jaime Resano <Jaime.RESANO-AISA@qt.io> | 2025-03-12 08:18:31 +0000 |
| commit | 69ecc3c71155548f43176e7fcf948f09eaf62416 (patch) | |
| tree | 98b706a482b74acbd9ffc29cc344ea22bd429e04 /sources/pyside-tools/deploy_lib/config.py | |
| parent | d9ce0e405f969d96cad221450b853b411eb96ad3 (diff) | |
pyproject.toml: 1. Refactor pyside6-project
This patch refactors the code of the pyside6-project tool to simplify
the upcoming change of the project file format, pyproject.toml.
The CLI tool documentation is also improved.
Task-number: PYSIDE-2714
Change-Id: I010bbb58f3ed8be5ad5f38687f36b4641a4a021d
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@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.py | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/sources/pyside-tools/deploy_lib/config.py b/sources/pyside-tools/deploy_lib/config.py index b8cf4edc5..34dfd3141 100644 --- a/sources/pyside-tools/deploy_lib/config.py +++ b/sources/pyside-tools/deploy_lib/config.py @@ -11,7 +11,7 @@ from configparser import ConfigParser from pathlib import Path from enum import Enum -from project_lib import ProjectData, DesignStudioProject +from project_lib import ProjectData, DesignStudioProject, resolve_valid_project_file from . import (DEFAULT_APP_ICON, DEFAULT_IGNORE_DIRS, find_pyside_modules, find_permission_categories, QtDependencyReader, run_qmlimportscanner) @@ -349,15 +349,12 @@ class Config(BaseConfig): else: pyproject_location = self.project_dir - files = list(pyproject_location.glob("*.pyproject")) - if not files: - logging.info("[DEPLOY] No .pyproject file found. Project file not set") - return None - if len(files) > 1: - warnings.warn("DEPLOY: More that one .pyproject files found. Project file not set") - return None - - return files[0] + try: + return resolve_valid_project_file(pyproject_location) + except ValueError as e: + logging.warning(f"[DEPLOY] Error resolving a valid project file. Project file not set. " + f"Error:\n{e}. ") + return None def _find_excluded_qml_plugins(self) -> list[str] | None: if not self.qml_files and not DesignStudioProject.is_ds_project(self.source_file): |
