-
Notifications
You must be signed in to change notification settings - Fork 2k
Allow aliases to be used in conda config --set and others
#14898
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
CodSpeed Performance ReportMerging #14898 will not alter performanceComparing Summary
|
conda config --set and others
|
I think we should include a warning when the key is an alias More interesting question is if we should use the actual key if an alias is provided (I think most users would want this, some users who use multiple different conda versions would not want this) |
I'm forwarding the alias to the canonical key in all cases. I'll warn on What I don't fully get is how |
Is |
…ame_for_alias and update related calls for clarity and consistency.
…ame_for_alias and update related calls. Enhance documentation for name_for_alias method. Improve parameter loading logic in ConfigurationType.
…ynamic parameter mapping and update parameter_names_and_aliases to use it.
conda/common/configuration.py
Outdated
| ) | ||
|
|
||
| @property | ||
| def parameter_loaders(cls): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this to the Configuration class itself so we don't have to do self.__class__.parameter_loaders?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to turn it into a classmethod though then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm we can leave it as a metaclass property but alias it in the instance object?
class ConfigurationType(type):
@property
def _parameter_loaders(cls) -> dict[str, ParameterLoader]:
return {
name: param
for name, param in cls.__dict__.items()
if isinstance(param, ParameterLoader)
}
def __call__(cls, *args, **kwargs):
self = super().__call__(*args, **kwargs)
self._parameter_loaders = cls._parameter_loaders
return selfon reflection I think this is getting too far into the weeds and isn't helping with correcting the actual parameter aliasing issue, probably best to revert it to what you originally had?
…al and update parameter_names_and_aliases in PluginConfig to reflect new parameters.
…method and update related calls in Configuration and PluginConfig. This improves dynamic parameter mapping and ensures consistency in accessing parameter loaders.
…ialization when a file is specified, improving context handling for command-line arguments.
…g classes by replacing calls to parameter_loaders with _parameter_loaders. This change enhances consistency and clarity in parameter management.
…asses to directly use class dictionary, improving clarity and consistency in parameter management.
…es by centralizing the logic for setting parameter_names_and_aliases. This improves clarity and consistency in accessing parameter loaders.
Description
Fixes regression introduced in #14678, and reported in conda-incubator/setup-miniconda#401.
conda config --setdoes not allow aliases to be used, but IMO it should.Resolves #14899
Checklist - did you ...
newsdirectory (using the template) for the next release's release notes?