Merge pull request #19984 from dtrodrigues/py3-whl

utils/pypi: ensure pure Python wheels support py3
This commit is contained in:
William Woodruff 2025-07-16 16:10:58 +00:00 committed by GitHub
commit 46314291ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -399,7 +399,7 @@ module Language
if t.is_a?(Resource) if t.is_a?(Resource)
t.stage do t.stage do
target = Pathname.pwd target = Pathname.pwd
target /= t.downloader.basename if t.url&.end_with?("-none-any.whl") target /= t.downloader.basename if t.url&.match?("[.-]py3[^-]*-none-any.whl$")
do_install(target, build_isolation:) do_install(target, build_isolation:)
end end
else else

View File

@ -82,10 +82,10 @@ module PyPI
url["packagetype"] == "sdist" url["packagetype"] == "sdist"
end end
# If there isn't an sdist, we use the first universal wheel. # If there isn't an sdist, we use the first pure Python3 or universal wheel
if dist.nil? if dist.nil?
dist = json["urls"].find do |url| dist = json["urls"].find do |url|
url["filename"].end_with?("-none-any.whl") url["filename"].match?("[.-]py3[^-]*-none-any.whl$")
end end
end end