diff --git a/Library/Homebrew/language/python.rb b/Library/Homebrew/language/python.rb index fbfd82b3d0..fc44a7a8b2 100644 --- a/Library/Homebrew/language/python.rb +++ b/Library/Homebrew/language/python.rb @@ -116,9 +116,28 @@ module Language def self.included(base) base.class_eval do resource "homebrew-virtualenv" do - url "https://files.pythonhosted.org/packages/11/74" \ - "/2c151a13ef41ab9fb43b3c4ff9e788e0496ed7923b2078d42cab30622bdf/virtualenv-16.7.4.tar.gz" - sha256 "94a6898293d07f84a98add34c4df900f8ec64a570292279f6d91c781d37fd305" + url "https://files.pythonhosted.org/packages/85/3e/6c3abf78b2207f3565ebadd0b99d1945f4ff18abdc6879617a4f6d939e41/virtualenv-20.0.33.tar.gz" + sha256 "a5e0d253fe138097c6559c906c528647254f437d1019af9d5a477b09bfa7300f" + end + + resource "homebrew-appdirs" do + url "https://files.pythonhosted.org/packages/d7/d8/05696357e0311f5b5c316d7b95f46c669dd9c15aaeecbb48c7d0aeb88c40/appdirs-1.4.4.tar.gz" + sha256 "7d5d0167b2b1ba821647616af46a749d1c653740dd0d2415100fe26e27afdf41" + end + + resource "homebrew-distlib" do + url "https://files.pythonhosted.org/packages/2f/83/1eba07997b8ba58d92b3e51445d5bf36f9fba9cb8166bcae99b9c3464841/distlib-0.3.1.zip" + sha256 "edf6116872c863e1aa9d5bb7cb5e05a022c519a4594dc703843343a9ddd9bff1" + end + + resource "homebrew-filelock" do + url "https://files.pythonhosted.org/packages/14/ec/6ee2168387ce0154632f856d5cc5592328e9cf93127c5c9aeca92c8c16cb/filelock-3.0.12.tar.gz" + sha256 "18d82244ee114f543149c66a6e0c14e9c4f8a1044b5cdaadd0f82159d6a6ff59" + end + + resource "homebrew-six" do + url "https://files.pythonhosted.org/packages/6b/34/415834bfdafca3c5f451532e8a8d9ba89a21c9743a0c59fbd0205c7f9426/six-1.15.0.tar.gz" + sha256 "30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259" end end end @@ -217,6 +236,14 @@ module Language old_pythonpath = ENV.delete "PYTHONPATH" begin staging = Pathname.new(stage.staging.tmpdir) + + ENV.prepend_create_path "PYTHONPATH", staging/"target/vendor"/Language::Python.site_packages(@python) + %w[appdirs distlib filelock six].each do |virtualenv_dependency| + @formula.resource("homebrew-#{virtualenv_dependency}").stage do + @formula.system @python, *Language::Python.setup_install_args(staging/"target/vendor") + end + end + ENV.prepend_create_path "PYTHONPATH", staging/"target"/Language::Python.site_packages(@python) @formula.system @python, *Language::Python.setup_install_args(staging/"target") @formula.system @python, "-s", staging/"target/bin/virtualenv", "-p", @python, @venv_root