From 6843f56f6b8e71e75c287de31686913eea5e4a44 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Thu, 14 Jul 2022 12:59:48 -0700 Subject: modules: use module level information about new and deprecation Instead of using FeatureNew/FeatureDeprecated in the module. The goal here is to be able to handle information about modules in a single place, instead of having to handle it separately. Each module simply defines some metadata, and then the interpreter handles the rest. --- mesonbuild/modules/python3.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'mesonbuild/modules/python3.py') diff --git a/mesonbuild/modules/python3.py b/mesonbuild/modules/python3.py index 1e7463c70..52f8531f1 100644 --- a/mesonbuild/modules/python3.py +++ b/mesonbuild/modules/python3.py @@ -15,15 +15,16 @@ import sysconfig from .. import mesonlib -from . import ExtensionModule -from ..interpreterbase import typed_pos_args, noPosargs, noKwargs, permittedKwargs, FeatureDeprecated, FeatureNew +from . import ExtensionModule, ModuleInfo +from ..interpreterbase import typed_pos_args, noPosargs, noKwargs, permittedKwargs from ..build import known_shmod_kwargs from ..programs import ExternalProgram class Python3Module(ExtensionModule): - @FeatureNew('python3 module', '0.38.0') - @FeatureDeprecated('python3 module', '0.48.0') + + INFO = ModuleInfo('python3', '0.38.0', deprecated='0.48.0') + def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.methods.update({ -- cgit v1.2.3