Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/test_prefix_name' into test_pref…
Browse files Browse the repository at this point in the history
…ix_name

# Conflicts:
#	conda_subprocess/process.py
  • Loading branch information
jan-janssen committed Jun 25, 2024
2 parents 44ac214 + 1a9bab4 commit d6eed6a
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions conda_subprocess/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@

from conda.auxlib.compat import shlex_split_unicode
from conda.auxlib.ish import dals
from conda.base.context import context, _first_writable_envs_dir, ROOT_ENV_NAME, PREFIX_NAME_DISALLOWED_CHARS
from conda.base.context import (
context,
_first_writable_envs_dir,
ROOT_ENV_NAME,
PREFIX_NAME_DISALLOWED_CHARS,
)
from conda.exceptions import EnvironmentNameNotFound, CondaValueError
from conda.cli.common import validate_prefix
from conda.common.compat import encode_arguments, encode_environment, isiterable
Expand Down Expand Up @@ -122,7 +127,9 @@ def _locate_prefix_by_name(name, envs_dirs=None):
raise EnvironmentNameNotFound(name)


def _validate_prefix_name(prefix_name: str, ctx: context, allow_base=True) -> str:
def _validate_prefix_name(
prefix_name: str, ctx: context, allow_base=True
) -> str:
"""Run various validations to make sure prefix_name is valid"""
if PREFIX_NAME_DISALLOWED_CHARS.intersection(prefix_name):
raise CondaValueError(
Expand All @@ -146,7 +153,9 @@ def _validate_prefix_name(prefix_name: str, ctx: context, allow_base=True) -> st

else:
envs_dirs = context.envs_dirs
envs_dirs += [os.path.abspath(os.path.join(os.environ["CONDA_EXE"], "..", ".."))]
envs_dirs += [
os.path.abspath(os.path.join(os.environ["CONDA_EXE"], "..", ".."))
]
try:
return _locate_prefix_by_name(name=prefix_name, envs_dirs=envs_dirs)
except EnvironmentNameNotFound:
Expand Down

0 comments on commit d6eed6a

Please sign in to comment.