mesonbuild / meson-python

Meson PEP 517 Python build backend
https://mesonbuild.com/meson-python/
MIT License
125 stars 65 forks source link

Support file selection like setuptools and hatch #566

Closed paugier closed 8 months ago

paugier commented 8 months ago

If I understand correctly, meson-python includes all the files in the sdist and it is not possible to exclude some directories or files.

In contrast, setuptools and Hatch support controlling which files are included in the sdist. For Hatch, there are few related options in the pyproject.toml file: https://hatch.pypa.io/latest/config/build/#file-selection

Would it be possible to at least be able to exclude some files with meson-python ?

dnicolodi commented 8 months ago

meson-python uses meson dist to create sdist. meson dist obeys the export-ignore git attribute. Just mark the files you want to exclude from the sdist with this attribute in a .gitattributes file.