Closed tmct closed 1 week ago
Thanks for the report!
@konstin you marked this as an enhancement, is this not a bug?
cc @charliermarsh
We already never install those wheels, but we're missing the pruning of the wheels list for platforms. We're currently only prune the wheels list for the python version (#4696), but we can extend this to the platform markers also. It may not work 100% for platform marker them since markers and wheels tags don't have a perfect 1:1 mapping, but we would still trim the lockfile down by a lot.
Thanks for the additional context. Is this hard?
Hard to tell, hopefully it's a just a lookup table and some filtering. Ideally, you create a mapping from a marker to what tags it supports, e.g. sys_platform == 'linux'
-> manylinux
, musllinnux
and linux
, and then filter the wheels by that wheel tag.
This would be a good improvement.
Thanks very much all - would be very happy to see this enhancement - none of the other "universal" lockfile tools seems to support this filtering...
This is a bit more tedious because we don't track "all the markers under which this package could be relevant" in the lockfile directly -- you have to compute it by propagating markers. So at this point in the lockfile:
// Remove wheels that don't match `requires-python` and can't be selected for
// installation.
if let Some(requires_python) = &requires_python {
package
.wheels
.retain(|wheel| requires_python.matches_wheel_tag(&wheel.filename));
}
We'd need to track the supported platforms.
Closed by https://github.com/astral-sh/uv/pull/6957.
Thank you! Though that PR is described as "Prep for fixing https://github.com/astral-sh/uv/issues/6512. No functional changes."?
Ah, now I see the subsequent #6961 and #6959 in the release notes. Very nice
Apologies, I linked the wrong PR!
Hi - I'm very glad to see uv's recent universal locking features, and engagement with the lockfile standard - but I've found one behaviour that seems a little odd.
Perhaps I have misunderstood how environment markers are used in universal resolution, but I am surprised by this behaviour:
Result: I still get plently Windows-specific wheels in my
uv.lock
lockfile, e.g.torch-2.1.0-cp310-cp310-win_amd64.whl
- presumably these have all still been downloaded.Would it be possible please not to download these Mac/Windows-only wheels for linux-only universal locks, as an example?
Many thanks, Tom