mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-15 18:11:48 +04:00
Add PYTHON_SETUP_DEPENDENCIES.
This commit is contained in:
parent
8d28c9ab40
commit
c1bf8f0e6a
2 changed files with 8 additions and 1 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue