From 37f95303f09209ff6d9652a17354bc4dceecb32f Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Thu, 4 Aug 2022 20:02:53 -0400 Subject: typing: simplify type annotations for libraries In a bunch of places we need to list various types of libraries including custom_target outputs, and it gets very long. Use a common T.Union for this. --- mesonbuild/dependencies/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mesonbuild/dependencies') diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py index 1cea1e0..550a88f 100644 --- a/mesonbuild/dependencies/base.py +++ b/mesonbuild/dependencies/base.py @@ -36,7 +36,7 @@ if T.TYPE_CHECKING: from ..environment import Environment from ..interpreterbase import FeatureCheckBase from ..build import ( - CustomTarget, IncludeDirs, CustomTargetIndex, SharedLibrary, + CustomTarget, IncludeDirs, CustomTargetIndex, LibTypes, StaticLibrary ) from ..mesonlib import FileOrString @@ -235,7 +235,7 @@ class Dependency(HoldableObject): class InternalDependency(Dependency): def __init__(self, version: str, incdirs: T.List['IncludeDirs'], compile_args: T.List[str], link_args: T.List[str], - libraries: T.List[T.Union[SharedLibrary, StaticLibrary, CustomTarget, CustomTargetIndex]], + libraries: T.List[LibTypes], whole_libraries: T.List[T.Union[StaticLibrary, CustomTarget, CustomTargetIndex]], sources: T.Sequence[T.Union[FileOrString, CustomTarget, StructuredSources]], ext_deps: T.List[Dependency], variables: T.Dict[str, str], -- cgit v1.1