diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2020-05-05 10:10:23 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2020-05-12 10:24:24 -0700 |
commit | ee790eec2ae7bf335d0b0229474ceabf0cebfcc4 (patch) | |
tree | f14caf117d8810cac26fa4051ce19ba28b6f349a /mesonbuild/interpreterbase.py | |
parent | 245d659522fd73857bf7f4e83bd572d9cdcd7469 (diff) | |
download | meson-ee790eec2ae7bf335d0b0229474ceabf0cebfcc4.zip meson-ee790eec2ae7bf335d0b0229474ceabf0cebfcc4.tar.gz meson-ee790eec2ae7bf335d0b0229474ceabf0cebfcc4.tar.bz2 |
interpreter: Don't assign duplication and new feature warning to the same variable
Currently The Deprecated and New features checkers share an attribute
through a base class that should be per class. We need to duplicate this
and move it into each of the sublcasses
Fixes #7080
Diffstat (limited to 'mesonbuild/interpreterbase.py')
-rw-r--r-- | mesonbuild/interpreterbase.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/mesonbuild/interpreterbase.py b/mesonbuild/interpreterbase.py index 6246a06..fc666a6 100644 --- a/mesonbuild/interpreterbase.py +++ b/mesonbuild/interpreterbase.py @@ -215,9 +215,8 @@ class permittedKwargs: class FeatureCheckBase: "Base class for feature version checks" - # Class variable, shared across all instances - # - # Format: {subproject: {feature_version: set(feature_names)}} + # In python 3.6 we can just forward declare this, but in 3.5 we can't + # This will be overwritten by the subclasses by necessity feature_registry = {} # type: T.ClassVar[T.Dict[str, T.Dict[str, T.Set[str]]]] def __init__(self, feature_name: str, version: str): @@ -283,6 +282,11 @@ class FeatureCheckBase: class FeatureNew(FeatureCheckBase): """Checks for new features""" + # Class variable, shared across all instances + # + # Format: {subproject: {feature_version: set(feature_names)}} + feature_registry = {} # type: T.ClassVar[T.Dict[str, T.Dict[str, T.Set[str]]]] + @staticmethod def get_warning_str_prefix(tv: str) -> str: return 'Project specifies a minimum meson_version \'{}\' but uses features which were added in newer versions:'.format(tv) @@ -294,6 +298,11 @@ class FeatureNew(FeatureCheckBase): class FeatureDeprecated(FeatureCheckBase): """Checks for deprecated features""" + # Class variable, shared across all instances + # + # Format: {subproject: {feature_version: set(feature_names)}} + feature_registry = {} # type: T.ClassVar[T.Dict[str, T.Dict[str, T.Set[str]]]] + @staticmethod def get_warning_str_prefix(tv: str) -> str: return 'Deprecated features used:' |