From 4a0a6a80837af1b75db3b3b57a5b8f41386e5c0b Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Wed, 30 Jun 2021 13:01:41 -0700 Subject: modules: modules need to return either an ExtensionModlue or a NewExtensionModule object So that we get the found() method. --- mesonbuild/interpreter/interpreter.py | 4 ++-- mesonbuild/modules/unstable_cuda.py | 4 ++-- mesonbuild/modules/unstable_external_project.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py index dc2fd1a..c103f7e 100644 --- a/mesonbuild/interpreter/interpreter.py +++ b/mesonbuild/interpreter/interpreter.py @@ -32,7 +32,7 @@ from ..interpreterbase import Disabler, disablerIfNotFound from ..interpreterbase import FeatureNew, FeatureDeprecated, FeatureNewKwargs, FeatureDeprecatedKwargs from ..interpreterbase import ObjectHolder, RangeHolder from ..interpreterbase import TYPE_nkwargs, TYPE_nvar, TYPE_var -from ..modules import ModuleObject, MutableModuleObject +from ..modules import ExtensionModule, ModuleObject, MutableModuleObject, NewExtensionModule from ..cmake import CMakeInterpreter from ..backend.backends import Backend, ExecutableSerialisation @@ -304,7 +304,7 @@ class Interpreter(InterpreterBase, HoldableObject): subproject: str = '', subdir: str = '', subproject_dir: str = 'subprojects', - modules: T.Optional[T.Dict[str, ModuleObject]] = None, + modules: T.Optional[T.Dict[str, T.Union[ExtensionModule, NewExtensionModule]]] = None, default_project_options: T.Optional[T.Dict[str, str]] = None, mock: bool = False, ast: T.Optional[mparser.CodeBlockNode] = None, diff --git a/mesonbuild/modules/unstable_cuda.py b/mesonbuild/modules/unstable_cuda.py index a80f9ca..25f953a 100644 --- a/mesonbuild/modules/unstable_cuda.py +++ b/mesonbuild/modules/unstable_cuda.py @@ -18,14 +18,14 @@ import re from ..mesonlib import version_compare from ..compilers import CudaCompiler, Compiler -from . import ModuleObject +from . import NewExtensionModule from ..interpreterbase import ( flatten, permittedKwargs, noKwargs, InvalidArguments, FeatureNew ) -class CudaModule(ModuleObject): +class CudaModule(NewExtensionModule): @FeatureNew('CUDA module', '0.50.0') def __init__(self, *args, **kwargs): diff --git a/mesonbuild/modules/unstable_external_project.py b/mesonbuild/modules/unstable_external_project.py index 4f8ac56..f866e75 100644 --- a/mesonbuild/modules/unstable_external_project.py +++ b/mesonbuild/modules/unstable_external_project.py @@ -16,7 +16,7 @@ import os, subprocess, shlex from pathlib import Path import typing as T -from . import ExtensionModule, ModuleReturnValue, ModuleState, ModuleObject +from . import ExtensionModule, ModuleReturnValue, ModuleState, NewExtensionModule from .. import mlog, build from ..mesonlib import (MesonException, Popen_safe, MachineChoice, get_variable_regex, do_replacement, extract_as_list) @@ -26,7 +26,7 @@ from ..compilers.compilers import CFLAGS_MAPPING, CEXE_MAPPING from ..dependencies import InternalDependency, PkgConfigDependency from ..mesonlib import OptionKey -class ExternalProject(ModuleObject): +class ExternalProject(NewExtensionModule): def __init__(self, state: ModuleState, configure_command: str, -- cgit v1.1