Skip to content

Conversation

AbrilRBS
Copy link
Member

Changelog: Fix: Reintroduce settings.yml access to config subapi
Docs: 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

…erface to only expose scheme-related oprations
@AbrilRBS AbrilRBS added this to the 2.22.0 milestone Oct 13, 2025
AbrilRBS and others added 3 commits October 13, 2025 13:35
I missed them the first time around
test
\"""
settings = conan_api.config.settings_yml
ConanOutput().info(f"settings.fields: {settings.fields}")
Copy link
Member

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.

@AbrilRBS AbrilRBS requested a review from memsharded October 16, 2025 18:01
@property
def settings_yml(self):
return load_settings_yml(self._conan_api.home_folder)
if self._settings_yml is None:
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[question] Replacement API for config.settings_yml?

2 participants