uv/crates/uv-python/python/packaging
Charles Tapley Hoyt 3ee8028bb4
Improve performance of uv-python crate's manylinux submodule (#11131)
## Summary

This PR makes a few performance improvements:

1. Reduces the need to unpack and repack a `_GLibCVersion` tuple
2. Reduces the doubled call to `_is_compatible(arch, glibc_version)`
3. Moves the assignment of the `tag` variable directly into the yield,
reducing memory allocation in case this is never used when
`_is_compatible(arch, glibc_version)` is false
4. Combines the check of the `glibc_version` being in
`_LEGACY_MANYLINUX_MAP` and the assignment to the variable together. I'm
not sure if this is actually better, but using the assignment expression
reduces this from 4 lines to 2

## Test Plan

I upstreamed these changes in
https://github.com/pypa/packaging/pull/869. Otherwise, I'm pretty
confident this is a minor change that works the same
2025-05-28 15:09:20 +02:00
..
__init__.py Change "toolchain" to "python" (#4735) 2024-07-03 07:44:29 -05:00
_elffile.py Change "toolchain" to "python" (#4735) 2024-07-03 07:44:29 -05:00
_manylinux.py Improve performance of uv-python crate's manylinux submodule (#11131) 2025-05-28 15:09:20 +02:00
_musllinux.py Change "toolchain" to "python" (#4735) 2024-07-03 07:44:29 -05:00
LICENSE.APACHE Change "toolchain" to "python" (#4735) 2024-07-03 07:44:29 -05:00
LICENSE.BSD Change "toolchain" to "python" (#4735) 2024-07-03 07:44:29 -05:00
README.md Change "toolchain" to "python" (#4735) 2024-07-03 07:44:29 -05:00

pypa/packaging

This directory contains vendored pypa/packaging modules as of cc938f984bbbe43c5734b9656c9837ab3a28191f.

The files are licensed under BSD-2-Clause OR Apache-2.0.