From c6ba4844b3d9ea980886703e27cbfb26b65d3d8f Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Tue, 30 Jul 2024 08:38:58 -0400 Subject: [PATCH 1/3] specialize wheel resource handling Signed-off-by: William Woodruff --- Library/Homebrew/language/python.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/language/python.rb b/Library/Homebrew/language/python.rb index a8006ac5ea..312399ca66 100644 --- a/Library/Homebrew/language/python.rb +++ b/Library/Homebrew/language/python.rb @@ -365,7 +365,9 @@ module Language def pip_install(targets, build_isolation: true) targets = Array(targets) targets.each do |t| - if t.is_a?(Resource) + if t.is_a?(Resource) && t.url.end_with?("-none-any.whl") + t.stage { do_install(Pathname.pwd/t.downloader.basename, build_isolation:) } + elsif t.is_a?(Resource) t.stage { do_install(Pathname.pwd, build_isolation:) } else t = t.lines.map(&:strip) if t.is_a?(String) && t.include?("\n") From 9804e58ceb2771a2b2f6b0a9eb285653231a7401 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Tue, 30 Jul 2024 09:51:33 -0400 Subject: [PATCH 2/3] python: don't assume resources have URLs Signed-off-by: William Woodruff --- Library/Homebrew/language/python.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/language/python.rb b/Library/Homebrew/language/python.rb index 312399ca66..431a0ed934 100644 --- a/Library/Homebrew/language/python.rb +++ b/Library/Homebrew/language/python.rb @@ -365,7 +365,7 @@ module Language def pip_install(targets, build_isolation: true) targets = Array(targets) targets.each do |t| - if t.is_a?(Resource) && t.url.end_with?("-none-any.whl") + if t.is_a?(Resource) && t.url&.end_with?("-none-any.whl") t.stage { do_install(Pathname.pwd/t.downloader.basename, build_isolation:) } elsif t.is_a?(Resource) t.stage { do_install(Pathname.pwd, build_isolation:) } From 575592d7f9846ce050310c3bf153fc9cc0e62556 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Tue, 30 Jul 2024 11:38:07 -0400 Subject: [PATCH 3/3] Update Library/Homebrew/language/python.rb Co-authored-by: Bo Anderson --- Library/Homebrew/language/python.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/language/python.rb b/Library/Homebrew/language/python.rb index 431a0ed934..05a4ef5915 100644 --- a/Library/Homebrew/language/python.rb +++ b/Library/Homebrew/language/python.rb @@ -365,10 +365,12 @@ module Language def pip_install(targets, build_isolation: true) targets = Array(targets) targets.each do |t| - if t.is_a?(Resource) && t.url&.end_with?("-none-any.whl") - t.stage { do_install(Pathname.pwd/t.downloader.basename, build_isolation:) } - elsif t.is_a?(Resource) - t.stage { do_install(Pathname.pwd, build_isolation:) } + if t.is_a?(Resource) + t.stage do + target = Pathname.pwd + target /= t.downloader.basename if t.url&.end_with?("-none-any.whl") + do_install(target, build_isolation:) + end else t = t.lines.map(&:strip) if t.is_a?(String) && t.include?("\n") do_install(t, build_isolation:)