diff options
author | Daniel Mensinger <daniel@mensinger-ka.de> | 2021-06-07 20:56:27 +0200 |
---|---|---|
committer | Daniel Mensinger <daniel@mensinger-ka.de> | 2021-06-09 09:46:37 +0200 |
commit | 2263a84d0796ffe93c3dc33502dc13412fbd4afe (patch) | |
tree | 6bb428477e7a0d25cffb96fddbc53f3ce94d7513 /mesonbuild/dependencies/factory.py | |
parent | a8cd45d3ab2c84f15b7f4bdc3fee3dbac4eaa3ba (diff) | |
download | meson-2263a84d0796ffe93c3dc33502dc13412fbd4afe.zip meson-2263a84d0796ffe93c3dc33502dc13412fbd4afe.tar.gz meson-2263a84d0796ffe93c3dc33502dc13412fbd4afe.tar.bz2 |
typing: Rename some variables
Diffstat (limited to 'mesonbuild/dependencies/factory.py')
-rw-r--r-- | mesonbuild/dependencies/factory.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/mesonbuild/dependencies/factory.py b/mesonbuild/dependencies/factory.py index 0e7175b..d0ecc5e 100644 --- a/mesonbuild/dependencies/factory.py +++ b/mesonbuild/dependencies/factory.py @@ -26,24 +26,24 @@ if T.TYPE_CHECKING: from ..environment import Environment from .configtool import ConfigToolDependency - TV_DepGenerators = T.List[T.Callable[[], ExternalDependency]] - TV_WrappedFactoryFunc = T.Callable[ + DependencyGenerator = T.Callable[[], ExternalDependency] + FactoryFunc = T.Callable[ [ 'Environment', MachineChoice, T.Dict[str, T.Any], T.List[DependencyMethods] ], - TV_DepGenerators + T.List[DependencyGenerator] ] - TV_FactoryFunc = T.Callable[ + WrappedFactoryFunc = T.Callable[ [ 'Environment', MachineChoice, T.Dict[str, T.Any] ], - TV_DepGenerators + T.List[DependencyGenerator] ] class DependencyFactory: @@ -116,7 +116,7 @@ class DependencyFactory: return True def __call__(self, env: 'Environment', for_machine: MachineChoice, - kwargs: T.Dict[str, T.Any]) -> 'TV_DepGenerators': + kwargs: T.Dict[str, T.Any]) -> T.List['DependencyGenerator']: """Return a list of Dependencies with the arguments already attached.""" methods = process_method_kw(self.methods, kwargs) nwargs = self.extra_kwargs.copy() @@ -126,19 +126,19 @@ class DependencyFactory: if self._process_method(m, env, for_machine)] -def factory_methods(methods: T.Set[DependencyMethods]) -> T.Callable[['TV_WrappedFactoryFunc'], 'TV_FactoryFunc']: +def factory_methods(methods: T.Set[DependencyMethods]) -> T.Callable[['FactoryFunc'], 'WrappedFactoryFunc']: """Decorator for handling methods for dependency factory functions. This helps to make factory functions self documenting >>> @factory_methods([DependencyMethods.PKGCONFIG, DependencyMethods.CMAKE]) - >>> def factory(env: Environment, for_machine: MachineChoice, kwargs: T.Dict[str, T.Any], methods: T.List[DependencyMethods]) -> 'TV_DepGenerators': + >>> def factory(env: Environment, for_machine: MachineChoice, kwargs: T.Dict[str, T.Any], methods: T.List[DependencyMethods]) -> T.List['DependencyGenerator']: >>> pass """ - def inner(func: 'TV_WrappedFactoryFunc') -> 'TV_FactoryFunc': + def inner(func: 'FactoryFunc') -> 'WrappedFactoryFunc': @functools.wraps(func) - def wrapped(env: 'Environment', for_machine: MachineChoice, kwargs: T.Dict[str, T.Any]) -> 'TV_DepGenerators': + def wrapped(env: 'Environment', for_machine: MachineChoice, kwargs: T.Dict[str, T.Any]) -> T.List['DependencyGenerator']: return func(env, for_machine, kwargs, process_method_kw(methods, kwargs)) return wrapped |