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/src/commands/project/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ async fn lock_and_sync(
let default_groups = default_dependency_groups(project.pyproject_toml())?;
let default_extras = DefaultExtras::default();
let groups = DependencyGroups::default().with_defaults(default_groups);
let extras = ExtrasSpecification::from_all_extras().with_defaults(default_extras);
let extras = ExtrasSpecification::default().with_defaults(default_extras);
let install_options = InstallOptions::default();

// Convert to an `AddTarget` by attaching the appropriate interpreter or environment.
Expand Down
54 changes: 54 additions & 0 deletions crates/uv/tests/it/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1958,3 +1958,57 @@ fn version_set_evil_constraints() -> Result<()> {

Ok(())
}

/// Bump the version with conflicting extras, to ensure we're activating the correct subset of
/// extras during the resolve.
#[test]
fn version_extras() -> Result<()> {
let context = TestContext::new("3.12");

let pyproject_toml = context.temp_dir.child("pyproject.toml");
pyproject_toml.write_str(
r#"
[project]
name = "myproject"
version = "1.10.31"
requires-python = ">=3.12"

[project.optional-dependencies]
foo = ["requests"]
bar = ["httpx"]
baz = ["flask"]

[tool.uv]
conflicts = [[{"extra" = "foo"}, {"extra" = "bar"}]]
"#,
)?;

uv_snapshot!(context.filters(), context.version()
.arg("--bump").arg("patch"), @r"
success: true
exit_code: 0
----- stdout -----
myproject 1.10.31 => 1.10.32

----- stderr -----
Resolved 19 packages in [TIME]
Audited in [TIME]
");

// Sync an extra, we should not remove it.
context.sync().arg("--extra").arg("foo").assert().success();

uv_snapshot!(context.filters(), context.version()
.arg("--bump").arg("patch"), @r"
success: true
exit_code: 0
----- stdout -----
myproject 1.10.32 => 1.10.33

----- stderr -----
Resolved 19 packages in [TIME]
Audited in [TIME]
");

Ok(())
}
Loading