uv
96ce5ca0 - Preserve the version when inserting a missing dot before `*` (#23447)

Commit
2 days ago
Preserve the version when inserting a missing dot before `*` (#23447) With `requests==2.32.3*` in `pyproject.toml`, uv rewrites the requirement to `requests==2.3.*` and can end up installing `2.3.0`. The capture group matches `2.3` twice, but only the last capture makes it into the replacement. We only need to match the last two version components before `*`. This PR captures them once and allows multiple digits in either, so `==2.32.3*` becomes `==2.32.3.*` and `!=12.34*` becomes `!=12.34.*`. When parsing fails, we already apply this fixup to the whole requirement, including [quoted marker values](https://github.com/astral-sh/uv/pull/23447#discussion_r4739094659). Today we can rewrite `'6.1*'` in a marker. With this change we can also rewrite `'6.12*'`. We'll address that separately. Fixes #23406.
Author
Parents
Loading