maturin-action icon indicating copy to clipboard operation
maturin-action copied to clipboard

bug: parsing of compatible release clause

Open ddelange opened this issue 1 year ago • 3 comments

Setting maturin~=1.0 (compatible release clause equivalent to maturin>=1.0,<2) in pyproject.toml will result in maturin-action picking v1.0.1 instead of v1.7.1.

Quick fix for users: https://github.com/ddelange/blake3-py/pull/1/commits/2d56b535f32ae61bffb80d974db8bb039bebf56e

Found during development: https://github.com/oconnor663/blake3-py/pull/45

ddelange avatar Sep 23 '24 19:09 ddelange

This is actually a known issue because the version spec in Python isn't standard semver.

messense avatar Sep 25 '24 01:09 messense

yeah, tell me about it... many small struggles in pipgrip 😄

easiest way to go from ~=1.0 to 1.7.2 is to parse the json output from this command:

pip install -q --dry-run --report - --no-deps --ignore-installed -- maturin~=1.0

ddelange avatar Sep 25 '24 05:09 ddelange

@messense would it make sense to fail hard when ~= is encountered?

or just manually translate ~=x.y to >=x.y.0,<x+1 and ~=x.y.z to >=x.y.z,<x.y+1 during the parsing? note that you could also encounter e.g. ~=1.0,!=1.1.3

ddelange avatar Mar 04 '25 12:03 ddelange