Allow dependency metadata entries for direct URL requirements (#7846)

## Summary

This is part of making
https://github.com/astral-sh/uv/issues/7299#issuecomment-2385286341
better. You can now use `tool.uv.dependency-metadata` for direct URL
requirements. Unfortunately, you _must_ include a version, since we need
one to perform resolution.
This commit is contained in:
Charlie Marsh 2024-10-22 22:01:23 -04:00 committed by GitHub
parent d6d6de8769
commit cc734ea2b6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 341 additions and 28 deletions

View file

@ -855,3 +855,9 @@ You could run the following sequence of commands to sync `flash-attn`:
$ uv sync --extra build
$ uv sync --extra build --extra compile
```
!!! note
The `version` field in `tool.uv.dependency-metadata` is optional for registry-based
dependencies (when omitted, uv will assume the metadata applies to all versions of the package),
but _required_ for direct URL dependencies (like Git dependencies).

View file

@ -313,6 +313,12 @@ package's metadata is incorrect or incomplete, or when a package is not availabl
index. While dependency overrides allow overriding the allowed versions of a package globally,
metadata overrides allow overriding the declared metadata of a _specific package_.
!!! note
The `version` field in `tool.uv.dependency-metadata` is optional for registry-based
dependencies (when omitted, uv will assume the metadata applies to all versions of the package),
but _required_ for direct URL dependencies (like Git dependencies).
Entries in the `tool.uv.dependency-metadata` table follow the
[Metadata 2.3](https://packaging.python.org/en/latest/specifications/core-metadata/) specification,
though only `name`, `version`, `requires-dist`, `requires-python`, and `provides-extra` are read by