diff options
-rw-r--r-- | .pre-commit-config.yaml | 2 | ||||
-rw-r--r-- | packaging-tools/bld_openssl.py | 6 | ||||
-rw-r--r-- | packaging-tools/bld_python.py | 2 | ||||
-rw-r--r-- | packaging-tools/bldinstallercommon.py | 2 | ||||
-rw-r--r-- | packaging-tools/build_wrapper.py | 4 | ||||
-rw-r--r-- | packaging-tools/create_installer.py | 2 | ||||
-rw-r--r-- | packaging-tools/dump_debug_infos.py | 2 | ||||
-rw-r--r-- | packaging-tools/libclang_training/libclangtimings2csv.py | 6 | ||||
-rw-r--r-- | packaging-tools/libclang_training/runBatchFiles.py | 2 | ||||
-rwxr-xr-x | packaging-tools/patch_qt.py | 2 | ||||
-rw-r--r-- | packaging-tools/tests/test_runCommand.py | 2 |
11 files changed, 17 insertions, 15 deletions
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 214056ef1..217fe3ba9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -21,7 +21,7 @@ repos: name: Check PEP8 compliance (flake8) # Disable E203 for compatibility with blackformatter, and W503 as it goes against PEP8 # Disable checks that are not relevant to this patch, they will be introduced later - entry: bash -c 'pipenv run python3 -m flake8 --max-line-length=99 --ignore=E111,E117,E121,E123,E124,E125,E126,E127,E128,E201,E202,E203,E211,E221,E222,E225,E226,E231,E251,E252,E301,E302,E303,E305,E306,E501,E502,E703,E722,E741,E999,F523,F541,W391,W503,W504,W605 "$@"' + entry: bash -c 'pipenv run python3 -m flake8 --max-line-length=99 --ignore=E111,E117,E121,E123,E124,E125,E126,E127,E128,E201,E202,E203,E211,E221,E222,E225,E226,E231,E251,E252,E301,E302,E303,E305,E306,E501,E502,E722,E741,W391,W503,W504 "$@"' language: system types: [python] fail_fast: true diff --git a/packaging-tools/bld_openssl.py b/packaging-tools/bld_openssl.py index e35b3c37b..9cdbfc2e2 100644 --- a/packaging-tools/bld_openssl.py +++ b/packaging-tools/bld_openssl.py @@ -47,9 +47,9 @@ ROOT_DIR = os.path.dirname(os.path.realpath(__file__)) def build(src_dir, install_dir, toolset): do_execute_sub_process(['perl', 'Configure', toolset, '--openssldir=' + install_dir], src_dir, True) if toolset == 'VC-WIN32': - do_execute_sub_process(['ms\do_nasm.bat'], src_dir, True) + do_execute_sub_process([r'ms\do_nasm.bat'], src_dir, True) else: - do_execute_sub_process(['ms\do_win64a'], src_dir, True) + do_execute_sub_process([r'ms\do_win64a'], src_dir, True) do_execute_sub_process(['nmake', '-f', 'ms\\ntdll.mak'], src_dir, True) do_execute_sub_process(['nmake', '-f', 'ms\\ntdll.mak', 'install'], src_dir, True) @@ -75,7 +75,7 @@ def setup_argument_parser(): formatter_class=argparse.RawTextHelpFormatter) parser.add_argument('--sourcedir', help='Source directory', required=True) - parser.add_argument('--installdir', help='Target directory (should be on C:\)', required=False, default='C:\usr\local\openssl') + parser.add_argument('--installdir', help=r'Target directory (should be on C:\)', required=False, default=r'C:\usr\local\openssl') parser.add_argument('--toolset', help='Either VC-WIN32 or VC-WIN64', required=False, default='VC-WIN32') parser.add_argument('--archive_prefix', help='The start of the archive name to create', required=False, default=ROOT_DIR + '\\openssl') return parser diff --git a/packaging-tools/bld_python.py b/packaging-tools/bld_python.py index 93c3fac5c..9cf57d193 100644 --- a/packaging-tools/bld_python.py +++ b/packaging-tools/bld_python.py @@ -83,7 +83,7 @@ async def create_symlink(pythonDir: str): assert os.path.isfile(pythonExe), "The 'python' executable did not exist: {0}".format(pythonExe) versionCmd = [pythonExe, '--version'] versionOutput = subprocess.check_output(versionCmd, shell=True).decode("utf-8") - match = re.search('(\d+)\.(\d+)\.(\d+)', versionOutput) + match = re.search(r'(\d+)\.(\d+)\.(\d+)', versionOutput) if match: destination = os.path.join(pythonDir, 'python' + match.group(1) + match.group(2) + '.exe') os.symlink(pythonExe, destination) diff --git a/packaging-tools/bldinstallercommon.py b/packaging-tools/bldinstallercommon.py index 687568f30..2e7960e16 100644 --- a/packaging-tools/bldinstallercommon.py +++ b/packaging-tools/bldinstallercommon.py @@ -643,7 +643,7 @@ def rename_android_soname_files(qt5_base_path): # filename, so, version = ['libQt5Core', 'so', '5.2.0'] filename, so, version = name.split(os.extsep, 2) # let's just rename the appropriate files - if filename.startswith('lib') and so == 'so' and p.match(version) != None: + if filename.startswith('lib') and so == 'so' and p.match(version) is not None: old_filepath = os.path.join(lib_dir, name) new_filepath = os.path.join(lib_dir, filename + '.so') shutil.move(old_filepath, new_filepath) diff --git a/packaging-tools/build_wrapper.py b/packaging-tools/build_wrapper.py index c8684f948..0dfb895c3 100644 --- a/packaging-tools/build_wrapper.py +++ b/packaging-tools/build_wrapper.py @@ -90,7 +90,7 @@ def lock_keychain(): # init snapshot build dir and upload files ########################################### def init_snapshot_dir_and_upload_files(optionDict, project_name, project_version_or_branch, build_number, file_upload_list, subdir = ''): - if subdir is not "" and subdir[0] is not "/": + if subdir != "" and subdir[0] != "/": subdir = "/" + subdir remote_path_base = optionDict['PACKAGE_STORAGE_SERVER_BASE_DIR'] + '/' + project_name + '/' + project_version_or_branch remote_path_snapshot_dir = remote_path_base + '/' + build_number @@ -1005,6 +1005,8 @@ def create_remote_dirs(optionDict, server, dir_path): ############################### def git_archive_repo(optionDict, repo_and_ref): archive_name = bldinstallercommon.git_archive_repo(repo_and_ref) + (repository, ref) = repo_and_ref.split("#") + project_name = repository.split("/")[-1].split(".")[0] # Create remote dest directories remote_dest_dir_base = optionDict['PACKAGE_STORAGE_SERVER_BASE_DIR'] + '/' + project_name + '/' + ref remote_dest_dir = remote_dest_dir_base + '/' + optionDict['BUILD_NUMBER'] diff --git a/packaging-tools/create_installer.py b/packaging-tools/create_installer.py index f5342104c..d5dca3bf4 100644 --- a/packaging-tools/create_installer.py +++ b/packaging-tools/create_installer.py @@ -634,7 +634,7 @@ def qml_examples_only(examples_dir): log.error("Archive not cleaned!") return subdir_list = [] - regex = re.compile('^qml\S.*') # pylint: disable=W1401 + regex = re.compile(r'^qml\S.*') # pylint: disable=W1401 for root, dirs, _ in os.walk(examples_dir): for basename in dirs: if regex.search(basename): diff --git a/packaging-tools/dump_debug_infos.py b/packaging-tools/dump_debug_infos.py index e0c2acd88..eaf3db493 100644 --- a/packaging-tools/dump_debug_infos.py +++ b/packaging-tools/dump_debug_infos.py @@ -52,7 +52,7 @@ def is_file_with_debug_information_mac(path): return True return False -def file_with_debug_information_linux(): +def file_with_debug_information_linux(file): if file.endswith(".so") or os.access(file, os.X_OK) or file.endswith(".debug"): return True return False diff --git a/packaging-tools/libclang_training/libclangtimings2csv.py b/packaging-tools/libclang_training/libclangtimings2csv.py index d7ef915fe..3dcbbb173 100644 --- a/packaging-tools/libclang_training/libclangtimings2csv.py +++ b/packaging-tools/libclang_training/libclangtimings2csv.py @@ -53,9 +53,9 @@ def constructTimeNeededMatcher(): # : 2.5625 (100.0%) 0.1563 (100.0%) 2.7188 (100.0%) 2.7813 (100.0%) # Note: There is always at least the wall clock time at the utmost right, # the others in front (up to 3) are optional. - startIndicator = '\s*:' - notRelevantParts = '(\s*\d+\.\d+ \(\d+\.\d+\%\)){0,3}' - wallClockTime = '\s*(\d+\.\d+) \(\d+\.\d+\%\)' + startIndicator = r'\s*:' + notRelevantParts = r'(\s*\d+\.\d+ \(\d+\.\d+\%\)){0,3}' + wallClockTime = r'\s*(\d+\.\d+) \(\d+\.\d+\%\)' regex = startIndicator \ + notRelevantParts \ diff --git a/packaging-tools/libclang_training/runBatchFiles.py b/packaging-tools/libclang_training/runBatchFiles.py index 370aa6d1e..3c88f909a 100644 --- a/packaging-tools/libclang_training/runBatchFiles.py +++ b/packaging-tools/libclang_training/runBatchFiles.py @@ -243,7 +243,7 @@ def processBatchFileTimed(libClangId, batchFilePath): runRecord = processBatchFile(libClangId, batchFilePath) - printDuration(time.time() - timeStarted); + printDuration(time.time() - timeStarted) return runRecord diff --git a/packaging-tools/patch_qt.py b/packaging-tools/patch_qt.py index f138dde69..030a48482 100755 --- a/packaging-tools/patch_qt.py +++ b/packaging-tools/patch_qt.py @@ -111,7 +111,7 @@ def patchAbsoluteLibPathsFromFile(filePath): def patchAbsoluteLibPathsFromLine(line, fileExtension): - """ + r""" Captures XXX in e.g. /usr/lib/libXXX.so, /usr/lib64/libXXX.a, and C:\XXX.lib Paths are not allowed to contain whitespace though [^\s\"]+ - start of path diff --git a/packaging-tools/tests/test_runCommand.py b/packaging-tools/tests/test_runCommand.py index a09f45944..2f680c56e 100644 --- a/packaging-tools/tests/test_runCommand.py +++ b/packaging-tools/tests/test_runCommand.py @@ -42,7 +42,7 @@ if sys.platform.startswith("win"): # Raymond Chen's response [1] SEM_NOGPFAULTERRORBOX = 0x0002 # From MSDN - ctypes.windll.kernel32.SetErrorMode(SEM_NOGPFAULTERRORBOX); + ctypes.windll.kernel32.SetErrorMode(SEM_NOGPFAULTERRORBOX) subprocess_flags = 0x8000000 # win32con.CREATE_NO_WINDOW? def baseCommand(): |