From 1280ca7bc12240a2179301d8e967646e9b170431 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Wed, 7 Aug 2024 14:41:53 -0400 Subject: [PATCH] uv/tests: only consider dependency specification for fork matching marker The test in this case has this comment: ``` /// If a dependency requests a prerelease version with an overlapping marker expression, /// we should prefer the prerelease version in both forks. ``` With this setup: ``` let pyproject_toml = context.temp_dir.child("pyproject.toml"); pyproject_toml.write_str(indoc! {r#" [project] name = "example" version = "0.0.0" dependencies = [ "cffi >= 1.17.0rc1 ; os_name == 'Linux'" ] requires-python = ">=3.11" "#})?; let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str(indoc! {" cffi . "})?; ``` The change in this commit _seems_ more correct that what we had, although it does seem to contradict the comment. Namely, in the `os_name != "Linux"` fork, we don't prefer the pre-release version since the `cffi >= 1.17.0rc1` bound doesn't apply. It's not quite clear what to do in this instance. --- crates/uv/tests/pip_compile.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/uv/tests/pip_compile.rs b/crates/uv/tests/pip_compile.rs index 87970bf8325b..74a5130988f4 100644 --- a/crates/uv/tests/pip_compile.rs +++ b/crates/uv/tests/pip_compile.rs @@ -7716,13 +7716,15 @@ fn universal_disjoint_prereleases_allow() -> Result<()> { ----- stdout ----- # This file was autogenerated by uv via the following command: # uv pip compile --cache-dir [CACHE_DIR] requirements.in --universal --prerelease allow - cffi==1.16.0rc2 + cffi==1.16.0rc2 ; os_name != 'linux' + # via -r requirements.in + cffi==1.16.0 ; os_name == 'linux' # via -r requirements.in pycparser==2.22 # via cffi ----- stderr ----- - Resolved 2 packages in [TIME] + Resolved 3 packages in [TIME] "### );