Skip to content
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

target: store features and options #1504

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Emantor
Copy link
Member

@Emantor Emantor commented Sep 27, 2024

Description
Instead of always having to revert to the configuration for options and features, store both directly in the target object. Also deprecate the setters and getters for both in the configuration object.

Reasoning is that setters are not required for this, the YAML configuration should be changed instead. The getters are not required if the options and features are bound to the target which is more intuitive anyway.

Checklist

  • Documentation for the feature
  • Tests for the feature

Closes #704

Instead of always having to revert to the configuration for options and
features, store both directly in the target object. Also deprecate the
setters and getters for both in the configuration object.

Reasoning is that setters are not required for this, the YAML
configuration should be changed instead. The getters are not required if
the options and features are bound to the target which is more intuitive
anyway.

Signed-off-by: Rouven Czerwinski <[email protected]>
@Emantor Emantor force-pushed the topic/target-options-features branch from c9e9555 to c96639e Compare September 27, 2024 15:29
@@ -199,6 +199,12 @@ def get_target_option(self, target, name, default=None):
configuration, or if the target can not be found in the
configuration.
"""
warn(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
warn(
warnings.warn(

@@ -224,6 +230,11 @@ def set_target_option(self, target, name, value):
KeyError: if the requested target can not be found in the
configuration
"""
warn(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
warn(
warnings.warn(

@@ -55,6 +55,14 @@ def get_features(self):
return self.config.get_features()

def get_target_features(self):
warn(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
warn(
warnings.warn(

DeprecationWarning,
stacklevel=2,
)
return get_all_features()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return get_all_features()
return self.get_all_features()

warn(
"get_target_option is deprecated, access the options on the target directly.",
DeprecationWarning,
stacklevel=2,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? This isn't a wrapper method.

warn(
"set_target_option is deprecated, use the YAML configuration instead.",
DeprecationWarning,
stacklevel=2,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? This isn't a wrapper method.

warn(
"use get_all_features instead. For target features, use target.features instead.",
DeprecationWarning,
stacklevel=2,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? This isn't a wrapper method.

@Emantor Emantor self-assigned this Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants