aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaime Resano <Jaime.Resano-Aisa@qt.io>2024-11-19 14:30:52 +0100
committerJaime Resano <Jaime.Resano-Aisa@qt.io>2024-11-20 16:54:48 +0100
commitda62bfd955307683c0f1e4c9479169e9156393f3 (patch)
tree1707be5950ae68a14db9ee0e57d0c7625ac8702f
parent5b51fb868f3c9a0550ef1ec688d1e6c77cc9e796 (diff)
Avoid including dev folders in deployed executable
The .git, __pycache__ and .vscode folders should not be included in the deployed executable. Windows, it causes permission errors when the cleanup is performed Pick-to: 6.8 Task-number: PYSIDE-1612 Change-Id: Icfcbe6aa0d3cb2b869a0bb9a68dbe8d1e1d9a5ec Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
-rw-r--r--sources/pyside-tools/deploy_lib/__init__.py4
-rw-r--r--sources/pyside-tools/deploy_lib/dependency_util.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/sources/pyside-tools/deploy_lib/__init__.py b/sources/pyside-tools/deploy_lib/__init__.py
index 902dbc544..b40601dca 100644
--- a/sources/pyside-tools/deploy_lib/__init__.py
+++ b/sources/pyside-tools/deploy_lib/__init__.py
@@ -18,8 +18,8 @@ else:
EXE_FORMAT = ".bin"
DEFAULT_APP_ICON = str((Path(__file__).parent / f"pyside_icon{IMAGE_FORMAT}").resolve())
-DEFAULT_IGNORE_DIRS = ["site-packages", "deployment", ".qtcreator", "build", "dist", "tests",
- "doc", "docs", "examples"]
+DEFAULT_IGNORE_DIRS = {"site-packages", "deployment", ".git", ".qtcreator", "build", "dist",
+ "tests", "doc", "docs", "examples", ".vscode", "__pycache__"}
IMPORT_WARNING_PYSIDE = (f"[DEPLOY] Found 'import PySide6' in file {0}"
". Use 'from PySide6 import <module>' or pass the module"
diff --git a/sources/pyside-tools/deploy_lib/dependency_util.py b/sources/pyside-tools/deploy_lib/dependency_util.py
index 35973445c..af7a604d5 100644
--- a/sources/pyside-tools/deploy_lib/dependency_util.py
+++ b/sources/pyside-tools/deploy_lib/dependency_util.py
@@ -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__", *DEFAULT_IGNORE_DIRS]
+ ignore_dirs = DEFAULT_IGNORE_DIRS.copy()
if project_data:
py_candidates = project_data.python_files