Merge pull request #3903 from ilovezfs/python-virtualenv-invoke-python-with-versioned-name

virtualenv_install_with_resources: invoke python with versioned name.
This commit is contained in:
ilovezfs 2018-03-09 14:54:42 -08:00 committed by GitHub
commit 06339ee007
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -135,9 +135,10 @@ module Language
def virtualenv_install_with_resources(options = {})
python = options[:using]
if python.nil?
wanted = %w[python python@2 python2 python3].select { |py| needs_python?(py) }
wanted = %w[python python@2 python2 python3 python@3].select { |py| needs_python?(py) }
raise FormulaAmbiguousPythonError, self if wanted.size > 1
python = wanted.first || "python"
python = wanted.first || "python2.7"
python = "python3" if python == "python"
end
venv = virtualenv_create(libexec, python.delete("@"))
venv.pip_install resources