mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-15 18:11:48 +04:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
a7f8efa2ae
commit
9583b19216
1 changed files with 5 additions and 2 deletions
|
|
@ -45,21 +45,24 @@ def run_hook(
|
||||||
color=color,
|
color=color,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def get_env_patch(target_dir: str, version: str) -> PatchesT:
|
def get_env_patch(target_dir: str, version: str) -> PatchesT:
|
||||||
patches = [
|
patches = [
|
||||||
('JULIA_LOAD_PATH', target_dir),
|
('JULIA_LOAD_PATH', target_dir),
|
||||||
('JULIA_PROJECT', UNSET),
|
('JULIA_PROJECT', UNSET),
|
||||||
]
|
]
|
||||||
if version not in ("system", "default"):
|
if version not in ('system', 'default'):
|
||||||
patches.append(('JULIAUP_CHANNEL', version))
|
patches.append(('JULIAUP_CHANNEL', version))
|
||||||
return tuple(patches)
|
return tuple(patches)
|
||||||
|
|
||||||
|
|
||||||
@contextlib.contextmanager
|
@contextlib.contextmanager
|
||||||
def in_env(prefix: Prefix, version: str) -> Generator[None]:
|
def in_env(prefix: Prefix, version: str) -> Generator[None]:
|
||||||
envdir = lang_base.environment_dir(prefix, ENVIRONMENT_DIR, version)
|
envdir = lang_base.environment_dir(prefix, ENVIRONMENT_DIR, version)
|
||||||
with envcontext(get_env_patch(envdir, version)):
|
with envcontext(get_env_patch(envdir, version)):
|
||||||
yield
|
yield
|
||||||
|
|
||||||
|
|
||||||
def install_environment(
|
def install_environment(
|
||||||
prefix: Prefix,
|
prefix: Prefix,
|
||||||
version: str,
|
version: str,
|
||||||
|
|
@ -95,7 +98,7 @@ def install_environment(
|
||||||
break
|
break
|
||||||
|
|
||||||
# copy `src` files if they exist
|
# copy `src` files if they exist
|
||||||
src_dir = prefix.path("src")
|
src_dir = prefix.path('src')
|
||||||
if os.path.isdir(src_dir):
|
if os.path.isdir(src_dir):
|
||||||
shutil.copytree(src_dir, os.path.join(envdir, 'src'))
|
shutil.copytree(src_dir, os.path.join(envdir, 'src'))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue