diff options
| author | Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> | 2024-07-02 11:55:45 +0200 |
|---|---|---|
| committer | Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> | 2024-07-08 13:25:49 +0200 |
| commit | e3ca9d63fd21867ad974928162a62832b36f807d (patch) | |
| tree | 4d02de4746b4cfb44d18e50d1c59b309a55452e2 /sources/pyside-tools/deploy_lib/dependency_util.py | |
| parent | cecf63e72a85a33fd1163b1a13262357e7a43819 (diff) | |
Desktop Deployment: Ignore directories
- Among the directories ".qtcreator", "site-packages", "deployment" etc
were excluded when finding the QML files and the Python files in the
project.
- Simplify find_and_set_qml_files(self) function by removing the
unnecessary code.
- Memoize pyside_module_imports().
Pick-to: 6.7
Task-number: PYSIDE-1612
Change-Id: I55ccb67300c27de73843ad9996da655ba04403fb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside-tools/deploy_lib/dependency_util.py')
| -rw-r--r-- | sources/pyside-tools/deploy_lib/dependency_util.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sources/pyside-tools/deploy_lib/dependency_util.py b/sources/pyside-tools/deploy_lib/dependency_util.py index 30a336f0a..6cab75cfc 100644 --- a/sources/pyside-tools/deploy_lib/dependency_util.py +++ b/sources/pyside-tools/deploy_lib/dependency_util.py @@ -14,7 +14,7 @@ import sys from pathlib import Path from functools import lru_cache -from . import IMPORT_WARNING_PYSIDE, run_command +from . import IMPORT_WARNING_PYSIDE, DEFAULT_IGNORE_DIRS, run_command @lru_cache(maxsize=None) @@ -22,7 +22,7 @@ def get_py_files(project_dir: Path, extra_ignore_dirs: list[Path] = None, projec """Finds and returns all the Python files in the project """ py_candidates = [] - ignore_dirs = ["__pycache__", "env", "venv", "deployment"] + ignore_dirs = ["__pycache__", *DEFAULT_IGNORE_DIRS] if project_data: py_candidates = project_data.python_files @@ -135,6 +135,7 @@ def find_pyside_modules(project_dir: Path, extra_ignore_dirs: list[Path] = None, all_modules = set() mod_pattern = re.compile("PySide6.Qt(?P<mod_name>.*)") + @lru_cache def pyside_module_imports(py_file: Path): modules = [] try: |
