From 3f9a170f78beff233d3c665b7c479b4494d94cc7 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Tue, 11 Jan 2022 23:47:53 -0500 Subject: [PATCH] gnome.gdbus_codegen: allow File objects as XML file As soon as we check for args[1] we declare it is of type FileOrString, and the additional ones specified in the `sources` kwarg explicitly allow this. It makes no sense to not accept it as the posarg too. Fixes building tracker-miners. --- mesonbuild/modules/gnome.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py index 196f538d8..22242bb98 100644 --- a/mesonbuild/modules/gnome.py +++ b/mesonbuild/modules/gnome.py @@ -1424,7 +1424,7 @@ class GnomeModule(ExtensionModule): def gtkdoc_html_dir(self, state: 'ModuleState', args: T.Tuple[str], kwargs: 'TYPE_kwargs') -> str: return os.path.join('share/gtk-doc/html', args[0]) - @typed_pos_args('gnome.gdbus_codegen', str, optargs=[str]) + @typed_pos_args('gnome.gdbus_codegen', str, optargs=[(str, mesonlib.File)]) @typed_kwargs( 'gnome.gdbus_codegen', _BUILD_BY_DEFAULT.evolve(since='0.40.0'), @@ -1446,7 +1446,7 @@ class GnomeModule(ExtensionModule): 'autocleanup', str, default='default', since='0.47.0', validator=in_set_validator({'all', 'none', 'objects'})), ) - def gdbus_codegen(self, state: 'ModuleState', args: T.Tuple[str, T.Optional[str]], + def gdbus_codegen(self, state: 'ModuleState', args: T.Tuple[str, T.Optional['FileOrString']], kwargs: 'GdbusCodegen') -> ModuleReturnValue: namebase = args[0] xml_files: T.List['FileOrString'] = [args[1]] if args[1] else []