From 23b7ff61fb899ef8ae305df134d2c0968dce1fa2 Mon Sep 17 00:00:00 2001 From: Jaime Resano Date: Tue, 21 Jan 2025 11:17:07 +0100 Subject: pyside6-deploy: 3. Rename project folder to project_lib This is a refactor in order to improve the code clarity. In the testing of the pyside6-project command, importlib.import_module is used to import the project_lib folder. Currently, importlib.import_module("project") is ambiguous because it may refer to both the file and the folder. It chooses the folder over the file. Task-number: PYSIDE-1612 Pick-to: 6.8 Change-Id: I8903ea9d2112cf2eb7a68d0e302d3c74edcf2c22 Reviewed-by: Friedemann Kleint --- sources/pyside-tools/project.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'sources/pyside-tools/project.py') diff --git a/sources/pyside-tools/project.py b/sources/pyside-tools/project.py index 4836a7472..3b4b3e3f7 100644 --- a/sources/pyside-tools/project.py +++ b/sources/pyside-tools/project.py @@ -2,7 +2,6 @@ # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only from __future__ import annotations - """ Builds a '.pyproject' file @@ -25,12 +24,12 @@ import os from pathlib import Path from argparse import ArgumentParser, RawTextHelpFormatter -from project import (QmlProjectData, check_qml_decorators, is_python_file, - QMLDIR_FILE, MOD_CMD, METATYPES_JSON_SUFFIX, - SHADER_SUFFIXES, TRANSLATION_SUFFIX, - requires_rebuild, run_command, remove_path, - ProjectData, resolve_project_file, new_project, - ProjectType, ClOptions) +from project_lib import (QmlProjectData, check_qml_decorators, is_python_file, + QMLDIR_FILE, MOD_CMD, METATYPES_JSON_SUFFIX, + SHADER_SUFFIXES, TRANSLATION_SUFFIX, + requires_rebuild, run_command, remove_path, + ProjectData, resolve_project_file, new_project, + ProjectType, ClOptions) MODE_HELP = """build Builds the project run Builds the project and runs the first file") @@ -71,6 +70,7 @@ class Project: """ Class to wrap the various operations on Project """ + def __init__(self, project_file: Path): self.project = ProjectData(project_file=project_file) self.cl_options = ClOptions() -- cgit v1.2.3