Skip to content
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

pip compile: exclude --upgrade-package when option and value are passed as a single argument #5033

Merged
merged 2 commits into from
Jul 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions crates/uv/src/commands/pip/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ fn cmd(

// Skip any `--find-links` URLs, unless requested.
if !include_find_links {
if arg.starts_with("--find-links=") || arg.starts_with("-f=") {
if arg.starts_with("--find-links=") || arg.starts_with("-f") {
// Reset state; skip this iteration.
*skip_next = None;
return Some(None);
Expand All @@ -547,7 +547,14 @@ fn cmd(
return Some(None);
}

// Always skip the `--upgrade-package` flag, and mark the next item as skipped
// Always skip the `--upgrade-package` flag
if arg.starts_with("--upgrade-package=") || arg.starts_with("-P") {
skshetry marked this conversation as resolved.
Show resolved Hide resolved
// Reset state; skip this iteration.
*skip_next = None;
return Some(None);
}

// Mark the next item as (to be) skipped.
if arg == "--upgrade-package" || arg == "-P" {
*skip_next = Some(true);
return Some(None);
Expand Down
Loading