MCPcopy Index your code
hub / github.com/pre-commit/pre-commit / install_environment

Function install_environment

pre_commit/languages/python.py:214–228  ·  view source on GitHub ↗
(
        prefix: Prefix,
        version: str,
        additional_dependencies: Sequence[str],
)

Source from the content-addressed store, hash-verified

212
213
214def install_environment(
215 prefix: Prefix,
216 version: str,
217 additional_dependencies: Sequence[str],
218) -> None:
219 envdir = lang_base.environment_dir(prefix, ENVIRONMENT_DIR, version)
220 venv_cmd = [sys.executable, '-mvirtualenv', envdir]
221 python = norm_version(version)
222 if python is not None:
223 venv_cmd.extend(('-p', python))
224 install_cmd = ('python', '-mpip', 'install', '.', *additional_dependencies)
225
226 cmd_output_b(*venv_cmd, cwd='/')
227 with in_env(prefix, version):
228 lang_base.setup_cmd(prefix, install_cmd)

Callers

nothing calls this directly

Calls 3

cmd_output_bFunction · 0.90
norm_versionFunction · 0.85
in_envFunction · 0.70

Tested by

no test coverage detected