Skip to content
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
2 changes: 1 addition & 1 deletion crates/uv-cli/src/compat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ impl CompatArgs for PipCompileCompatArgs {

if self.emit_options {
return Err(anyhow!(
"pip-compile's `--emit-options` is unsupported (uv never emits options)"
"pip-compile's `--emit-options` is unsupported (try `--emit-build-options` instead)"
));
}

Expand Down
22 changes: 22 additions & 0 deletions crates/uv/tests/pip_compile/pip_compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6640,6 +6640,28 @@ fn resolver_legacy() -> Result<()> {
Ok(())
}

/// Suggest the supported alternative when users pass `--emit-options` from `pip-compile`.
#[test]
fn emit_options_unsupported() -> Result<()> {
let context = uv_test::test_context!("3.12");
let requirements_in = context.temp_dir.child("requirements.in");
requirements_in.write_str("werkzeug==3.0.1")?;

uv_snapshot!(context.filters(), context.pip_compile()
.arg("requirements.in")
.arg("--emit-options"), @"
success: false
exit_code: 2
----- stdout -----

----- stderr -----
error: pip-compile's `--emit-options` is unsupported (try `--emit-build-options` instead)
"
);

Ok(())
}

/// Avoid including the `--index` and `-i` flags in the header.
#[test]
fn hide_index_urls() -> Result<()> {
Expand Down
Loading