mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 21:35:00 +00:00
![]() A couple moons ago, I introduced an optimization for version comparisons by devising a format where *most* versions would be represented by a single `u64`. This in turn meant most comparisons (of which many are done during resolution) would be extremely cheap. Unfortunately, when I did that, I screwed up the preservation of ordering as defined by the [Version Specifiers spec]. I think I messed it up because I had originally devised the representation so that we could pack things like `1.2.3.dev1.post5`, but later realized it would be better to limit ourselves to a single suffix. However, I never updated the binary encoding to better match "up to 4 release versions and up to precisely 1 suffix." Because of that, there were cases where versions weren't ordered correctly. For example, this fixes a bug where `1.0a2 < 1.0dev2`, even though all dev releases should order before pre-releases. We also update a test so that it catches these kinds of bugs in the future. (By testing all pairs of versions in a sequence instead of just the adjacent versions.) [Version Specifiers spec]: https://packaging.python.org/en/latest/specifications/version-specifiers/#summary-of-permitted-suffixes-and-relative-ordering |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |