aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside-tools/deploy_lib/dependency_util.py
diff options
context:
space:
mode:
authorCristián Maureira-Fredes <Cristian.Maureira-Fredes@qt.io>2024-12-03 10:03:24 +0100
committerCristián Maureira-Fredes <Cristian.Maureira-Fredes@qt.io>2024-12-04 09:37:35 +0100
commit0c0aa19cdddc8c71ad68993061559b66cd1adb46 (patch)
tree485cddf203f9a487932bca46ce488dd7873cb0eb /sources/pyside-tools/deploy_lib/dependency_util.py
parent32ac02152bef4f79fdb20bb173afa190d7ec02a9 (diff)
deploy: use tuple instead of list for lru_cache function
One cannot use list in the arguments of a function using lru_cache Fixes: PYSIDE-2945 Pick-to: 6.8 Change-Id: I2305dab868a634bfb8a3f240d403c07281f7edb8 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Diffstat (limited to 'sources/pyside-tools/deploy_lib/dependency_util.py')
-rw-r--r--sources/pyside-tools/deploy_lib/dependency_util.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/sources/pyside-tools/deploy_lib/dependency_util.py b/sources/pyside-tools/deploy_lib/dependency_util.py
index e99d654c7..e614576b9 100644
--- a/sources/pyside-tools/deploy_lib/dependency_util.py
+++ b/sources/pyside-tools/deploy_lib/dependency_util.py
@@ -18,7 +18,7 @@ from . import IMPORT_WARNING_PYSIDE, DEFAULT_IGNORE_DIRS, run_command
@lru_cache(maxsize=None)
-def get_py_files(project_dir: Path, extra_ignore_dirs: list[Path] = None, project_data=None):
+def get_py_files(project_dir: Path, extra_ignore_dirs: tuple[Path] = None, project_data=None):
"""Finds and returns all the Python files in the project
"""
py_candidates = []
@@ -116,6 +116,8 @@ def find_permission_categories(project_dir: Path, extra_ignore_dirs: list[Path]
return set(perm_categories)
+ if extra_ignore_dirs is not None:
+ extra_ignore_dirs = tuple(extra_ignore_dirs)
py_candidates = get_py_files(project_dir, extra_ignore_dirs, project_data)
for py_candidate in py_candidates:
all_perm_categories = all_perm_categories.union(pyside_permission_imports(py_candidate))
@@ -172,6 +174,8 @@ def find_pyside_modules(project_dir: Path, extra_ignore_dirs: list[Path] = None,
return set(modules)
+ if extra_ignore_dirs is not None:
+ extra_ignore_dirs = tuple(extra_ignore_dirs)
py_candidates = get_py_files(project_dir, extra_ignore_dirs, project_data)
for py_candidate in py_candidates:
all_modules = all_modules.union(pyside_module_imports(py_candidate))