From 2c378249aaeb24626d5fdda5b7ab0fcecf655b24 Mon Sep 17 00:00:00 2001 From: Tom Forbes Date: Sat, 10 Dec 2022 15:00:42 +0000 Subject: [PATCH 1/2] Allow pip to use the local wheel cache while installing dependencies --- 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 3383b391aa..8087bbe9ed 100644 --- a/Library/Homebrew/language/python.rb +++ b/Library/Homebrew/language/python.rb @@ -304,7 +304,7 @@ module Language def do_install(targets) targets = Array(targets) @formula.system @venv_root/"bin/pip", "install", - "-v", "--no-deps", "--no-binary", ":all:", + "-v", "--no-deps", "--use-feature=no-binary-enable-wheel-cache", "--ignore-installed", *targets end end From 173e6bf1d3cdd1b02db71eb61cca5baa764abb30 Mon Sep 17 00:00:00 2001 From: Tom Forbes Date: Sat, 10 Dec 2022 15:02:18 +0000 Subject: [PATCH 2/2] Fix tests --- .../Homebrew/test/language/python/virtualenv_spec.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Library/Homebrew/test/language/python/virtualenv_spec.rb b/Library/Homebrew/test/language/python/virtualenv_spec.rb index c4fae41d62..52c28f91f5 100644 --- a/Library/Homebrew/test/language/python/virtualenv_spec.rb +++ b/Library/Homebrew/test/language/python/virtualenv_spec.rb @@ -25,7 +25,7 @@ describe Language::Python::Virtualenv::Virtualenv, :needs_python do it "accepts a string" do expect(formula).to receive(:system) .with(dir/"bin/pip", "install", "-v", "--no-deps", - "--no-binary", ":all:", "--ignore-installed", "foo") + "--use-feature=no-binary-enable-wheel-cache", "--ignore-installed", "foo") .and_return(true) virtualenv.pip_install "foo" end @@ -33,7 +33,7 @@ describe Language::Python::Virtualenv::Virtualenv, :needs_python do it "accepts a multi-line strings" do expect(formula).to receive(:system) .with(dir/"bin/pip", "install", "-v", "--no-deps", - "--no-binary", ":all:", "--ignore-installed", "foo", "bar") + "--use-feature=no-binary-enable-wheel-cache", "--ignore-installed", "foo", "bar") .and_return(true) virtualenv.pip_install <<~EOS @@ -45,12 +45,12 @@ describe Language::Python::Virtualenv::Virtualenv, :needs_python do it "accepts an array" do expect(formula).to receive(:system) .with(dir/"bin/pip", "install", "-v", "--no-deps", - "--no-binary", ":all:", "--ignore-installed", "foo") + "--use-feature=no-binary-enable-wheel-cache", "--ignore-installed", "foo") .and_return(true) expect(formula).to receive(:system) .with(dir/"bin/pip", "install", "-v", "--no-deps", - "--no-binary", ":all:", "--ignore-installed", "bar") + "--use-feature=no-binary-enable-wheel-cache", "--ignore-installed", "bar") .and_return(true) virtualenv.pip_install ["foo", "bar"] @@ -62,7 +62,7 @@ describe Language::Python::Virtualenv::Virtualenv, :needs_python do expect(res).to receive(:stage).and_yield expect(formula).to receive(:system) .with(dir/"bin/pip", "install", "-v", "--no-deps", - "--no-binary", ":all:", "--ignore-installed", Pathname.pwd) + "--use-feature=no-binary-enable-wheel-cache", "--ignore-installed", Pathname.pwd) .and_return(true) virtualenv.pip_install res