diff --git a/crates/uv/tests/it/lock.rs b/crates/uv/tests/it/lock.rs index 190e338ed1df..7ed90cb0673b 100644 --- a/crates/uv/tests/it/lock.rs +++ b/crates/uv/tests/it/lock.rs @@ -19009,3 +19009,47 @@ fn lock_recursive_extra() -> Result<()> { Ok(()) } + +/// Don't show an unpinned lower bound warning if the package was provided both by name and by URL, +/// or if the package was part of a constraints files. +/// +/// See , the original example was: +/// ``` +/// uv pip install dist/pymatgen-2024.10.3.tar.gz pymatgen[ci,optional] --resolution=lowest +/// ``` +#[test] +fn no_lowest_warning_with_name_and_url() -> Result<()> { + let context = TestContext::new("3.12"); + + let pyproject_toml = context.temp_dir.child("pyproject.toml"); + pyproject_toml.write_str( + r#" + [project] + name = "project" + version = "0.1.0" + requires-python = ">=3.12" + dependencies = [ + "anyio[trio]", + "anyio @ https://files.pythonhosted.org/packages/e6/e3/c4c8d473d6780ef1853d630d581f70d655b4f8d7553c6997958c283039a2/anyio-4.4.0.tar.gz" + ] + + [tool.uv] + constraint-dependencies = [ + "sortedcontainers==2.4.0", + "outcome==1.3.0.post0", + "pycparser==2.20", + ] + "#, + )?; + + uv_snapshot!(context.filters(), context.lock(), @r###" + success: true + exit_code: 0 + ----- stdout ----- + + ----- stderr ----- + Resolved 10 packages in [TIME] + "###); + + Ok(()) +} diff --git a/crates/uv/tests/it/pip_compile.rs b/crates/uv/tests/it/pip_compile.rs index 0feea6cf750d..d0087ebe98f8 100644 --- a/crates/uv/tests/it/pip_compile.rs +++ b/crates/uv/tests/it/pip_compile.rs @@ -13862,73 +13862,6 @@ fn compile_lowest_extra_unpinned_warning() -> Result<()> { Ok(()) } -/// Don't show an unpinned lower bound warning if the package was provided both by name and by URL, -/// or if the package was part of a constraints files. -/// -/// See , the original example was: -/// ``` -/// uv pip install dist/pymatgen-2024.10.3.tar.gz pymatgen[ci,optional] --resolution=lowest -/// ``` -#[test] -fn no_lowest_warning_with_name_and_url() -> Result<()> { - let context = TestContext::new("3.12"); - - let requirements_in = context.temp_dir.child("requirements.in"); - requirements_in.write_str(indoc::indoc! {r" - anyio[trio] - https://files.pythonhosted.org/packages/e6/e3/c4c8d473d6780ef1853d630d581f70d655b4f8d7553c6997958c283039a2/anyio-4.4.0.tar.gz - "})?; - let constraints = context.temp_dir.child("constraints.txt"); - constraints.write_str(indoc::indoc! {r" - sortedcontainers==2.4.0 - outcome==1.3.0.post0 - pycparser==2.20 - "})?; - - uv_snapshot!(context.filters(), context.pip_compile() - .arg("--resolution") - .arg("lowest") - .arg("--constraints") - .arg(constraints.path()) - .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] --resolution lowest --constraints [TEMP_DIR]/constraints.txt [TEMP_DIR]/requirements.in - anyio @ https://files.pythonhosted.org/packages/e6/e3/c4c8d473d6780ef1853d630d581f70d655b4f8d7553c6997958c283039a2/anyio-4.4.0.tar.gz - # via -r requirements.in - attrs==20.1.0 - # via - # outcome - # trio - idna==2.8 - # via - # anyio - # trio - outcome==1.3.0.post0 - # via - # -c constraints.txt - # trio - sniffio==1.3.0 - # via - # anyio - # trio - sortedcontainers==2.4.0 - # via - # -c constraints.txt - # trio - trio==0.23.0 - # via anyio - - ----- stderr ----- - Resolved 7 packages in [TIME] - "### - ); - - Ok(()) -} - /// Test that we use the version in the source distribution filename for compiling, even if the /// version is declared as dynamic. ///