Skip to content

Stable order for virtual packages#10024

Merged
konstin merged 1 commit intomainfrom
konsti/pubgrub-priorities
Dec 20, 2024
Merged

Stable order for virtual packages#10024
konstin merged 1 commit intomainfrom
konsti/pubgrub-priorities

Conversation

@konstin
Copy link
Member

@konstin konstin commented Dec 19, 2024

uv gives priorities to packages by package name, not by virtual package (PubGrubPackage). pubgrub otoh when prioritizing order the virtual packages. When the order of virtual packages changes, uv changes its resolutions and error messages. This means uv was depending on implementation details of pubgrub's prioritization caching.

This broke with pubgrub-rs/pubgrub#299, which added a tiebreaker term that made pubgrub's sorting deterministic given a deterministic ordering of allocating the packages (which happens the first time pubgrub sees a package).

The new custom tiebreaker decreases the difference to upstream pubgrub.

@konstin konstin added the resolver Related to the package resolver label Dec 19, 2024
@konstin
Copy link
Member Author

konstin commented Dec 19, 2024

For transformers, the difference comes from fsspec and datasets being mutually incompatible. Using just the two packages as input we can coerce both versions, which now appear in different, hence the slightly larger lockfile.

8,9c8,9
< datasets==2.20.0
< dill==0.3.8
---
> datasets==2.14.4
> dill==0.3.7
12c12
< fsspec==2024.5.0
---
> fsspec==2024.6.1
16c16
< multiprocess==0.70.16
---
> multiprocess==0.70.15
21d20
< pyarrow-hotfix==0.6

@konstin konstin marked this pull request as ready for review December 19, 2024 15:26
@konstin konstin force-pushed the konsti/pubgrub-priorities branch from d0c7e9a to 5b6e41a Compare December 19, 2024 15:29
@konstin konstin force-pushed the konsti/pubgrub-priorities branch from 5b6e41a to 9370247 Compare December 20, 2024 09:15
@konstin konstin enabled auto-merge (squash) December 20, 2024 09:16
@konstin konstin merged commit ae659c8 into main Dec 20, 2024
@konstin konstin deleted the konsti/pubgrub-priorities branch December 20, 2024 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

resolver Related to the package resolver

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants