-
Notifications
You must be signed in to change notification settings - Fork 752
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
Specifying external dependencies in pyproject.toml #7079
Comments
I just now realise that currently uv doesn't have a build backend and uses hatchling, this question might be better suited to be asked on hatchling's repository. If I find out how to solve my problem though there I'll report back here for reference |
In case anyone is wondering how to do this, I solve my issue using a hatchling build hook, I might turn this into a plugin if I get the time:
|
For reference, I've made it into a plugin for this: https://pypi.org/project/hatch-external-dependencies/ |
Introduction
There currently exists a draft proposing a way to declare external dependencies in pyproject,toml: https://peps.python.org/pep-0725/
For example in some of my project I specify the following section in my pyproject.toml:
What I expect this will do is add a line in the PKG-INFO file of my build packages as specified here: https://packaging.python.org/en/latest/specifications/core-metadata/#requires-external-multiple-use
Currently no build system properly handle this. Since I was using poetry I made a poetry plugin that takes care of detecting this section and adding the relevant line in PKG-INFO during build: https://pypi.org/project/poetry-external-dependencies/
Then when deploying my package to different system I use a script that detect the external dependency and install what's required on the host system, in the example case it would automatically install
ffmpeg
using apt or apk or other package manager the system offer. Something like the following:The question
I've started to transition my package to uv. How can I have the
Requires-External
line added to the PGK-INFO at build time ? Does uv support some form of plugin ? If not what can I do to have it work ?The text was updated successfully, but these errors were encountered: