summaryrefslogtreecommitdiffstats
path: root/pre_commit/languages/coursier.py
diff options
context:
space:
mode:
Diffstat (limited to 'pre_commit/languages/coursier.py')
-rw-r--r--pre_commit/languages/coursier.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/pre_commit/languages/coursier.py b/pre_commit/languages/coursier.py
index 6075758..9c5fbfe 100644
--- a/pre_commit/languages/coursier.py
+++ b/pre_commit/languages/coursier.py
@@ -5,19 +5,19 @@ import os.path
from typing import Generator
from typing import Sequence
+from pre_commit import lang_base
from pre_commit.envcontext import envcontext
from pre_commit.envcontext import PatchesT
from pre_commit.envcontext import Var
from pre_commit.errors import FatalError
-from pre_commit.languages import helpers
from pre_commit.parse_shebang import find_executable
from pre_commit.prefix import Prefix
ENVIRONMENT_DIR = 'coursier'
-get_default_version = helpers.basic_get_default_version
-health_check = helpers.basic_health_check
-run_hook = helpers.basic_run_hook
+get_default_version = lang_base.basic_get_default_version
+health_check = lang_base.basic_health_check
+run_hook = lang_base.basic_run_hook
def install_environment(
@@ -25,7 +25,7 @@ def install_environment(
version: str,
additional_dependencies: Sequence[str],
) -> None:
- helpers.assert_version_default('coursier', version)
+ lang_base.assert_version_default('coursier', version)
# Support both possible executable names (either "cs" or "coursier")
cs = find_executable('cs') or find_executable('coursier')
@@ -35,12 +35,12 @@ def install_environment(
'executables in the application search path',
)
- envdir = helpers.environment_dir(prefix, ENVIRONMENT_DIR, version)
+ envdir = lang_base.environment_dir(prefix, ENVIRONMENT_DIR, version)
def _install(*opts: str) -> None:
assert cs is not None
- helpers.run_setup_cmd(prefix, (cs, 'fetch', *opts))
- helpers.run_setup_cmd(prefix, (cs, 'install', '--dir', envdir, *opts))
+ lang_base.setup_cmd(prefix, (cs, 'fetch', *opts))
+ lang_base.setup_cmd(prefix, (cs, 'install', '--dir', envdir, *opts))
with in_env(prefix, version):
channel = prefix.path('.pre-commit-channel')
@@ -71,6 +71,6 @@ def get_env_patch(target_dir: str) -> PatchesT:
@contextlib.contextmanager
def in_env(prefix: Prefix, version: str) -> Generator[None, None, None]:
- envdir = helpers.environment_dir(prefix, ENVIRONMENT_DIR, version)
+ envdir = lang_base.environment_dir(prefix, ENVIRONMENT_DIR, version)
with envcontext(get_env_patch(envdir)):
yield