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 from the header #5032

Merged
merged 1 commit into from
Jul 13, 2024
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions crates/uv/src/commands/pip/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,12 @@ fn cmd(
return Some(None);
}

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

// Always skip the `--quiet` flag.
if arg == "--quiet" || arg == "-q" {
*skip_next = None;
Expand Down
6 changes: 3 additions & 3 deletions crates/uv/tests/pip_compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4748,7 +4748,7 @@ fn upgrade_package() -> Result<()> {
exit_code: 0
----- stdout -----
# This file was autogenerated by uv via the following command:
# uv pip compile --cache-dir [CACHE_DIR] requirements.in --output-file requirements.txt --upgrade-package click
# uv pip compile --cache-dir [CACHE_DIR] requirements.in --output-file requirements.txt
black==23.10.1
# via -r requirements.in
click==8.1.7
Expand Down Expand Up @@ -4794,7 +4794,7 @@ fn upgrade_constraint() -> Result<()> {
exit_code: 0
----- stdout -----
# This file was autogenerated by uv via the following command:
# uv pip compile --cache-dir [CACHE_DIR] requirements.in --output-file requirements.txt --upgrade-package iniconfig<2
# uv pip compile --cache-dir [CACHE_DIR] requirements.in --output-file requirements.txt
iniconfig==1.1.1
# via -r requirements.in

Expand All @@ -4813,7 +4813,7 @@ fn upgrade_constraint() -> Result<()> {
exit_code: 0
----- stdout -----
# This file was autogenerated by uv via the following command:
# uv pip compile --cache-dir [CACHE_DIR] requirements.in --output-file requirements.txt --upgrade-package iniconfig
# uv pip compile --cache-dir [CACHE_DIR] requirements.in --output-file requirements.txt
iniconfig==2.0.0
# via -r requirements.in

Expand Down
Loading