Settings#

The settings plugin hook allows plugin authors to add new settings to conda. Users will be able to use these new parameters either in .condarc files or define them as environment variables. For more information on configuration in conda, see Configuration.

The plugin hooks relies on using the various conda.common.configuration.Parameter sub-classes (e.g. conda.common.configuration.PrimitiveParameter or conda.common.configuration.SequenceParameter). For more examples of how these parameter classes are used, please see the conda.base.context.Context class.

class CondaSetting#

Return type to use when defining a conda setting plugin hook.

For details on how this is used, see conda_settings().

Parameters:
  • name -- name of the setting (e.g., config_param)

  • description -- description of the setting that should be targeted towards users of the plugin

  • parameter -- Parameter instance containing the setting definition

  • aliases -- alternative names of the setting

aliases#
description#
name#
parameter#
conda_settings()#

Register new setting

The example below defines a simple string type parameter

Example:

from conda import plugins
from conda.common.configuration import PrimitiveParameter, SequenceParameter


@plugins.hookimpl
def conda_settings():
    yield plugins.CondaSetting(
        name="example_option",
        description="This is an example option",
        parameter=PrimitiveParameter("default_value", element_type=str),
        aliases=("example_option_alias",),
    )