Module: Dependabot::Python::Helpers

Defined in:
lib/dependabot/python/helpers.rb

Class Method Summary collapse

Class Method Details

.install_required_python(python_version) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/dependabot/python/helpers.rb', line 8

def self.install_required_python(python_version)
  # The leading space is important in the version check
  return if SharedHelpers.run_shell_command("pyenv versions").include?(" #{python_version}")

  Dependabot.logger.info("Installing required Python #{python_version}.")
  SharedHelpers.run_shell_command("pyenv install -s #{python_version}")
  SharedHelpers.run_shell_command("pyenv exec pip install --upgrade pip")
  SharedHelpers.run_shell_command("pyenv exec pip install -r" \
                                  "#{NativeHelpers.python_requirements_path}")
end