-
Notifications
You must be signed in to change notification settings - Fork 151
Description
With
[tool.flit.external-data]
directory = "data"configured, files in the source "data" directory appear in {package}-{version}.data/data/ inside the wheel, and are written to the root of the venv on installation, alongside pyvenv.cfg.
According to the PyPA specification the {package}-{ver}.data directory can contain other directories: (purelib|platlib|headers|scripts|data)
I have use cases for writing to both the purelib and scripts directories too, in various projects:
purelib- I have a.pthfile I'd like to write here to install a monkey patchscripts- I have shell scripts to write here, as well as some legacy Python scripts that useif __name__ == '__main__'or no guard at all.
In both cases I'm having to fall back to setuptools, which is awkward because it drops all of the convenience and good opinions of flit (I'm providing technology in a corporate environment and less divergence is good.)
The structure of the config keys is a bit awkward because ideally it would be
[tool.flit.external-data]
data = "data"
purelib = "purelib"
scripts = "purelib"but the current schema is tool.flit.external-data.directory not tool.flit.external-data.data. It would be possible just to add other keys, or add data as an alias for directory (but disallow both).
For comparison, uv_build supports this feature already, it's
[tool.uv.build-backend.data]
scripts = "scripts"However uv_build doesn't support project.dynamic so I would prefer to continue using flit.