Skip to content

Commit

Permalink
uv/tests: only consider dependency specification for fork matching ma…
Browse files Browse the repository at this point in the history
…rker

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.
  • Loading branch information
BurntSushi committed Aug 7, 2024
1 parent b9949f0 commit 1280ca7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions crates/uv/tests/pip_compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
"###
);

Expand Down

0 comments on commit 1280ca7

Please sign in to comment.