Repository navigation
fix: include legacy manylinux aliases in --platform tags - #170
Draft
BrandonLWhite wants to merge 1 commit into
Draft
BrandonLWhite wants to merge 1 commit into
BrandonLWhite wants to merge 1 commit into
Conversation
create_supported_manylinux_platforms normalized the --platform value through LEGACY_MANYLINUX_ALIASES, then emitted only PEP 600 spellings (manylinux_2_N_ARCH). Poetry's chooser matches wheel tags against env.supported_tags by exact string, so a wheel tagged only with a legacy alias never matched: duckdb-extension-httpfs 1.5.5, whose aarch64 wheel is tagged only manylinux2014_aarch64, could not be bundled for --platform manylinux_2_34_aarch64, nor even for --platform manylinux2014_aarch64. Emit each PEP 600 legacy alias (manylinux2014, manylinux2010, manylinux1) right after the tag for the same glibc version, so a wheel built for a newer glibc still ranks first, and at the same glibc version the alias ranks just below the PEP 600 spelling. ai-generated: true Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
poetry bundle venv --platform manylinux_2_34_aarch64cannot install a wheel whose only Linux tag is a legacy manylinux alias, even though PEP 600 definesmanylinux2014_aarch64as an alias formanylinux_2_17_aarch64, which a glibc 2.34 target satisfies.For example,
duckdb-extension-httpfs1.5.5 ships its aarch64 build only aspy3-none-manylinux2014_aarch64, so bundling a project that depends on it fails:Asking for the legacy platform explicitly fails the same way:
--platform manylinux2014_aarch64also rejects amanylinux2014_aarch64wheel.Root cause
create_supported_manylinux_platformsnormalizes the--platformvalue throughLEGACY_MANYLINUX_ALIASES, then emits only PEP 600 spellings:manylinux_2_{N}_{arch}for everyNfrom the requested glibc minor down to 0. Poetry's chooser matches wheel tags againstenv.supported_tagsby exact string, so a wheel tagged only with an alias never matches.PEP 600's reference code applies its alias table to the wheel's tag before comparing. The plugin applied it only to the requested platform.
This went unnoticed because most wheels carry both spellings, for example
manylinux_2_17_x86_64.manylinux2014_x86_64. Every wheel in the existingproject_with_binary_wheelfixture is dual-tagged.Fix
Emit each legacy alias right after the PEP 600 tag for the same glibc version:
manylinux_2_17→manylinux2014manylinux_2_12→manylinux2010manylinux_2_5→manylinux1The alias lookup is the existing
LEGACY_MANYLINUX_ALIASESmap, inverted.The order matters. Poetry's chooser ranks compatible wheels of the same version by their earliest index in
supported_tags. A wheel built for a newer glibc still wins, and at the same glibc version the alias ranks just below the PEP 600 spelling.Aliases are emitted for every architecture, matching how the existing input normalization treats them. An alias that PEP 600 does not define for an architecture, such as
manylinux1_aarch64, matches no wheel, just as the existingmanylinux_2_0_aarch64tag matches none today.Precedent
packaging._manylinux.platform_tagsyields each legacy alias immediately after the PEP 600 tag for the same glibc version. On an aarch64 host with glibc 2.34, its list endsmanylinux_2_18_aarch64, manylinux_2_17_aarch64, manylinux2014_aarch64. So Poetry running on the target host itself would install the httpfs wheel above, and this change makes--platformagree with it.uv pip install --python-platform aarch64-manylinux_2_34 duckdb-extension-httpfs==1.5.5installs themanylinux2014_aarch64wheel (tested with uv 0.12.17). Its tag generator (crates/uv-platform-tags/src/tags.rs) pushesmanylinux2014right aftermanylinux_2_17, commented "Support legacy manylinux tags with lower priority" and citing PEP 600.pip download --platform(26.2.1) matches only the exact tags passed, with no downward glibc expansion and no aliases, so it cannot fetch even amanylinux_2_28wheel for--platform manylinux_2_34_aarch64. That is tracked as a bug in pip doesn't handle PEP600 compatible manylinux wheels when --platform is specified. pypa/pip#10760 (open since 2022; maintainers said they would accept a fix), not as intended behavior.Verification
mypyis clean, and all pre-commit hooks pass.test_create_supported_tags_manylinux_includes_legacy_aliases(new): formanylinux_2_34_aarch64, themanylinux2014_aarch64alias is present for thecp314,abi3andpy3tags.test_create_supported_tags_ranks_legacy_alias_with_its_glibc_version(new):manylinux2014_aarch64sits directly betweenmanylinux_2_17_aarch64andmanylinux_2_16_aarch64.test_create_supported_tags_legacy_manylinux_aliases(extended): the aliases at or below the requested glibc version are present, and newer ones are not. For example,manylinux2010_x86_64does not yieldmanylinux2014_x86_64.poetry bundle venv --without dev --platform manylinux_2_34_aarch64on an x86_64 host, for a Python 3.14 project that depends onduckdb==1.5.5andduckdb-extension-httpfs==1.5.5.manylinux_2_26_aarch64.manylinux_2_28_aarch64wheel and httpfs'smanylinux2014_aarch64wheel, whose extension binary is an aarch64 ELF.Unable to find installation candidates for duckdb-extension-httpfs (1.5.5).🤖 Generated with Claude Code