[PATCH v2 07/24] patman: Avoid importing test_checkpatch before it is needed

Simon Glass sjg at chromium.org
Fri Feb 24 02:18:07 CET 2023


Tests are not packaged with patman so this file will not be accessible
when installing with pip. Move the import later in the file, when we
know the file is present.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

Changes in v2:
- Add new patch to avoid importing test_checkpatch before it is needed

 tools/patman/__main__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/patman/__main__.py b/tools/patman/__main__.py
index 30632559bb6..48ffbc8eadf 100755
--- a/tools/patman/__main__.py
+++ b/tools/patman/__main__.py
@@ -24,7 +24,6 @@ from patman import func_test
 from patman import gitutil
 from patman import project
 from patman import settings
-from patman import test_checkpatch
 from u_boot_pylib import terminal
 from u_boot_pylib import test_util
 from u_boot_pylib import tools
@@ -146,6 +145,7 @@ if not args.debug:
 # Run our meagre tests
 if args.cmd == 'test':
     from patman import func_test
+    from patman import test_checkpatch
 
     result = test_util.run_test_suites(
         'patman', False, False, False, None, None, None,
-- 
2.39.2.637.g21b0678d19-goog



More information about the U-Boot mailing list