-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Reintroduce settings_yml
to config subapi as an interface
#19078
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
base: develop2
Are you sure you want to change the base?
Conversation
…erface to only expose scheme-related oprations
test | ||
\""" | ||
settings = conan_api.config.settings_yml | ||
ConanOutput().info(f"settings.fields: {settings.fields}") |
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.
User was commenting about an update
use case, it doesn't look possible with this interface. IIRC, something like adding new settings, then saving the file to disk, as a way to create custom variations?
May be worth to investigate a bit further, I wonder why not using settings_user.yml
instead.
@property | ||
def settings_yml(self): | ||
return load_settings_yml(self._conan_api.home_folder) | ||
if self._settings_yml is None: |
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 still need to be careful with user side code keeping a reference to the returned object, that will not be invalidated and updated after a reinit()
after updating the conf.
This would need a private move constructor to keep the internal self._settings_yml
reference and just move the new loaded settings.yml into the existing reference.
That sounds too much for this PR, I think lets first make the API available, we can address the issue of dangling references later, very minimal use case.
Changelog: Fix: Reintroduce
settings.yml
access toconfig
subapiDocs: TODO
This new approach creates an interface to avoid users having access to non-scheme related methods, as this object won't have the settings values filled.
Maybe the name can be changed, and the interface location can be changed
Closes #19059