Add support for --no-strip-markers in pip compile output (#4503)

## Summary

This is an intermediary change in enabling universal resolution for
`requirements.txt` files. To start, we need to be able to preserve
markers in the `requirements.txt` output _and_ propagate those markers,
such that if you have a dependency that's only included with a given
marker, the transitive dependencies respect that marker too.

Closes #1429.
This commit is contained in:
Charlie Marsh 2024-06-25 16:55:58 -04:00 committed by GitHub
parent af1f1369e5
commit 5732209be3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 488 additions and 133 deletions

View file

@ -413,6 +413,16 @@ pub struct PipCompileArgs {
#[arg(long, overrides_with("no_strip_extras"), hide = true)]
pub strip_extras: bool,
/// Include environment markers in the output file.
///
/// By default, `uv` strips environment markers, as the resolution generated by `compile` is
/// only guaranteed to be correct for the target environment.
#[arg(long, overrides_with("strip_markers"))]
pub no_strip_markers: bool,
#[arg(long, overrides_with("no_strip_markers"), hide = true)]
pub strip_markers: bool,
/// Exclude comment annotations indicating the source of each package.
#[arg(long, overrides_with("annotate"))]
pub no_annotate: bool,