diff options
author | Patrik Teivonen <patrik.teivonen@qt.io> | 2023-05-04 11:47:15 +0300 |
---|---|---|
committer | Patrik Teivonen <patrik.teivonen@qt.io> | 2023-05-09 09:13:46 +0000 |
commit | 041c871442a1927ad81d8aced93e6b5a665438ae (patch) | |
tree | 7b25f221c964b046e87aa234a63a6717402b4dc3 | |
parent | a0f61cfb97b043f9a5ee98afe4251253669defe9 (diff) |
Upgrade pylint package version in Pipfile to be compatible with 3.11.
Fix or ignore checks that no longer pass as result of this change.
Change-Id: I1b311a54d817e4f20879a32cf85de6e406817ce4
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
-rw-r--r-- | .pre-commit-config.yaml | 6 | ||||
-rw-r--r-- | Pipfile | 2 | ||||
-rw-r--r-- | packaging-tools/build_wrapper.py | 17 | ||||
-rw-r--r-- | packaging-tools/create_installer.py | 42 |
4 files changed, 38 insertions, 29 deletions
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index aa01cd773..8a3c78768 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,12 +36,12 @@ repos: # Disabled: # Missing docstrings: C0114,C0115,C0116 # Line too long: C0301 - # Need refactoring: C0302,R0201,R0902,R0903,R0912,R0913,R0914,R0915 + # Need refactoring: C0302,R0201,R0902,R0903,R0904,R0912,R0913,R0914,R0915 # Duplicate code: R0801 # TODO comments: W0511 - # Too general exceptions: W0703 + # Too general exceptions: W0703, W0719 # Checkers removed in some newer versions of pylint: R0022 - entry: pipenv run python3 -m pylint -j 0 --disable=C0114,C0115,C0116,C0301,C0302,R0201,R0801,R0902,R0903,R0912,R0913,R0914,R0915,W0511,W0703,R0022 + entry: pipenv run python3 -m pylint -j 0 --disable=C0114,C0115,C0116,C0301,C0302,R0201,R0801,R0902,R0903,R0904,R0912,R0913,R0914,R0915,W0511,W0703,W0719,R0022 language: system types: [python] fail_fast: true @@ -28,7 +28,7 @@ typing_extensions = "==4.1.1" [dev-packages] ddt = "==1.6.0" -pylint = "==2.12.0" +pylint = "==2.17.3" autopep8 = "==1.6.0" mypy = "==0.971" flake8 = "==4.0.1" diff --git a/packaging-tools/build_wrapper.py b/packaging-tools/build_wrapper.py index a1506118b..749b33312 100644 --- a/packaging-tools/build_wrapper.py +++ b/packaging-tools/build_wrapper.py @@ -697,10 +697,12 @@ def handle_qt_creator_build(option_dict: Dict[str, str], qtcreator_plugins: List # Define paths for pre-built kdsme and gammaray packages kdsme_url = option_dict.get("GAMMARAY_BASE_DIR", "") if kdsme_url: - kdsme_url = (pkg_base_path + '/' + kdsme_url + '/' + target_env_dir + '/qt5_kdsme.7z') + kdsme_url = pkg_base_path + '/' + kdsme_url + '/' + target_env_dir + '/qt5_kdsme.7z' gammaray_url = option_dict.get("GAMMARAY_BASE_DIR", "") if gammaray_url: - gammaray_url = (pkg_base_path + '/' + gammaray_url + '/' + target_env_dir + '/qt5_gammaray.7z') + gammaray_url = ( + pkg_base_path + '/' + gammaray_url + '/' + target_env_dir + '/qt5_gammaray.7z' + ) download_work = ThreadedWork('Download packages') extract_work = Task('Extract packages', function=None) @@ -716,16 +718,23 @@ def handle_qt_creator_build(option_dict: Dict[str, str], qtcreator_plugins: List llvm_install_dir = None clang_filebase = option_dict.get('CLANG_FILEBASE') clang_platform = option_dict.get('CLANG_PLATFORM') + opt_clang_to_copy: List[str] = [] if clang_filebase and clang_platform: clang_extract_path = os.path.join(download_temp, 'libclang') llvm_install_dir = os.path.join(clang_extract_path, 'libclang') # package contains libclang subdir clang_suffix = option_dict.get('CLANG_FILESUFFIX') clang_suffix = clang_suffix if clang_suffix is not None else '' - clang_url = (pkg_base_path + '/' + option_dict['CLANG_FILEBASE'] + '-' + clang_platform + clang_suffix + '.7z') + clang_url = ( + pkg_base_path + '/' + option_dict['CLANG_FILEBASE'] + '-' + clang_platform + + clang_suffix + '.7z' + ) add_download_extract(clang_url, clang_extract_path) use_optimized_libclang = is_windows() if use_optimized_libclang: - opt_clang_url = (pkg_base_path + '/' + option_dict['CLANG_FILEBASE'] + '-windows-mingw_64' + clang_suffix + '.7z') + opt_clang_url = ( + pkg_base_path + '/' + option_dict['CLANG_FILEBASE'] + '-windows-mingw_64' + + clang_suffix + '.7z' + ) opt_clang_path = os.path.join(download_temp, 'opt_libclang') opt_clang_to_copy = [os.path.join('bin', file) for file in ['libclang.dll', 'clangd.exe', 'clang-tidy.exe']] diff --git a/packaging-tools/create_installer.py b/packaging-tools/create_installer.py index d89243375..381bb4ea2 100644 --- a/packaging-tools/create_installer.py +++ b/packaging-tools/create_installer.py @@ -73,7 +73,7 @@ from update_component_translations import lrelease log = init_logger(__name__, debug_mode=False) -QtInstallerTaskType = TypeVar("QtInstallerTaskType", bound="QtInstallerTask[Any]") +QtInstallerTaskT = TypeVar("QtInstallerTaskT", bound="QtInstallerTask[Any]") # ---------------------------------------------------------------------- TARGET_INSTALL_DIR_NAME_TAG = '%TARGET_INSTALL_DIR%' @@ -136,7 +136,7 @@ def check_required_tools() -> None: ############################################################## # Cleanup ############################################################## -def clean_work_dirs(task: QtInstallerTaskType) -> None: +def clean_work_dirs(task: QtInstallerTaskT) -> None: """Clean working directories.""" log.info("Cleaning work environment") for item in [task.packages_full_path_dst, task.repo_output_dir, task.config_dir_dst]: @@ -148,7 +148,7 @@ def clean_work_dirs(task: QtInstallerTaskType) -> None: ############################################################## # Set the config directory ############################################################## -def set_config_directory(task: QtInstallerTaskType) -> None: +def set_config_directory(task: QtInstallerTaskT) -> None: """Copy config directory into correct place.""" log.info("Set config directory") config_dir_template = task.config.get('ConfigDir', 'template_name') @@ -164,7 +164,7 @@ def set_config_directory(task: QtInstallerTaskType) -> None: ############################################################## # Set the config.xml ############################################################## -def set_config_xml(task: QtInstallerTaskType) -> Any: +def set_config_xml(task: QtInstallerTaskT) -> Any: """Copy config.xml template into correct place.""" log.info("Set config.xml") @@ -198,7 +198,7 @@ def set_config_xml(task: QtInstallerTaskType) -> Any: ############################################################## # Substitute common version numbers etc., match against tags ############################################################## -def substitute_global_tags(task: QtInstallerTaskType) -> None: +def substitute_global_tags(task: QtInstallerTaskT) -> None: """Substitute common version numbers etc., match against tags """ log.info("Substituting global tags:") @@ -256,7 +256,7 @@ def substitute_component_tags(tag_pair_list: List[List[str]], meta_dir_dest: str # Parse SDK components ############################################################## def parse_component_data( - task: QtInstallerTaskType, configuration_file: str, configurations_base_path: str + task: QtInstallerTaskT, configuration_file: str, configurations_base_path: str ) -> None: """Parse SDK component data""" file_full_path = configuration_file @@ -330,7 +330,7 @@ def parse_component_data( ############################################################## # Parse SDK components ############################################################## -def parse_components(task: QtInstallerTaskType) -> None: +def parse_components(task: QtInstallerTaskT) -> None: """Parse SDK all components""" log.info("Parse target configuration files") conf_base_path = task.configurations_dir + os.sep + task.platform_identifier + os.sep @@ -433,7 +433,7 @@ def process_qml_examples(directory: Path) -> None: log.warning("Skipping option 'qml_examples_only': The 'examples' directory does not exist") -def finalize_items(task: QtInstallerTaskType, items: str, install_dir: Path) -> None: +def finalize_items(task: QtInstallerTaskT, items: str, install_dir: Path) -> None: """ Perform package finalization tasks for the given archive @@ -500,7 +500,7 @@ def extract_component_data(source_archive: Path, target_directory: Path) -> None def patch_component_data( - task: QtInstallerTaskType, + task: QtInstallerTaskT, archive: IfwPayloadItem, install_dir: Path, ) -> None: @@ -521,7 +521,7 @@ def patch_component_data( def recompress_component( - task: QtInstallerTaskType, archive: IfwPayloadItem, destination_dir: Path, compress_dir: Path + task: QtInstallerTaskT, archive: IfwPayloadItem, destination_dir: Path, compress_dir: Path ) -> None: """ Recompress the component data to an IFW supported archive @@ -546,7 +546,7 @@ def recompress_component( def get_component_data( - task: QtInstallerTaskType, + task: QtInstallerTaskT, sdk_comp: IfwSdkComponent, archive: IfwPayloadItem, data_dir_dest: Path, @@ -629,7 +629,7 @@ def handle_set_executable(base_dir: str, package_finalize_items: str) -> None: def handle_set_licheck( - task: QtInstallerTaskType, base_dir: str, package_finalize_items: str + task: QtInstallerTaskT, base_dir: str, package_finalize_items: str ) -> None: for licheck_file_name in parse_package_finalize_items(package_finalize_items, 'set_licheck'): licheck_file_path = os.path.join(base_dir, licheck_file_name) @@ -651,7 +651,7 @@ def parse_package_finalize_items(package_finalize_items: str, item_category: str ############################################################## # Substitute pkg template directory names ############################################################## -def substitute_package_name(task: QtInstallerTaskType, package_name: str) -> str: +def substitute_package_name(task: QtInstallerTaskT, package_name: str) -> str: for key, value in task.substitutions.items(): package_name = package_name.replace(key, value) @@ -661,7 +661,7 @@ def substitute_package_name(task: QtInstallerTaskType, package_name: str) -> str ############################################################## # Create target components ############################################################## -def create_target_components(task: QtInstallerTaskType) -> None: +def create_target_components(task: QtInstallerTaskT) -> None: """Create target components.""" Path(task.packages_full_path_dst).mkdir(parents=True, exist_ok=True) @@ -710,7 +710,7 @@ def create_target_components(task: QtInstallerTaskType) -> None: # handle component sha1 uri if sdk_comp.comp_sha1_uri: - sha1_file_dest = (dest_base / "SHA1") + sha1_file_dest = dest_base / "SHA1" get_component_data_work.add_task( f"getting component sha1 file for {sdk_comp.ifw_sdk_comp_name}", get_component_sha1, @@ -831,7 +831,7 @@ def cleanup_docs(install_dir: str) -> None: ############################################################## # Create the final installer binary ############################################################## -def create_installer_binary(task: QtInstallerTaskType) -> None: +def create_installer_binary(task: QtInstallerTaskT) -> None: """Create installer binary files using binarycreator tool.""" log.info("Create installer binary") @@ -899,7 +899,7 @@ def create_installer_binary(task: QtInstallerTaskType) -> None: ############################################################## # Create the repository ############################################################## -def create_online_repository(task: QtInstallerTaskType) -> None: +def create_online_repository(task: QtInstallerTaskT) -> None: """Create online repository using repogen tool.""" log.info("Create online repository") @@ -952,7 +952,7 @@ def inject_update_rcc_to_archive(archive_file_path: str, file_to_be_injected: st ############################################################## # Create the final installer binary ############################################################## -def create_mac_disk_image(task: QtInstallerTaskType) -> None: +def create_mac_disk_image(task: QtInstallerTaskT) -> None: """Create Apple disk image.""" log.info("Create Apple disk image") output_dir = INSTALLER_OUTPUT_DIR_NAME @@ -963,7 +963,7 @@ def create_mac_disk_image(task: QtInstallerTaskType) -> None: run_cmd(cmd=cmd_args, cwd=task.script_root_dir) -def get_reproduce_args(task: QtInstallerTaskType) -> str: +def get_reproduce_args(task: QtInstallerTaskT) -> str: """ Generate reproducable command line arguments @@ -1000,7 +1000,7 @@ def get_reproduce_args(task: QtInstallerTaskType) -> str: ############################################################## # All main build steps ############################################################## -def create_installer(task: QtInstallerTaskType) -> None: +def create_installer(task: QtInstallerTaskT) -> None: """Installer creation main steps.""" log.info(str(task)) log.info("Creating Qt Installer Framework based installer/online repository") @@ -1043,7 +1043,7 @@ def str2bool(value: str) -> bool: @dataclass -class QtInstallerTask(Generic[QtInstallerTaskType]): +class QtInstallerTask(Generic[QtInstallerTaskT]): """QtInstallerTask dataclass""" config = ConfigParser(interpolation=ExtendedInterpolation()) |