aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside-tools/project_lib/__init__.py
diff options
context:
space:
mode:
authorJaime Resano <Jaime.Resano-Aisa@qt.io>2025-01-21 11:17:07 +0100
committerJaime Resano <Jaime.Resano-Aisa@qt.io>2025-01-22 22:46:43 +0100
commit23b7ff61fb899ef8ae305df134d2c0968dce1fa2 (patch)
tree15f5a0afdf5335b883f531d5824d8994306625b4 /sources/pyside-tools/project_lib/__init__.py
parent30f8707e1c677e3a42a93d1b2b17bd563b9de847 (diff)
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 <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside-tools/project_lib/__init__.py')
-rw-r--r--sources/pyside-tools/project_lib/__init__.py48
1 files changed, 48 insertions, 0 deletions
diff --git a/sources/pyside-tools/project_lib/__init__.py b/sources/pyside-tools/project_lib/__init__.py
new file mode 100644
index 000000000..aafaa44bf
--- /dev/null
+++ b/sources/pyside-tools/project_lib/__init__.py
@@ -0,0 +1,48 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# 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
+
+from dataclasses import dataclass
+
+QTPATHS_CMD = "qtpaths6"
+MOD_CMD = "pyside6-metaobjectdump"
+
+PROJECT_FILE_SUFFIX = ".pyproject"
+QMLDIR_FILE = "qmldir"
+
+QML_IMPORT_NAME = "QML_IMPORT_NAME"
+QML_IMPORT_MAJOR_VERSION = "QML_IMPORT_MAJOR_VERSION"
+QML_IMPORT_MINOR_VERSION = "QML_IMPORT_MINOR_VERSION"
+QT_MODULES = "QT_MODULES"
+
+METATYPES_JSON_SUFFIX = "metatypes.json"
+TRANSLATION_SUFFIX = ".ts"
+SHADER_SUFFIXES = ".vert", ".frag"
+
+
+class Singleton(type):
+ _instances = {}
+
+ def __call__(cls, *args, **kwargs):
+ if cls not in cls._instances:
+ cls._instances[cls] = super().__call__(*args, **kwargs)
+ return cls._instances[cls]
+
+
+@dataclass(frozen=True)
+class ClOptions(metaclass=Singleton):
+ """
+ Dataclass to store the cl options that needs to be passed as arguments.
+ """
+ dry_run: bool
+ quiet: bool
+ force: bool
+ qml_module: bool
+
+
+from .utils import (run_command, requires_rebuild, remove_path, package_dir, qtpaths,
+ qt_metatype_json_dir, resolve_project_file)
+from .project_data import (is_python_file, ProjectData, QmlProjectData,
+ check_qml_decorators)
+from .newproject import new_project, ProjectType
+from .design_studio_project import DesignStudioProject