Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove incompatible wheels from uv.lock #4799

Merged
merged 1 commit into from
Jul 4, 2024

Conversation

konstin
Copy link
Member

@konstin konstin commented Jul 4, 2024

Remove wheels from the lockfile that don't match the required python version. For example, we remove charset_normalizer-3.3.2-cp311-cp311-win_amd64.whl when we have requires-python = ">=3.12".

Our snapshots barely show changes since we avoid the large binaries for which matters. Here are 3 real world uv.lock before/after comparisons to show the large difference:

We only remove wheels we are certain don't match the python version and still keep those with unknown tags. We could remove even more wheels by also considering other markers, e.g. removing linux wheels for a windows-only dep, but we would trade complex, easy-to-get-wrong logic for diminishing returns.

@konstin konstin added enhancement New feature or request preview Experimental behavior labels Jul 4, 2024
Remove wheels that don't match the required python version from the lockfile. For example, we remove `charset_normalizer-3.3.2-cp311-cp311-win_amd64.whl` when we have `requires-python = ">=3.12"`.

Our snapshots barely show changes since we avoid the large binaries for which matters. Here are 3 real world `uv.lock` before/after comparisons to show the large difference:
* [warehouse](https://gist.github.com/konstin/9a1ed6a32b410e250fcf4c6ea8c536a5) 5677 -> 4214
* [transformers](https://gist.github.com/konstin/5636281b5226f64aa44ce3244d5230cd) 6484 -> 5816
* [github-wikidata-bot](https://gist.github.com/konstin/ebbd7b9474523aaa61d9a8945bc02071) 793 -> 454

We only remove wheels we are certain don't match the python version and still keep those with unknown tags. We could remove even more wheels by also considering other markers, e.g. removing linux wheels for a windows-only dep, but we would trade complex, easy-to-get-wrong logic for diminishing returns.
@konstin konstin force-pushed the konsti/remove-incompatible-wheels branch from d52a647 to 37c9b4e Compare July 4, 2024 11:13
Copy link
Member

@charliermarsh charliermarsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice.

@charliermarsh charliermarsh merged commit 11cb005 into main Jul 4, 2024
47 checks passed
@charliermarsh charliermarsh deleted the konsti/remove-incompatible-wheels branch July 4, 2024 18:03
Copy link
Member

@BurntSushi BurntSushi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request preview Experimental behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants