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

@ -5,8 +5,8 @@ pub use exclusions::Exclusions;
pub use flat_index::{FlatDistributions, FlatIndex};
pub use fork_strategy::ForkStrategy;
pub use lock::{
Installable, Lock, LockError, LockVersion, Package, PackageMap, RequirementsTxtExport,
ResolverManifest, SatisfiesResult, TreeDisplay, VERSION,
Installable, Lock, LockError, LockVersion, Package, PackageMap, PylockToml,
RequirementsTxtExport, ResolverManifest, SatisfiesResult, TreeDisplay, VERSION,
};
pub use manifest::Manifest;
pub use options::{Flexibility, Options, OptionsBuilder};