-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Allow uv pip sync
to clear an environment with opt-in
#4517
Conversation
crates/uv-cli/src/lib.rs
Outdated
|
||
/// Allow sync of empty requirements, which will clear the environment of all packages. | ||
#[arg(long, overrides_with("no_allow_empty_requirements"))] | ||
pub allow_empty_requirements: bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer --allow-empty
, I don't think it's ambiguous.
I think this also needs to be added to the PipOptions
and respected in persistent configuration, and it should probably be accepted on pip install
too? Though not sure what it would mean in that case so maybe not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If pip install
exits with success when the requirements are empty I don't think it would mean anything there.
I can shorten it, though I find it a bit ambiguous.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it makes sense to include in the persistent configuration too? It only seems relevant for this command though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it should be in the persistent configuration -- that's the contract for the pip
table (e.g., it includes things that only apply to pip-compile
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find --allow-empty-requirements
to be more verbose than necessary but not a strong opinion, it's fine.
@zanieb - I'll add to config and merge. |
@charliermarsh thanks! |
Sorry got too excited |
15e9dc7
to
a361c69
Compare
Closes #4516
Open to some deliberation about the opt-in strategy here.