conda icon indicating copy to clipboard operation
conda copied to clipboard

Add better integration of settings plugin hook into `conda config`

Open travishathaway opened this issue 2 years ago • 2 comments

Checklist

  • [X] I added a descriptive title
  • [X] I searched open requests and couldn't find a duplicate

What is the idea?

The newly created settings plugin hook allows plugin authors to create their own settings which will then appear alongside other conda settings on the context object under "plugins" (e.g. conda.plugins.conda_plugin_setting).

On the initial implementation, integration into conda config was overlooked. See:

  • https://github.com/conda/conda/pull/13554

for more information.

Why is this needed?

In order to provide a better user experience, we want it to be possible to set and display settings via the conda config command.

What should happen?

Scenario one: read configuration

If I have the following defined as settings:

plugins:
  conda_plugin_setting: "some value"

I want to be able to run:

conda config --show

and this value in the output

Scenario two: write a setting

If a plugin has defined the setting conda_plugin_setting as a string parameter, I should be able to run the following command to set it:

conda config --set plugins_conda_plugin_setting "some value"

If a plugin has defined the setting conda_plugin_setting as a list of strings, I should be able to run the following command to set it:

conda config --set plugins_conda_plugin_setting "item_one,item_two,item_three"

Scenario three: retrieving the description

If a plugin has defined the setting conda_plugin_setting and has added a description for it, I should be able to read it by running the following command:

conda config --describe plugins_conda_plugin_setting

If a plugin has defined the setting conda_plugin_setting and has added a description for it, I should be able to see it listed when I run:

conda config --describe

travishathaway avatar Mar 06 '24 11:03 travishathaway

I would add that there is also the discussion we had about a dedicated conda plugins subcommand that might be better suited for the plugin sepcific settings, e.g. conda plugins config --set spam eggs

jezdez avatar Mar 06 '24 14:03 jezdez

See https://github.com/conda/conda/issues/11786#issuecomment-1234088871 for the mention, I think we have a user story in one of the Google docs as well

jezdez avatar Mar 06 '24 14:03 jezdez

Beware the history of conda env when thinking about conda plugins

kenodegard avatar Mar 11 '24 14:03 kenodegard