main_info#

CLI implementation for conda info.

Display information about current conda installation.

Classes#

InfoRenderer

Provides a render method for rendering InfoComponents

Functions#

configure_parser(→ argparse.ArgumentParser)

get_user_site(→ list[str])

Method used to populate site_dirs in conda info.

dump_record(→ dict[str, Any])

Returns a dictionary of key/value pairs from prec. Keys included in IGNORE_FIELDS are not returned.

pretty_package(→ None)

Pretty prints contents of a PackageRecord

get_info_dict(→ dict[str, Any])

Returns a dictionary of contextual information.

get_env_vars_str(→ str)

Returns a printable string representing environment variables from the dictionary returned by get_info_dict.

get_main_info_display(→ dict[str, str])

Returns the data that can be used to display information for conda info

get_main_info_str(→ str)

Returns a printable string of the contents of info_dict.

get_info_components(→ set[InfoComponents])

Based on values in args and context determine which components need to be displayed

execute(→ int)

Implements conda info command.

Attributes#

configure_parser(sub_parsers: argparse._SubParsersAction, **kwargs) argparse.ArgumentParser#
get_user_site() list[str]#

Method used to populate site_dirs in conda info.

Returns:

List of directories.

IGNORE_FIELDS: set[str]#
SKIP_FIELDS: set[str]#
dump_record(prec: conda.models.records.PackageRecord) dict[str, Any]#

Returns a dictionary of key/value pairs from prec. Keys included in IGNORE_FIELDS are not returned.

Parameters:

prec -- A PackageRecord object.

Returns:

A dictionary of elements dumped from prec

pretty_package(prec: conda.models.records.PackageRecord) None#

Pretty prints contents of a PackageRecord

Parameters:

prec -- A PackageRecord

get_info_dict() dict[str, Any]#

Returns a dictionary of contextual information.

Returns:

Dictionary of conda information to be sent to stdout.

get_env_vars_str(info_dict: dict[str, Any]) str#

Returns a printable string representing environment variables from the dictionary returned by get_info_dict.

Parameters:

info_dict -- The returned dictionary from get_info_dict().

Returns:

String to print.

get_main_info_display(info_dict: dict[str, Any]) dict[str, str]#

Returns the data that can be used to display information for conda info

get_main_info_str(info_dict: dict[str, Any]) str#

Returns a printable string of the contents of info_dict.

Parameters:

info_dict -- The output of get_info_dict().

Returns:

String to print.

InfoComponents#
class InfoRenderer(context)#

Provides a render method for rendering InfoComponents

render(components: collections.abc.Iterable[InfoComponents])#

Iterates through the registered components, obtains the data to render via a _<component>_component method and then renders it.

_base_component() str | dict#
_channels_component() str | dict#
_detail_component() dict[str, str]#
_envs_component()#
_system_component() str#
_json_all_component() dict[str, Any]#
get_info_components(args: argparse.Namespace, context: conda.base.context.Context) set[InfoComponents]#

Based on values in args and context determine which components need to be displayed and return them as a set

execute(args: argparse.Namespace, parser: argparse.ArgumentParser) int#

Implements conda info command.

  • conda info

  • conda info --base

  • conda info <package_spec> ...

  • conda info --unsafe-channels

  • conda info --envs

  • conda info --system