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)

set_keys(→ None)

Set multiple configuration keys in a file.

execute_config(→ int | None)

Execute the conda config command based on provided arguments.

_key_exists(→ bool)

Deprecated. Use ConfigurationFile.key_exists() instead.

_get_key(→ tuple[str, Any])

Deprecated. Use ConfigurationFile.get_key() instead.

_set_key(→ None)

Deprecated. Use ConfigurationFile.set_key() instead.

_remove_item(→ None)

Deprecated. Use ConfigurationFile.remove_item() instead.

_remove_key(→ None)

Deprecated. Use ConfigurationFile.remove_key() instead.

_read_rc(→ dict)

Deprecated. Use ConfigurationFile.read() instead.

_write_rc(→ None)

Deprecated. Use ConfigurationFile.write() instead.

_validate_provided_parameters(→ None)

Deprecated. Use validate_provided_parameters() instead.

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)#
set_keys(*args: tuple[str, Any], path: str | os.PathLike[str] | pathlib.Path) None#

Set multiple configuration keys in a file.

Parameters:
  • args -- Variable number of (key, value) tuples to set.

  • path -- Path to the configuration file.

execute_config(args: argparse.Namespace, parser: argparse.ArgumentParser) int | None#

Execute the conda config command based on provided arguments.

Handles various config subcommands including show, show-sources, describe, validate, write-default, and modification operations (add, set, remove, etc.).

Parameters:
  • args -- Parsed command line arguments.

  • parser -- Argument parser instance.

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

Deprecated. Use ConfigurationFile.key_exists() instead.

_get_key(key: str, warnings: list[str], config: dict[str, Any], context=None) tuple[str, Any]#

Deprecated. Use ConfigurationFile.get_key() instead.

_set_key(key: str, item: Any, config: dict) None#

Deprecated. Use ConfigurationFile.set_key() instead.

_remove_item(key: str, item: Any, config: dict) None#

Deprecated. Use ConfigurationFile.remove_item() instead.

_remove_key(key: str, config: dict) None#

Deprecated. Use ConfigurationFile.remove_key() instead.

_read_rc(path: str | os.PathLike[str] | pathlib.Path) dict#

Deprecated. Use ConfigurationFile.read() instead.

_write_rc(path: str | os.PathLike[str] | pathlib.Path, config: dict) None#

Deprecated. Use ConfigurationFile.write() instead.

_validate_provided_parameters(parameters: collections.abc.Sequence[str], plugin_parameters: collections.abc.Sequence[str], context) None#

Deprecated. Use validate_provided_parameters() instead.