Non-package data files#

It is possible to encapsulate arbitrary data files into Python wheels. meson-python will add to the wheel any data file installed into the Meson’s {datadir} location, for example via Meson’s install_data() function. However, when the resulting wheel is installed, these files are unpacked into a platform-specific location and there is no supported facility to reliably find them at run time.

It is recommended to include data files than need to be accessible at run-time inside the package alongside the Python code, and use importlib.resources (or the importlib-resources backport) to access them.

Shared libraries on Windows#

On Windows, meson-python cannot encapsulate shared libraries installed as part of the Meson project into the Python wheel for Python extension modules or executables, in a way suitable for them to be found at run-time.

This limitation can be overcome with static linking or using delvewheel to post-process the Python wheel to bundle the required shared libraries and include the setup code to properly set the library search path.