Add support for python and ruby local hooks

This commit is contained in:
Thierry Deo 2017-02-13 14:37:03 +01:00
parent e5669ca135
commit 377cffbd27
12 changed files with 54 additions and 11 deletions

View file

@ -58,6 +58,7 @@ def install_environment(
repo_cmd_runner,
version='default',
additional_dependencies=(),
is_local_hook = False,
):
additional_dependencies = tuple(additional_dependencies)
directory = helpers.environment_dir(ENVIRONMENT_DIR, version)
@ -73,10 +74,12 @@ def install_environment(
else:
venv_cmd.extend(['-p', os.path.realpath(sys.executable)])
repo_cmd_runner.run(venv_cmd, cwd='/')
to_install = () if is_local_hook else ('.')
to_install += additional_dependencies
with in_env(repo_cmd_runner, version):
helpers.run_setup_cmd(
repo_cmd_runner,
('pip', 'install', '.') + additional_dependencies,
('pip', 'install') + to_install,
)