diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2021-06-13 21:25:29 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2021-06-14 09:09:32 -0700 |
commit | 0412bdd7535ec8d8d314f5ecf6120472534764ba (patch) | |
tree | 0fe86e702eff81f39b1cd80a4744c0f251e2104a /mesonbuild/dependencies/platform.py | |
parent | 203a548d60343a97e436b59aa026ce17597f1cd1 (diff) | |
download | meson-0412bdd7535ec8d8d314f5ecf6120472534764ba.zip meson-0412bdd7535ec8d8d314f5ecf6120472534764ba.tar.gz meson-0412bdd7535ec8d8d314f5ecf6120472534764ba.tar.bz2 |
dependencies: Use a typing.NewType for Dependency.type_name
This allow mypy to catch cases where we accidently assign the dependency
name to the type_name, as it sees them as having different types (though
at runtime they're all strings).
Diffstat (limited to 'mesonbuild/dependencies/platform.py')
-rw-r--r-- | mesonbuild/dependencies/platform.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mesonbuild/dependencies/platform.py b/mesonbuild/dependencies/platform.py index 816e32f..7759b0f 100644 --- a/mesonbuild/dependencies/platform.py +++ b/mesonbuild/dependencies/platform.py @@ -15,7 +15,7 @@ # This file contains the detection logic for external dependencies that are # platform-specific (generally speaking). -from .base import ExternalDependency, DependencyException +from .base import DependencyTypeName, ExternalDependency, DependencyException from ..mesonlib import MesonException import typing as T @@ -24,7 +24,7 @@ if T.TYPE_CHECKING: class AppleFrameworks(ExternalDependency): def __init__(self, env: 'Environment', kwargs: T.Dict[str, T.Any]) -> None: - super().__init__('appleframeworks', env, kwargs) + super().__init__(DependencyTypeName('appleframeworks'), env, kwargs) modules = kwargs.get('modules', []) if isinstance(modules, str): modules = [modules] |