-
Notifications
You must be signed in to change notification settings - Fork 183
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -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( | ||||||
"get_target_option is deprecated, access the options on the target directly.", | ||||||
DeprecationWarning, | ||||||
stacklevel=2, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why? This isn't a wrapper method. |
||||||
) | ||||||
|
||||||
if target not in self.data['targets']: | ||||||
raise KeyError(f"No target '{target}' found in configuration") | ||||||
|
||||||
|
@@ -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( | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
"set_target_option is deprecated, use the YAML configuration instead.", | ||||||
DeprecationWarning, | ||||||
stacklevel=2, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why? This isn't a wrapper method. |
||||||
) | ||||||
assert isinstance(target, str) | ||||||
assert isinstance(name, str) | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -55,6 +55,14 @@ def get_features(self): | |||||
return self.config.get_features() | ||||||
|
||||||
def get_target_features(self): | ||||||
warn( | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
"use get_all_features instead. For target features, use target.features instead.", | ||||||
DeprecationWarning, | ||||||
stacklevel=2, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why? This isn't a wrapper method. |
||||||
) | ||||||
return get_all_features() | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
def get_all_features(self): | ||||||
flags = set() | ||||||
for value in self.config.get_targets().values(): | ||||||
flags = flags | set(value.get('features', {})) | ||||||
|
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.