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
pull/11659/head
Eli Schwartz 2 years ago committed by Jussi Pakkanen
parent 285e0d3c59
commit e66b07e6fb
  1. 2
      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')

Loading…
Cancel
Save