From 076855c22ffdae28cc86816c9fd06b9c0e401702 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Mon, 14 Mar 2022 12:18:43 +0100 Subject: [PATCH] sourceset: rename "dependencies" fields to deps The dependencies field clashes with the dependencies module, so that mypy interprets "dependencies.Dependency" as a "Dependency" attribute of the "dependencies" field. Rename the field to something else, so that it does not clash. Signed-off-by: Paolo Bonzini --- mesonbuild/modules/sourceset.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mesonbuild/modules/sourceset.py b/mesonbuild/modules/sourceset.py index 78cf47c5c..f3ce0db75 100644 --- a/mesonbuild/modules/sourceset.py +++ b/mesonbuild/modules/sourceset.py @@ -62,12 +62,12 @@ class SourceSetRule(T.NamedTuple): sources: T.Any if_false: T.Any sourcesets: T.List[SourceSetImpl] - dependencies: T.List[dependencies.Dependency] + deps: T.List[dependencies.Dependency] class SourceFiles(T.NamedTuple): sources: OrderedSet[T.Union[mesonlib.FileOrString, build.GeneratedTypes]] - dependencies: OrderedSet[dependencies.Dependency] + deps: OrderedSet[dependencies.Dependency] class SourceSet: @@ -195,10 +195,10 @@ class SourceSetImpl(SourceSet, MutableModuleObject): if not into: into = SourceFiles(OrderedSet(), OrderedSet()) for entry in self.rules: - if all(x.found() for x in entry.dependencies) and \ + if all(x.found() for x in entry.deps) and \ all(enabled_fn(key) for key in entry.keys): into.sources.update(entry.sources) - into.dependencies.update(entry.dependencies) + into.deps.update(entry.deps) for ss in entry.sourcesets: ss.collect(enabled_fn, all_sources, into) if not all_sources: @@ -221,7 +221,7 @@ class SourceSetImpl(SourceSet, MutableModuleObject): ) -> T.List[dependencies.Dependency]: self.frozen = True files = self.collect(lambda x: True, True) - return list(files.dependencies) + return list(files.deps) @typed_pos_args('sourceset.apply', (build.ConfigurationData, dict)) @typed_kwargs('sourceset.apply', KwargInfo('strict', bool, default=True)) @@ -272,7 +272,7 @@ class SourceFilesObject(ModuleObject): @noKwargs def dependencies_method(self, state: ModuleState, args: T.List[TYPE_var], kwargs: TYPE_kwargs ) -> T.List[dependencies.Dependency]: - return list(self.files.dependencies) + return list(self.files.deps) class SourceSetModule(ExtensionModule): @FeatureNew('SourceSet module', '0.51.0')