the output of uv lock
can change merely by changing the order of requirements in pyproject.toml
#5161
Labels
great writeup
A wonderful example of a quality contribution 💜
lock
Related to universal resolution and locking
The easiest way to reproduce this is with a packse index running, as I discovered this bug with one of our existing scenarios.
Note that this bug exists on
main
, but the output below might be different. The output below was generated with PR #5163.For context, this is the packse scenario we're testing below, named
fork-marker-selection
(the description is perhaps misleading now):First, spin up a packse index:
In another shell, create this
pyproject.toml
:And now lock it, being careful to specify the index URL so that we use packse:
The relevant part of the lock file are the top-level dependencies for
project
:Now, flip the order of the
b
dependencies so thatpyproject.toml
looks like this:Repeat the exact same steps as before to lock it:
(The different number of resolved packages is indeed some ominous foreshadowing here.)
And the relevant part of the lock file now looks like this:
In the former case, it is almost correct, except
a
is conditional on the platform beinglinux
ordarwin
. I believe instead the marker shouldn't even be there (or should evaluate to true for all marker environments). This is possibly a bug in my fix for incomplete markers and likely unrelated to this specific issue of the output changing based on the order of requirements. The main point of the former case is that we select one version that works across all platforms.In the latter, we select two different versions of
a
, each depending on the platform. I believe this also suffers from a similar bug as the first case wherea 0.1.0
's marker should actually besys_platform != 'linux'
, or more likely, a third choice reflecting the part of the universe not covered by the existing marker expressions, which would besys_platform != 'linux' and sys_platform != 'darwin'
. And again, I think this problem occurs because of an issue in my fix for incomplete markers. That's tracked by #5162.But the output depending on the ordering of the requirements is, I believe, a different issue. I haven't fully diagnosed why this is occurring yet. (I believe @konstin predicted the occurrence of this bug.)
The text was updated successfully, but these errors were encountered: