Add PYTHON_SETUP_DEPENDENCIES.

This commit is contained in:
AllSeeingEyeTolledEweSew 2020-11-16 08:14:50 +00:00
parent 8d28c9ab40
commit c1bf8f0e6a
2 changed files with 8 additions and 1 deletions

View file

@ -11,7 +11,7 @@ repos:
- id: name-tests-test - id: name-tests-test
- id: requirements-txt-fixer - id: requirements-txt-fixer
- id: double-quote-string-fixer - id: double-quote-string-fixer
- repo: https://gitlab.com/pycqa/flake8 - repo: https://gitlab.com/pycqa/flake8.git
rev: 3.8.4 rev: 3.8.4
hooks: hooks:
- id: flake8 - id: flake8

View file

@ -197,10 +197,17 @@ def install_environment(
if python is not None: if python is not None:
venv_cmd.extend(('-p', python)) venv_cmd.extend(('-p', python))
install_cmd = ('python', '-mpip', 'install', '.', *additional_dependencies) install_cmd = ('python', '-mpip', 'install', '.', *additional_dependencies)
setup_dependencies_env = os.environ.get('PYTHON_SETUP_DEPENDENCIES')
if setup_dependencies_env:
setup_dependencies = setup_dependencies_env.split(':')
else:
setup_dependencies = []
with clean_path_on_failure(envdir): with clean_path_on_failure(envdir):
cmd_output_b(*venv_cmd, cwd='/') cmd_output_b(*venv_cmd, cwd='/')
with in_env(prefix, version): with in_env(prefix, version):
for dep in setup_dependencies:
cmd_output_b('python', '-mpip', 'install', dep)
helpers.run_setup_cmd(prefix, install_cmd) helpers.run_setup_cmd(prefix, install_cmd)