main_config#

CLI implementation for conda config.

Allows for programmatically interacting with conda's configuration files (e.g., ~/.condarc).

Functions#

configure_parser(→ argparse.ArgumentParser)

execute(→ int)

format_dict(d)

parameter_description_builder(name[, context, plugins])

describe_all_parameters(→ str)

Return a string with the descriptions of all available configuration

print_config_item(key, value)

_key_exists(→ bool)

Logic to determine if the key is a valid setting.

_get_key(→ None)

_set_key(→ None)

_remove_item(→ None)

_remove_key(→ None)

_read_rc(→ dict)

_write_rc(→ None)

_validate_provided_parameters(→ None)

Compares the provided parameters with the available parameters.

set_keys(→ None)

execute_config(args, parser)

configure_parser(sub_parsers: argparse._SubParsersAction, **kwargs) argparse.ArgumentParser#
execute(args: argparse.Namespace, parser: argparse.ArgumentParser) int#
format_dict(d)#
parameter_description_builder(name, context=None, plugins=False)#
describe_all_parameters(context=None, plugins=False) str#

Return a string with the descriptions of all available configuration

When context has no parameters, this function returns ""

print_config_item(key, value)#
_key_exists(key: str, warnings: list[str], context=None) bool#

Logic to determine if the key is a valid setting.

_get_key(key: str, config: dict, *, json: dict[str, Any] | None = None, warnings: list[str] | None = None) None#
_set_key(key: str, item: Any, config: dict) None#
_remove_item(key: str, item: Any, config: dict) None#
_remove_key(key: str, config: dict) None#
_read_rc(path: str | os.PathLike | pathlib.Path) dict#
_write_rc(path: str | os.PathLike | pathlib.Path, config: dict) None#
_validate_provided_parameters(parameters: collections.abc.Sequence[str], plugin_parameters: collections.abc.Sequence[str], context: conda.base.context.Context) None#

Compares the provided parameters with the available parameters.

Raises:

ArgumentError: If the provided parameters are not valid.

set_keys(*args: tuple[str, Any], path: str | os.PathLike | pathlib.Path) None#
execute_config(args, parser)#