Library/Homebrew/language/python.rb
# Instantiates, creates, and yields a {Virtualenv} object for use from
# {Formula#install}, which provides helper methods for instantiating and
# installing packages into a Python virtualenv.
# @param venv_root [Pathname, String] the path to the root of the virtualenv
#   (often `libexec/"venv"`)
# @param python [String] which interpreter to use (e.g. "python"
#   or "python2")
# @param formula [Formula] the active Formula
# @return [Virtualenv] a {Virtualenv} instance
Instantiates, creates, and yields a {Virtualenv} object for use from
{Formula#install}, which provides helper methods for instantiating and
installing packages into a Python virtualenv.
Instantiates creates and yields a { Virtualenv } object for use from { Formula#install } which provides helper methods for instantiating and installing packages into a Python virtualenv .
def virtualenv_create(venv_root, python = "python", formula = self)
        ENV.refurbish_args
        venv = Virtualenv.new formula, venv_root, python
        venv.create
        formula_deps = formula.recursive_dependencies
        pth_contents = formula_deps.map do |d|
          next if d.build?
          dep_site_packages = Formula[d.name].opt_prefix/Language::Python.site_packages(python)
          next unless dep_site_packages.exist?
          "import site; site.addsitedir('#{dep_site_packages}')\n"
        end.compact
        unless pth_contents.empty?
          (venv_root/Language::Python.site_packages(python)/"homebrew_deps.pth").write pth_contents.join
        end
        venv
      end
def virtualenv_create ( venv_root , python = "python" , formula = self ) ENV . refurbish_args venv = Virtualenv . new formula , venv_root , python venv . create formula_deps = formula . recursive_dependencies pth_contents = formula_deps . map do | d | next if d . build? dep_site_packages = Formula [ d . name ] . opt_prefix / Language :: Python . site_packages ( python ) next unless dep_site_packages . exist? "import site; site.addsitedir('#{dep_site_packages}')\n" end . compact unless pth_contents . empty? ( venv_root / Language :: Python . site_packages ( python ) / "homebrew_deps.pth" ) . write pth_contents . join end venv end
Instantiates, creates, and yields a {Virtualenv} object for use from
{Formula#install}, which provides helper methods for instantiating and
installing packages into a Python virtualenv.
Instantiates creates and yields a { Virtualenv } object for use from { Formula#install } which provides helper methods for instantiating and installing packages into a Python virtualenv .
# Find any Python bindings provided by recursive dependencies
a {Virtualenv} instance
a { Virtualenv } instance
Virtualenv
venv_root
the path to the root of the virtualenv (often `libexec/"venv"`)
the path to the root of the virtualenv ( often ` libexec / " venv " ` )
python
which interpreter to use
which interpreter to use
formula
the active Formula
the active Formula