diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2022-03-01 23:12:54 -0500 |
---|---|---|
committer | Eli Schwartz <eschwartz@archlinux.org> | 2022-03-07 19:01:04 -0500 |
commit | 187dc656f48ba7a86a14a5c8d9f16a3b2b7d8770 (patch) | |
tree | 5ed516e772e7edb4ab38c12feaf763fe030cf888 /mesonbuild/dependencies | |
parent | d072ebc9554e5661419d6d75285bfee24dca743f (diff) | |
download | meson-187dc656f48ba7a86a14a5c8d9f16a3b2b7d8770.zip meson-187dc656f48ba7a86a14a5c8d9f16a3b2b7d8770.tar.gz meson-187dc656f48ba7a86a14a5c8d9f16a3b2b7d8770.tar.bz2 |
merge various TYPE_CHECKING blocks into one
A bunch of files have several T.TYPE_CHECKING blocks that each do some
things which could just as well be done once, with a single `if`
statement. Make them do so.
Diffstat (limited to 'mesonbuild/dependencies')
-rw-r--r-- | mesonbuild/dependencies/detect.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/mesonbuild/dependencies/detect.py b/mesonbuild/dependencies/detect.py index f54d101..0f99c36 100644 --- a/mesonbuild/dependencies/detect.py +++ b/mesonbuild/dependencies/detect.py @@ -27,6 +27,9 @@ if T.TYPE_CHECKING: from ..environment import Environment from .factory import DependencyFactory, WrappedFactoryFunc, DependencyGenerator + TV_DepIDEntry = T.Union[str, bool, int, T.Tuple[str, ...]] + TV_DepID = T.Tuple[T.Tuple[str, TV_DepIDEntry], ...] + # These must be defined in this file to avoid cyclical references. packages: T.Dict[ str, @@ -34,11 +37,6 @@ packages: T.Dict[ ] = {} _packages_accept_language: T.Set[str] = set() -if T.TYPE_CHECKING: - TV_DepIDEntry = T.Union[str, bool, int, T.Tuple[str, ...]] - TV_DepID = T.Tuple[T.Tuple[str, TV_DepIDEntry], ...] - - def get_dep_identifier(name: str, kwargs: T.Dict[str, T.Any]) -> 'TV_DepID': identifier: 'TV_DepID' = (('name', name), ) from ..interpreter import permitted_dependency_kwargs |