diff options
author | Michael Hirsch, Ph.D <scivision@users.noreply.github.com> | 2019-07-08 08:34:36 -0400 |
---|---|---|
committer | Michael Hirsch, Ph.D <scivision@users.noreply.github.com> | 2019-07-08 22:28:24 -0400 |
commit | 8e0acae4390f13aa6ec4f8c5a07720e44c832e06 (patch) | |
tree | c311118d47f56a69c7f81acf6db6d3ed1005384c /mesonbuild/mesonlib.py | |
parent | c756d06fbb54651c2ba19f7801885018c1c389df (diff) | |
download | meson-8e0acae4390f13aa6ec4f8c5a07720e44c832e06.zip meson-8e0acae4390f13aa6ec4f8c5a07720e44c832e06.tar.gz meson-8e0acae4390f13aa6ec4f8c5a07720e44c832e06.tar.bz2 |
type hints @dcbaker
Diffstat (limited to 'mesonbuild/mesonlib.py')
-rw-r--r-- | mesonbuild/mesonlib.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/mesonbuild/mesonlib.py b/mesonbuild/mesonlib.py index 485a0e1..585a5bb 100644 --- a/mesonbuild/mesonlib.py +++ b/mesonbuild/mesonlib.py @@ -14,7 +14,6 @@ """A library of random helper functionality.""" from pathlib import Path -from typing import List import sys import stat import time @@ -259,7 +258,7 @@ class File: def endswith(self, ending: str) -> bool: return self.fname.endswith(ending) - def split(self, s: str) -> List[str]: + def split(self, s: str) -> typing.List[str]: return self.fname.split(s) def __eq__(self, other) -> bool: @@ -463,7 +462,7 @@ def is_dragonflybsd() -> bool: def is_freebsd() -> bool: return platform.system().lower() == 'freebsd' -def exe_exists(arglist: List[str]) -> bool: +def exe_exists(arglist: typing.List[str]) -> bool: try: if subprocess.run(arglist, timeout=10).returncode == 0: return True @@ -574,7 +573,7 @@ class Version: # otherwise, the version with a suffix remaining is greater return comparator(len(self._v), len(other._v)) -def _version_extract_cmpop(vstr2: str) -> tuple: +def _version_extract_cmpop(vstr2: str) -> typing.Tuple[typing.Callable[[typing.Any, typing.Any], bool], str]: if vstr2.startswith('>='): cmpop = operator.ge vstr2 = vstr2[2:] @@ -619,7 +618,7 @@ def version_compare_many(vstr1, conditions): # determine if the minimum version satisfying the condition |condition| exceeds # the minimum version for a feature |minimum| -def version_compare_condition_with_min(condition, minimum) -> bool: +def version_compare_condition_with_min(condition: str, minimum: str) -> bool: if condition.startswith('>='): cmpop = operator.le condition = condition[2:] @@ -682,7 +681,7 @@ def default_libexecdir(): def default_prefix(): return 'c:/' if is_windows() else '/usr/local' -def get_library_dirs() -> List[str]: +def get_library_dirs() -> typing.List[str]: if is_windows(): return ['C:/mingw/lib'] # TODO: get programatically if is_osx(): |