mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-15 18:11:48 +04:00
adding pip dependancies support for conda language
This commit is contained in:
parent
5840635baa
commit
8555cd19f5
1 changed files with 21 additions and 4 deletions
|
|
@ -77,10 +77,27 @@ def install_environment(
|
||||||
'environment.yml', cwd=prefix.prefix_dir,
|
'environment.yml', cwd=prefix.prefix_dir,
|
||||||
)
|
)
|
||||||
if additional_dependencies:
|
if additional_dependencies:
|
||||||
cmd_output_b(
|
conda_dependancies = [
|
||||||
conda_exe, 'install', '-p', env_dir, *additional_dependencies,
|
conda_dep.split()[-1]
|
||||||
cwd=prefix.prefix_dir,
|
for conda_dep in additional_dependencies
|
||||||
)
|
if not conda_dep.startswith('pip install')
|
||||||
|
]
|
||||||
|
pip_dependancies = [
|
||||||
|
pip_dep.split()[-1]
|
||||||
|
for pip_dep in additional_dependencies
|
||||||
|
if pip_dep.startswith('pip install')
|
||||||
|
]
|
||||||
|
if conda_dependancies:
|
||||||
|
cmd_output_b(
|
||||||
|
conda_exe, 'install', '-p', env_dir, *conda_dependancies,
|
||||||
|
cwd=prefix.prefix_dir,
|
||||||
|
)
|
||||||
|
if pip_dependancies:
|
||||||
|
cmd_output_b(
|
||||||
|
conda_exe, 'run', '-p', 'pip',
|
||||||
|
'--yes', env_dir, *pip_dependancies,
|
||||||
|
cwd=prefix.prefix_dir,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def run_hook(
|
def run_hook(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue