diff options
author | Frederik Gladhorn <frederik.gladhorn@qt.io> | 2019-10-08 15:36:05 +0200 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@qt.io> | 2019-10-09 09:14:19 +0000 |
commit | f95988261631a47fcc5cacf57a1226cb8e391c64 (patch) | |
tree | 8d5c5671d862a9ca5b5a47c672a035160cc21f53 /util | |
parent | 3a103b360802b81318a20063f2b4884864e79b15 (diff) |
cmake scripts: more type cleanup
Change-Id: Ic32394548bb997af96756f260b453e830d8b9e9b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'util')
-rwxr-xr-x | util/cmake/configurejson2cmake.py | 4 | ||||
-rw-r--r-- | util/cmake/json_parser.py | 2 | ||||
-rwxr-xr-x | util/cmake/pro_conversion_rate.py | 4 | ||||
-rwxr-xr-x | util/cmake/run_pro2cmake.py | 2 |
4 files changed, 5 insertions, 7 deletions
diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index 0545d034d5..32394f31c4 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -31,7 +31,7 @@ import json_parser import posixpath import re import sys -from typing import Set +from typing import Optional, Set from textwrap import dedent from helper import ( @@ -52,7 +52,7 @@ class LibraryMapping: self.appendFoundSuffix = appendFoundSuffix -def map_tests(test: str) -> str: +def map_tests(test: str) -> Optional[str]: testmap = { "c++11": "$<COMPILE_FEATURES:cxx_std_11>", "c++14": "$<COMPILE_FEATURES:cxx_std_14>", diff --git a/util/cmake/json_parser.py b/util/cmake/json_parser.py index 36e8cee37f..a0aaecab9d 100644 --- a/util/cmake/json_parser.py +++ b/util/cmake/json_parser.py @@ -27,7 +27,7 @@ ## ############################################################################# -import pyparsing as pp +import pyparsing as pp # type: ignore import json import re from helper import _set_up_py_parsing_nicer_debug_output diff --git a/util/cmake/pro_conversion_rate.py b/util/cmake/pro_conversion_rate.py index a3ba8455c8..1224f999a8 100755 --- a/util/cmake/pro_conversion_rate.py +++ b/util/cmake/pro_conversion_rate.py @@ -68,7 +68,7 @@ class Blacklist: try: # If package is available, use Aho-Corasick algorithm, - from ahocorapy.keywordtree import KeywordTree + from ahocorapy.keywordtree import KeywordTree # type: ignore self.tree = KeywordTree(case_insensitive=True) @@ -101,8 +101,6 @@ def recursive_scan(path: str, extension: str, result_paths: typing.List[str], bl """ Find files ending with a certain extension, filtering out blacklisted entries """ try: for entry in os.scandir(path): - entry: os.DirEntry = entry - if entry.is_file() and entry.path.endswith(extension): result_paths.append(entry.path) elif entry.is_dir(): diff --git a/util/cmake/run_pro2cmake.py b/util/cmake/run_pro2cmake.py index 0db9f2a607..7c38a8aef9 100755 --- a/util/cmake/run_pro2cmake.py +++ b/util/cmake/run_pro2cmake.py @@ -84,7 +84,7 @@ def find_all_pro_files(base_path: str, args: argparse.Namespace): return dir_name + "/__" + pro_file all_files = [] - previous_dir_name: str = None + previous_dir_name: typing.Optional[str] = None print("Finding .pro files.") glob_result = glob.glob(os.path.join(base_path, "**/*.pro"), recursive=True) |