Skip to content

Commit

Permalink
typed_kwargs: Remove feature_validator as it's not currently used
Browse files Browse the repository at this point in the history
  • Loading branch information
xclaesse committed Mar 4, 2023
1 parent 0f67913 commit 93c11f2
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions mesonbuild/interpreterbase/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,6 @@ class KwargInfo(T.Generic[_T]):
added in.
:param not_set_warning: A warning message that is logged if the kwarg is not
set by the user.
:param feature_validator: A callable returning an iterable of FeatureNew | FeatureDeprecated objects.
"""
def __init__(self, name: str,
types: T.Union[T.Type[_T], T.Tuple[T.Union[T.Type[_T], ContainerTypeInfo], ...], ContainerTypeInfo],
Expand All @@ -404,7 +403,6 @@ def __init__(self, name: str,
deprecated: T.Optional[str] = None,
deprecated_message: T.Optional[str] = None,
deprecated_values: T.Optional[T.Dict[T.Union[_T, ContainerTypeInfo, type], T.Union[str, T.Tuple[str, str]]]] = None,
feature_validator: T.Optional[T.Callable[[_T], T.Iterable[FeatureCheckBase]]] = None,
validator: T.Optional[T.Callable[[T.Any], T.Optional[str]]] = None,
convertor: T.Optional[T.Callable[[_T], object]] = None,
not_set_warning: T.Optional[str] = None):
Expand All @@ -416,7 +414,6 @@ def __init__(self, name: str,
self.since = since
self.since_message = since_message
self.since_values = since_values
self.feature_validator = feature_validator
self.deprecated = deprecated
self.deprecated_message = deprecated_message
self.deprecated_values = deprecated_values
Expand All @@ -435,7 +432,6 @@ def evolve(self, *,
deprecated: T.Union[str, None, _NULL_T] = _NULL,
deprecated_message: T.Union[str, None, _NULL_T] = _NULL,
deprecated_values: T.Union[T.Dict[T.Union[_T, ContainerTypeInfo, type], T.Union[str, T.Tuple[str, str]]], None, _NULL_T] = _NULL,
feature_validator: T.Union[T.Callable[[_T], T.Iterable[FeatureCheckBase]], None, _NULL_T] = _NULL,
validator: T.Union[T.Callable[[_T], T.Optional[str]], None, _NULL_T] = _NULL,
convertor: T.Union[T.Callable[[_T], TYPE_var], None, _NULL_T] = _NULL) -> 'KwargInfo':
"""Create a shallow copy of this KwargInfo, with modifications.
Expand All @@ -461,7 +457,6 @@ def evolve(self, *,
deprecated=deprecated if not isinstance(deprecated, _NULL_T) else self.deprecated,
deprecated_message=deprecated_message if not isinstance(deprecated_message, _NULL_T) else self.deprecated_message,
deprecated_values=deprecated_values if not isinstance(deprecated_values, _NULL_T) else self.deprecated_values,
feature_validator=feature_validator if not isinstance(feature_validator, _NULL_T) else self.feature_validator,
validator=validator if not isinstance(validator, _NULL_T) else self.validator,
convertor=convertor if not isinstance(convertor, _NULL_T) else self.convertor,
)
Expand Down Expand Up @@ -577,10 +572,6 @@ def emit_feature_change(values: T.Dict[_T, T.Union[str, T.Tuple[str, str]]], fea
if msg is not None:
raise InvalidArguments(f'{name} keyword argument "{info.name}" {msg}')

if info.feature_validator is not None:
for each in info.feature_validator(value):
each.use(subproject, node)

if info.deprecated_values is not None:
emit_feature_change(info.deprecated_values, FeatureDeprecated)

Expand Down

0 comments on commit 93c11f2

Please sign in to comment.