Closed TheRealBecks closed 1 month ago
The issue is that uv sync
tries to resolve for all platforms -- it's materially different than uv pip compile
which by default only resolves for the current platform. It seems that newer versions of ansible-lint
don't support Windows and require WSL instead, so we end up backtracking to a version that does work.
You can add:
[tool.uv]
environments = ["platform_system != 'Windows'"]
...to only solve for non-Windows, which will give you the version you expect.
Alternatively, you can add:
[tool.uv]
environments = ["platform_system != 'Windows'", "platform_system == 'Windows'"]
...to solve for non-Windows, then Windows (in that order), which will also give you the version you expect on non-Windows while resolving to a different version on Windows.
That's really interesting to know, thanks for the solution!
The command uv pip compile
shows the dependency and therefore why a specific version has been choosen. Would it also be an idea to show that a specific system lead to that version (if some system is behind all other systems)?
Edit: Because until now I compiled several projects, but didn't saw that one system is leading to a downgraded version.
I don't know if we have a great way to communicate it after the resolution itself unfortunately.
In the future we may add a setting (#7190) that could help here, by specifying that you want the latest version on each platform rather than a version that works on all platforms.
I use the current version
0.4.12
, but I initially compiled my packages with0.4.8
and upgraded and synced since then sometimes, but I had an issue withainsible-lint
since the introduction ofuv
, but until now I didn't know why. But now I found out thatuv
is installing a very old version of the package.That's my
pyproject.toml
:--> I hardcoded the Python to
>=3.12.5,<3.13
uv sync --extra dev --verbose
produces the following versions:The package resolution
ansible-lint==6.8.7
is wrong as we can see withuv pip compile --extra dev pyproject.toml
that producesansible-lint==24.9.0
:Where does that version
6.8.7
come from? Is it expected thatuv sync
anduv pip compile
produce different package versions?