Add uv export support for PEP 751 (#12955)

## Summary

This PR adds `uv export` support for [PEP
751](https://peps.python.org/pep-0751). We don't yet expose a way to
consume the generated lockfile, but it's a first step.

The logic to go from `uv.lock` to "flat set of packages to include, with
markers telling us when to include them" is all shared with the
`requirements.txt` export (and extracted in
https://github.com/astral-sh/uv/pull/12956). So most of the code is just
converting from our internal types to the PEP 751 schema.
This commit is contained in:
Charlie Marsh 2025-04-21 17:21:17 -04:00 committed by GitHub
parent 9484e3663c
commit d8cea2fd49
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 1413 additions and 39 deletions

View file

@ -3763,7 +3763,7 @@ pub struct TreeArgs {
pub struct ExportArgs {
/// The format to which `uv.lock` should be exported.
///
/// At present, only `requirements-txt` is supported.
/// Supports both `requirements.txt` and `pylock.toml` (PEP 751) output formats.
#[arg(long, value_enum, default_value_t = ExportFormat::default())]
pub format: ExportFormat,