summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2023-04-15 23:46:13 -0400
committerJussi Pakkanen <jpakkane@gmail.com>2023-04-17 11:36:55 +0300
commite66b07e6fb9e7264c23a4cda7f28c538e6229229 (patch)
tree4b91d204477bf22e900dfab2cf7106403e131127
parent285e0d3c597d17fb980d95bda1d153f3e2829bcf (diff)
downloadmeson-e66b07e6fb9e7264c23a4cda7f28c538e6229229.tar.gz
fix data collection with pyinstaller
pyinstaller considers .py files to not be data by default. The entire architecture of pyinstaller is, in fact, different from zipapp or unpacked modules -- because it actually has to use a resource loader with on-disk files *separate* from the module itself. So just because a file gets packaged in the application does not mean it's usable as an importlib.resources compatible resource. Although we collect data files in general, we need to make sure that .py files are collected from scripts, because we may try to run them standalone from an external process. Fixes #11689
-rw-r--r--packaging/hook-mesonbuild.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/packaging/hook-mesonbuild.py b/packaging/hook-mesonbuild.py
index b076c506d..86e74639f 100644
--- a/packaging/hook-mesonbuild.py
+++ b/packaging/hook-mesonbuild.py
@@ -21,7 +21,7 @@ def get_all_modules_from_dir(dirname):
modules = ['mesonbuild.' + modname + '.' + x for x in modules if not x.startswith('_')]
return modules
-datas += collect_data_files('mesonbuild.scripts')
+datas += collect_data_files('mesonbuild.scripts', include_py_files=True, excludes=['**/__pycache__'])
datas += collect_data_files('mesonbuild.cmake.data')
datas += collect_data_files('mesonbuild.dependencies.data')