diff --git a/Library/Homebrew/language/python.rb b/Library/Homebrew/language/python.rb index 71c77442c3..aa62727bcd 100644 --- a/Library/Homebrew/language/python.rb +++ b/Library/Homebrew/language/python.rb @@ -399,7 +399,7 @@ module Language if t.is_a?(Resource) t.stage do 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:) end else diff --git a/Library/Homebrew/utils/pypi.rb b/Library/Homebrew/utils/pypi.rb index a0d99f3fc9..cb3279ad6d 100644 --- a/Library/Homebrew/utils/pypi.rb +++ b/Library/Homebrew/utils/pypi.rb @@ -82,10 +82,10 @@ module PyPI url["packagetype"] == "sdist" 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? dist = json["urls"].find do |url| - url["filename"].end_with?("-none-any.whl") + url["filename"].match?("[.-]py3[^-]*-none-any.whl$") end end