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 2, 2024
1 parent 19c199c commit 9a3d51f
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 @@ -7676,7 +7676,9 @@ fn universal_overlapping_prerelease_requirement() -> Result<()> {
----- stdout -----
# This file was autogenerated by uv via the following command:
# uv pip compile --cache-dir [CACHE_DIR] requirements.in --universal
cffi==1.17.0rc1
cffi==1.16.0 ; os_name != 'Linux'
# via -r requirements.in
cffi==1.17.0rc1 ; os_name == 'Linux'
# via
# -r requirements.in
# example
Expand All @@ -7686,7 +7688,7 @@ fn universal_overlapping_prerelease_requirement() -> Result<()> {
# via cffi
----- stderr -----
Resolved 3 packages in [TIME]
Resolved 4 packages in [TIME]
"###
);

Expand Down

0 comments on commit 9a3d51f

Please sign in to comment.