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/pkgconfig.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/pkgconfig.py')
-rw-r--r-- | mesonbuild/dependencies/pkgconfig.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mesonbuild/dependencies/pkgconfig.py b/mesonbuild/dependencies/pkgconfig.py index 64150e8..be5412e 100644 --- a/mesonbuild/dependencies/pkgconfig.py +++ b/mesonbuild/dependencies/pkgconfig.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from .base import ExternalDependency, DependencyException, DependencyMethods, sort_libpaths +from .base import ExternalDependency, DependencyException, DependencyMethods, sort_libpaths, DependencyTypeName from ..mesonlib import LibType, MachineChoice, OptionKey, OrderedSet, PerMachine, Popen_safe from ..programs import find_external_program, ExternalProgram from .. import mlog @@ -36,7 +36,7 @@ class PkgConfigDependency(ExternalDependency): ] = {} def __init__(self, name: str, environment: 'Environment', kwargs: T.Dict[str, T.Any], language: T.Optional[str] = None) -> None: - super().__init__('pkgconfig', environment, kwargs, language=language) + super().__init__(DependencyTypeName('pkgconfig'), environment, kwargs, language=language) self.name = name self.is_libtool = False # Store a copy of the pkg-config path on the object itself so it is |