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/python.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'mesonbuild/modules/python.py') diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py index 5a6daa0..91443b8 100644 --- a/mesonbuild/modules/python.py +++ b/mesonbuild/modules/python.py @@ -20,7 +20,7 @@ import os import shutil import typing as T -from . import ExtensionModule +from . import ExtensionModule, ModuleInfo from .. import mesonlib from .. import mlog from ..coredata import UserFeatureOption @@ -663,7 +663,8 @@ class PythonInstallation(ExternalProgramHolder): class PythonModule(ExtensionModule): - @FeatureNew('Python Module', '0.46.0') + INFO = ModuleInfo('python', '0.46.0') + def __init__(self, interpreter: 'Interpreter') -> None: super().__init__(interpreter) self.installations: T.Dict[str, ExternalProgram] = {} -- cgit v1.1