python: support pypy3
This commit is contained in:
parent
27ec98dfd1
commit
46af0260f0
@ -14,7 +14,7 @@ module Language
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.site_packages(python = "python3.7")
|
def self.site_packages(python = "python3.7")
|
||||||
if python == "pypy"
|
if (python == "pypy") || (python == "pypy3")
|
||||||
"site-packages"
|
"site-packages"
|
||||||
else
|
else
|
||||||
"lib/python#{major_minor_version python}/site-packages"
|
"lib/python#{major_minor_version python}/site-packages"
|
||||||
@ -23,7 +23,11 @@ module Language
|
|||||||
|
|
||||||
def self.each_python(build, &block)
|
def self.each_python(build, &block)
|
||||||
original_pythonpath = ENV["PYTHONPATH"]
|
original_pythonpath = ENV["PYTHONPATH"]
|
||||||
{ "python@3" => "python3", "python@2" => "python2.7", "pypy" => "pypy" }.each do |python_formula, python|
|
pythons = { "python@3" => "python3",
|
||||||
|
"python@2" => "python2.7",
|
||||||
|
"pypy" => "pypy",
|
||||||
|
"pypy3" => "pypy3" }
|
||||||
|
pythons.each do |python_formula, python|
|
||||||
python_formula = Formulary.factory(python_formula)
|
python_formula = Formulary.factory(python_formula)
|
||||||
next if build.without? python_formula.to_s
|
next if build.without? python_formula.to_s
|
||||||
|
|
||||||
@ -147,7 +151,7 @@ module Language
|
|||||||
def virtualenv_install_with_resources(options = {})
|
def virtualenv_install_with_resources(options = {})
|
||||||
python = options[:using]
|
python = options[:using]
|
||||||
if python.nil?
|
if python.nil?
|
||||||
wanted = %w[python python@2 python2 python3 python@3 pypy].select { |py| needs_python?(py) }
|
wanted = %w[python python@2 python2 python3 python@3 pypy pypy3].select { |py| needs_python?(py) }
|
||||||
raise FormulaAmbiguousPythonError, self if wanted.size > 1
|
raise FormulaAmbiguousPythonError, self if wanted.size > 1
|
||||||
|
|
||||||
python = wanted.first || "python2.7"
|
python = wanted.first || "python2.7"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user