10000 Allow populating (purelib|platlib|headers|scripts) · Issue #741 · pypa/flit · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Allow populating (purelib|platlib|headers|scripts) #741

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
lordmauve opened this issue Mar 28, 2025 · 0 comments
Open

Allow populating (purelib|platlib|headers|scripts) #741

lordmauve opened this issue Mar 28, 2025 · 0 comments

Comments

@lordmauve
Copy link

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 .pth file I'd like to write here to install a monkey patch
  • scripts - I have shell scripts to write here, as well as some legacy Python scripts that use if __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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0