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
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ percent-encoding = { version = "2.3.1" }
petgraph = { version = "0.8.0" }
proc-macro2 = { version = "1.0.86" }
procfs = { version = "0.17.0", default-features = false, features = ["flate2"] }
pubgrub = { git = "https://github.com/astral-sh/pubgrub", rev = "a3b4db3abb1829ce889fb89fa6d157fef529ef7e" }
pubgrub = { git = "https://github.com/astral-sh/pubgrub", rev = "73d6ecf5a4e4eb1c754b8c3255c4d31bdc266fdb" }
quote = { version = "1.0.37" }
rayon = { version = "1.10.0" }
reflink-copy = { version = "0.1.19" }
Expand Down Expand Up @@ -180,7 +180,7 @@ tracing-tree = { version = "0.4.0" }
unicode-width = { version = "0.2.0" }
unscanny = { version = "0.1.0" }
url = { version = "2.5.2", features = ["serde"] }
version-ranges = { git = "https://github.com/astral-sh/pubgrub", rev = "a3b4db3abb1829ce889fb89fa6d157fef529ef7e" }
version-ranges = { git = "https://github.com/astral-sh/pubgrub", rev = "73d6ecf5a4e4eb1c754b8c3255c4d31bdc266fdb" }
walkdir = { version = "2.5.0" }
which = { version = "7.0.0", features = ["regex"] }
windows-registry = { version = "0.5.0" }
Expand Down
89 changes: 89 additions & 0 deletions crates/uv/tests/it/pip_compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17403,3 +17403,92 @@ fn compile_broken_active_venv() -> Result<()> {

Ok(())
}

/// <https://github.com/astral-sh/uv/issues/13344>
#[test]
fn pubgrub_panic_double_self_dependency() -> Result<()> {
let context = TestContext::new("3.12");
context
.temp_dir
.child("pyproject.toml")
.write_str(indoc! {r#"
[project]
name = "foo"
version = "0.1.0"
dependencies = [
"foo",
"foo",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just for completeness sake, can you imagine a scenario where you have foo and a double self dependency foo[extra-bar] that also has an extra with it?

]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
"#})?;

let requirements_in = context.temp_dir.child("requirements.in");
requirements_in.write_str(".")?;

uv_snapshot!(context.filters(), context
.pip_compile()
.arg(requirements_in.path()), @r"
success: true
exit_code: 0
----- stdout -----
# This file was autogenerated by uv via the following command:
# uv pip compile --cache-dir [CACHE_DIR] [TEMP_DIR]/requirements.in
.
# via -r requirements.in

----- stderr -----
Resolved 1 package in [TIME]
");

Ok(())
}

/// <https://github.com/astral-sh/uv/issues/13344>
#[test]
fn pubgrub_panic_double_self_dependency_extra() -> Result<()> {
let context = TestContext::new("3.12");
context
.temp_dir
.child("pyproject.toml")
.write_str(indoc! {r#"
[project]
name = "foo"
version = "0.1.0"
dependencies = [
"foo[test]",
"foo[test]",
]

[project.optional-dependencies]
test = ["iniconfig"]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
"#})?;

let requirements_in = context.temp_dir.child("requirements.in");
requirements_in.write_str(".")?;

uv_snapshot!(context.filters(), context
.pip_compile()
.arg(requirements_in.path()), @r"
success: true
exit_code: 0
----- stdout -----
# This file was autogenerated by uv via the following command:
# uv pip compile --cache-dir [CACHE_DIR] [TEMP_DIR]/requirements.in
.
# via -r requirements.in
iniconfig==2.0.0
# via foo

----- stderr -----
Resolved 2 packages in [TIME]
");

Ok(())
}
Loading