diff --git a/mesonbuild/modules/fs.py b/mesonbuild/modules/fs.py index d48311114..5ba1e3819 100644 --- a/mesonbuild/modules/fs.py +++ b/mesonbuild/modules/fs.py @@ -24,11 +24,11 @@ from ..interpreterbase import FeatureNew from ..interpreterbase import stringArgs, noKwargs if T.TYPE_CHECKING: - from ..interpreter import ModuleState + from ..interpreter import Interpreter, ModuleState class FSModule(ExtensionModule): - def __init__(self, interpreter): + def __init__(self, interpreter: 'Interpreter') -> None: super().__init__(interpreter) self.snippets.add('generate_dub_file') @@ -36,7 +36,7 @@ class FSModule(ExtensionModule): """ make an absolute path from a relative path, WITHOUT resolving symlinks """ - return Path(state.source_root) / state.subdir / Path(arg).expanduser() + return Path(state.source_root) / Path(state.subdir) / Path(arg).expanduser() def _resolve_dir(self, state: 'ModuleState', arg: str) -> Path: """ @@ -193,5 +193,5 @@ class FSModule(ExtensionModule): new = original.stem return ModuleReturnValue(str(new), []) -def initialize(*args, **kwargs) -> FSModule: +def initialize(*args: T.Any, **kwargs: T.Any) -> FSModule: return FSModule(*args, **kwargs) diff --git a/run_mypy.py b/run_mypy.py index c7d44b606..3369b1a76 100755 --- a/run_mypy.py +++ b/run_mypy.py @@ -38,6 +38,7 @@ strict_modules = [ 'mesonbuild/ast', 'mesonbuild/wrap', 'mesonbuild/scripts', + 'mesonbuild/modules/fs.py', 'mesonbuild/dependencies/boost.py', 'mesonbuild/dependencies/hdf5.py', 'mesonbuild/compilers/mixins/intel.py',