From 7f5c24ad35419d4779f6f61c891b9bb0da5a41b1 Mon Sep 17 00:00:00 2001 From: Joey Vagedes Date: Fri, 27 Oct 2023 08:15:50 -0700 Subject: .pytool: Integration of edk2-pytools Performs Integration instructions necessary to upgrade edk2-pytool-library to 0.19.3 and edk2-pytool-extensions to 0.25.1. This includes resolving deprecation warnings in the UncrustifyCheck plugin, and Updating the HostUnitTestDscCompleteCheck plguin to account for a change such that inf's that do not filter the LIBRARY_CLASS define to certain types, are assumed to also support HOST_APPLICATION. Cc: Sean Brogan Cc: Michael Kubacki Cc: Michael D Kinney Cc: Liming Gao Signed-off-by: Joey Vagedes Message-Id: <20231027151551.1043941-2-joeyvagedes@microsoft.com> Reviewed-by: Rebecca Cran Reviewed-by: Michael Kubacki --- .../HostUnitTestDscCompleteCheck.py | 7 ++++--- .pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py | 12 ++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) (limited to '.pytool') diff --git a/.pytool/Plugin/HostUnitTestDscCompleteCheck/HostUnitTestDscCompleteCheck.py b/.pytool/Plugin/HostUnitTestDscCompleteCheck/HostUnitTestDscCompleteCheck.py index 8a8883e..164c8d4 100644 --- a/.pytool/Plugin/HostUnitTestDscCompleteCheck/HostUnitTestDscCompleteCheck.py +++ b/.pytool/Plugin/HostUnitTestDscCompleteCheck/HostUnitTestDscCompleteCheck.py @@ -10,7 +10,7 @@ import logging import os from edk2toolext.environment.plugintypes.ci_build_plugin import ICiBuildPlugin from edk2toollib.uefi.edk2.parsers.dsc_parser import DscParser -from edk2toollib.uefi.edk2.parsers.inf_parser import InfParser +from edk2toollib.uefi.edk2.parsers.inf_parser import InfParser, AllPhases from edk2toolext.environment.var_dict import VarDict @@ -116,8 +116,9 @@ class HostUnitTestDscCompleteCheck(ICiBuildPlugin): # should compile test a library that is declared type HOST_APPLICATION pass - elif len(infp.SupportedPhases) > 0 and \ - "HOST_APPLICATION" in infp.SupportedPhases: + elif (len(infp.SupportedPhases) > 0 and + "HOST_APPLICATION" in infp.SupportedPhases and + infp.SupportedPhases != AllPhases): # should compile test a library that supports HOST_APPLICATION but # require it to be an explicit opt-in pass diff --git a/.pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py b/.pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py index ffc72f2..9aeef5a 100644 --- a/.pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py +++ b/.pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py @@ -299,7 +299,7 @@ class UncrustifyCheck(ICiBuildPlugin): If git is not found, an empty list will be returned. """ if not shutil.which("git"): - logging.warn( + logging.warning( "Git is not found on this system. Git submodule paths will not be considered.") return [] @@ -325,7 +325,7 @@ class UncrustifyCheck(ICiBuildPlugin): If git is not found, an empty list will be returned. """ if not shutil.which("git"): - logging.warn( + logging.warning( "Git is not found on this system. Git submodule paths will not be considered.") return [] @@ -372,9 +372,9 @@ class UncrustifyCheck(ICiBuildPlugin): file_template_path = pathlib.Path(os.path.join(self._plugin_path, file_template_name)) self._file_template_contents = file_template_path.read_text() except KeyError: - logging.warn("A file header template is not specified in the config file.") + logging.warning("A file header template is not specified in the config file.") except FileNotFoundError: - logging.warn("The specified file header template file was not found.") + logging.warning("The specified file header template file was not found.") try: func_template_name = parser["dummy_section"]["cmt_insert_func_header"] @@ -384,9 +384,9 @@ class UncrustifyCheck(ICiBuildPlugin): func_template_path = pathlib.Path(os.path.join(self._plugin_path, func_template_name)) self._func_template_contents = func_template_path.read_text() except KeyError: - logging.warn("A function header template is not specified in the config file.") + logging.warning("A function header template is not specified in the config file.") except FileNotFoundError: - logging.warn("The specified function header template file was not found.") + logging.warning("The specified function header template file was not found.") def _initialize_app_info(self) -> None: """ -- cgit v1.1