aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2019-03-28 09:32:14 -0700
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2019-03-29 21:27:54 +0000
commit023fe1423890bf27f537e315246a95c0b6fa382e (patch)
tree1d751c639ffa263dca54ad1a6ef95c696831c082
parentb791ede1b1a310e073c59a391fbc1a86e5e7f64e (diff)
downloadmeson-023fe1423890bf27f537e315246a95c0b6fa382e.zip
meson-023fe1423890bf27f537e315246a95c0b6fa382e.tar.gz
meson-023fe1423890bf27f537e315246a95c0b6fa382e.tar.bz2
dependencies/base: Add type annotations to partial_dependency method
This would have caught the bug that this series set out to fix.
-rw-r--r--mesonbuild/dependencies/base.py25
1 files changed, 15 insertions, 10 deletions
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py
index bbe025e..1b8818d 100644
--- a/mesonbuild/dependencies/base.py
+++ b/mesonbuild/dependencies/base.py
@@ -161,8 +161,9 @@ class Dependency:
def get_configtool_variable(self, variable_name):
raise DependencyException('{!r} is not a config-tool dependency'.format(self.name))
- def get_partial_dependency(self, *, compile_args=False, link_args=False,
- links=False, includes=False, sources=False):
+ def get_partial_dependency(self, *, compile_args: bool = False,
+ link_args: bool = False, links: bool = False,
+ includes: bool = False, sources: bool = False):
"""Create a new dependency that contains part of the parent dependency.
The following options can be inherited:
@@ -200,8 +201,9 @@ class InternalDependency(Dependency):
raise DependencyException('Method "get_configtool_variable()" is '
'invalid for an internal dependency')
- def get_partial_dependency(self, *, compile_args=False, link_args=False,
- links=False, includes=False, sources=False):
+ def get_partial_dependency(self, *, compile_args: bool = False,
+ link_args: bool = False, links: bool = False,
+ includes: bool = False, sources: bool = False):
compile_args = self.compile_args.copy() if compile_args else []
link_args = self.link_args.copy() if link_args else []
libraries = self.libraries.copy() if links else []
@@ -262,8 +264,9 @@ class ExternalDependency(Dependency):
def get_compiler(self):
return self.clib_compiler
- def get_partial_dependency(self, *, compile_args=False, link_args=False,
- links=False, includes=False, sources=False):
+ def get_partial_dependency(self, *, compile_args: bool = False,
+ link_args: bool = False, links: bool = False,
+ includes: bool = False, sources: bool = False):
new = copy.copy(self)
if not compile_args:
new.compile_args = []
@@ -326,8 +329,9 @@ class NotFoundDependency(Dependency):
self.name = 'not-found'
self.is_found = False
- def get_partial_dependency(self, *, compile_args=False, link_args=False,
- links=False, includes=False, sources=False):
+ def get_partial_dependency(self, *, compile_args: bool = False,
+ link_args: bool = False, links: bool = False,
+ includes: bool = False, sources: bool = False):
return copy.copy(self)
@@ -2169,8 +2173,9 @@ class ExternalLibrary(ExternalDependency):
return []
return super().get_link_args(**kwargs)
- def get_partial_dependency(self, *, compile_args=False, link_args=False,
- links=False, includes=False, sources=False):
+ def get_partial_dependency(self, *, compile_args: bool = False,
+ link_args: bool = False, links: bool = False,
+ includes: bool = False, sources: bool = False):
# External library only has link_args, so ignore the rest of the
# interface.
new = copy.copy(self)