diff options
Diffstat (limited to 'build_scripts/platforms')
| -rw-r--r-- | build_scripts/platforms/unix.py | 7 | ||||
| -rw-r--r-- | build_scripts/platforms/windows_desktop.py | 7 |
2 files changed, 12 insertions, 2 deletions
diff --git a/build_scripts/platforms/unix.py b/build_scripts/platforms/unix.py index d3767976f..83de489df 100644 --- a/build_scripts/platforms/unix.py +++ b/build_scripts/platforms/unix.py @@ -39,6 +39,7 @@ import os import sys +import fnmatch from .linux import prepare_standalone_package_linux from .macos import prepare_standalone_package_macos @@ -193,10 +194,14 @@ def prepare_packages_posix(self, vars): vars=vars) if not OPTION_NOEXAMPLES: + def pycache_dir_filter(dir_name, parent_full_path, dir_full_path): + if fnmatch.fnmatch(dir_name, "__pycache__"): + return False + return True # examples/* -> <setup>/{st_package_name}/examples copydir(os.path.join(self.script_dir, "examples"), "{st_build_dir}/{st_package_name}/examples", - force=False, vars=vars) + force=False, vars=vars, dir_filter_function=pycache_dir_filter) # Re-generate examples Qt resource files for Python 3 # compatibility if sys.version_info[0] == 3: diff --git a/build_scripts/platforms/windows_desktop.py b/build_scripts/platforms/windows_desktop.py index f204ba3a4..5208ed949 100644 --- a/build_scripts/platforms/windows_desktop.py +++ b/build_scripts/platforms/windows_desktop.py @@ -40,6 +40,7 @@ import functools import os import sys +import fnmatch from ..config import config from ..options import * @@ -222,10 +223,14 @@ def prepare_packages_win32(self, vars): recursive=False, vars=vars) if not OPTION_NOEXAMPLES: + def pycache_dir_filter(dir_name, parent_full_path, dir_full_path): + if fnmatch.fnmatch(dir_name, "__pycache__"): + return False + return True # examples/* -> <setup>/{st_package_name}/examples copydir(os.path.join(self.script_dir, "examples"), "{st_build_dir}/{st_package_name}/examples", - force=False, vars=vars) + force=False, vars=vars, dir_filter_function=pycache_dir_filter) # Re-generate examples Qt resource files for Python 3 # compatibility if sys.version_info[0] == 3: |
