common#

Common utilities for conda command line tools.

Functions#

confirm([message, choices, default, dry_run])

confirm_yn([message, default, dry_run])

is_active_prefix(→ bool)

Determines whether the args we pass in are pointing to the active prefix.

arg2spec(arg[, json, update])

specs_from_args(args[, json])

strip_comment(line)

spec_from_line(line)

specs_from_url(url[, json])

names_in_specs(names, specs)

disp_features(features)

stdout_json(d)

stdout_json_success([success])

print_envs_list(known_conda_prefixes[, output])

check_non_admin()

validate_prefix(prefix)

Verifies the prefix is a valid conda environment.

validate_prefix_is_writable(→ str)

Verifies the environment directory is writable by trying to access

Attributes#

confirm(message='Proceed', choices=('yes', 'no'), default='yes', dry_run=NULL)#
confirm_yn(message='Proceed', default='yes', dry_run=NULL)#
is_active_prefix(prefix: str) bool#

Determines whether the args we pass in are pointing to the active prefix. Can be used a validation step to make sure operations are not being performed on the active prefix.

arg2spec(arg, json=False, update=False)#
specs_from_args(args, json=False)#
spec_pat#
strip_comment(line)#
spec_from_line(line)#
specs_from_url(url, json=False)#
names_in_specs(names, specs)#
disp_features(features)#
stdout_json(d)#
stdout_json_success(success=True, **kwargs)#
print_envs_list(known_conda_prefixes, output=True)#
check_non_admin()#
validate_prefix(prefix)#

Verifies the prefix is a valid conda environment.

抛出:
返回:

Valid prefix.

返回类型:

str

validate_prefix_is_writable(prefix: str) str#

Verifies the environment directory is writable by trying to access the conda-meta/history file. If this file is not writable then we assume the whole prefix is not writable and raise an exception.

抛出:

EnvironmentNotWritableError -- Conda does not have permission to write to the prefix

返回:

Valid prefix.

返回类型:

str