From patchwork Sun Jan 4 20:08:30 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1260 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767557342; bh=dOH6ZNx4gTgPBZGV9dJUTzPIR8Z3gQ67bDDTd20yNYY=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Sva/aXVwvYf1TwxiwqtxIulBqHSQ0sgmtz98I2ovnt3SU66/DM+RdXqrwfJU/Lc6R ut65l2zrpXT2ajs45gFNUocm+rrIyaA5g2zm3wEu98vqCd8nAf4akG+qfByH7XC7DR kvkm/p8WY9AoWU9pYReofNIc32OOoqZytEBzSqTM2gQ8bZc7TNRj4h8GGXxuR+iDh8 gmqAt3wMy20oLdYaNJd/65E8ZUezX7KAiJY+IkQMxUWQ0yAau3kjdIdG+HahKZDXxg rz48GUb4r1GcdbVTDRug2bysRLEF4+cdzSo3ZYuoZKMsQDLEtWSvbS7DAahjGwtKYQ Us6SzOvprlUBg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8BFC869003 for ; Sun, 4 Jan 2026 13:09:02 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 1hfSXtNAPNha for ; Sun, 4 Jan 2026 13:09:02 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767557342; bh=dOH6ZNx4gTgPBZGV9dJUTzPIR8Z3gQ67bDDTd20yNYY=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Sva/aXVwvYf1TwxiwqtxIulBqHSQ0sgmtz98I2ovnt3SU66/DM+RdXqrwfJU/Lc6R ut65l2zrpXT2ajs45gFNUocm+rrIyaA5g2zm3wEu98vqCd8nAf4akG+qfByH7XC7DR kvkm/p8WY9AoWU9pYReofNIc32OOoqZytEBzSqTM2gQ8bZc7TNRj4h8GGXxuR+iDh8 gmqAt3wMy20oLdYaNJd/65E8ZUezX7KAiJY+IkQMxUWQ0yAau3kjdIdG+HahKZDXxg rz48GUb4r1GcdbVTDRug2bysRLEF4+cdzSo3ZYuoZKMsQDLEtWSvbS7DAahjGwtKYQ Us6SzOvprlUBg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7A688690D1 for ; Sun, 4 Jan 2026 13:09:02 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767557340; bh=CRk627loQS8K2QWBgJi9Ad8n4SP6Un5p/GVW6nx/J5E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M06LfxOwoP7C14FPDnrW75LMpGh+1G3REMxuJUh6XBXIhseICQsybi6FuYvmk3net //mOSsaF1NTyJOiN4vc25OTSw+jXzS/qiBuQkwTBNIpQLquycZVHMQ25hO+lGpQKYK yVD8k+NnGXMVaMnnHIdXMjkBhlSkXz02VgsH18t4QFtH3JwjYBLyLzPLR1qyTvoQ0F kcoh/mUc+eGnF7XVcp6pvugsgTU+5QPlNV4CrXj2ktUVAkz760h/PiI2IU95jWRVQ/ 3FjsGnX9zgHJLKT797jow0+5gWReVBvsO5SfS/UsmU13fFqIsBxKVQFATSuQneTA6m xuiTSPaDIYULA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 81939690D2; Sun, 4 Jan 2026 13:09:00 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id 5k2RerkI6XCK; Sun, 4 Jan 2026 13:09:00 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767557336; bh=czUwDr+YNfcdBcp/6kPJUWzTbc5iVFhUeu4ZbKkf/ao=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VV0TFvRc072KBL91zsrHcnCqtllk3hgG7HWE6Qf4GBAQiLy1fwAxt3kAF7SF6Q3wW t9nOcJ8uLhWMgn5jB01q2pDVcPDS1gryUmwql92SS/4Xo2JcvbqE5Pkrn6PWhyBsgT b4yaiNeOIwOmhnnt97XJ9wIgFFQY4sN97Th1KE9k7lYNgAhLxv9pTWYCDHSzSMZPiY yFsX0SojaTHqbwTR11HLw8apM6w+QI1ZWSz0BzHmN/bM8TxM/LKC7Dm+s+8eeXOEdE dtZoH7TkfPVbzxHQCoQ2cFuA1bG4pZrKLQR7ja80iniUSDBXu8u21TYIzaprZ2H+5S Yd1wj3HMxqKWw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id D07BE69003; Sun, 4 Jan 2026 13:08:55 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 4 Jan 2026 13:08:30 -0700 Message-ID: <20260104200844.481633-2-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260104200844.481633-1-sjg@u-boot.org> References: <20260104200844.481633-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: BMGP2PW6BN7JORKVICKX6AAMU3XNWTJI X-Message-ID-Hash: BMGP2PW6BN7JORKVICKX6AAMU3XNWTJI X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass , Claude X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 01/11] buildman: Fix pylint warnings in main.py List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Fix the remaining pylint warnings: - Remove dead Python 3.6 importlib_resources fallback import - Fix docstring parameter name (verbosity -> verbose) - Remove unnecessary elif/else after return statements - Add missing return statements for consistent function returns Co-developed-by: Claude Signed-off-by: Simon Glass --- tools/buildman/main.py | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/tools/buildman/main.py b/tools/buildman/main.py index 22be946b37d..914dfe04988 100755 --- a/tools/buildman/main.py +++ b/tools/buildman/main.py @@ -6,11 +6,7 @@ """See README for more information""" -try: - import importlib.resources -except ImportError: - # for Python 3.6 - import importlib_resources +import importlib.resources import os import sys @@ -33,7 +29,7 @@ def run_tests(skip_net_tests, debug, verbose, args): Args: skip_net_tests (bool): True to skip tests which need the network debug (bool): True to run in debugging mode (full traceback) - verbosity (int): Verbosity level to use (0-4) + verbose (int): Verbosity level to use (0-4) args (list of str): List of tests to run, empty to run all """ # These imports are here since tests are not available when buildman is @@ -87,27 +83,27 @@ def run_buildman(): if cmdline.HAS_TESTS and args.test: return run_tests(args.skip_net_tests, args.debug, args.verbose, args) - elif cmdline.HAS_TESTS and args.coverage: + if cmdline.HAS_TESTS and args.coverage: run_test_coverage() + return 0 - elif args.full_help: + if args.full_help: if hasattr(importlib.resources, 'files'): dirpath = importlib.resources.files('buildman') tools.print_full_help(str(dirpath.joinpath('README.rst'))) else: with importlib.resources.path('buildman', 'README.rst') as readme: tools.print_full_help(str(readme)) - + return 0 # Build selected commits for selected boards - else: - try: - tout.init(tout.INFO if args.verbose else tout.WARNING) - bsettings.setup(args.config_file) - ret_code = control.do_buildman(args) - finally: - tout.uninit() - return ret_code + try: + tout.init(tout.INFO if args.verbose else tout.WARNING) + bsettings.setup(args.config_file) + ret_code = control.do_buildman(args) + finally: + tout.uninit() + return ret_code if __name__ == "__main__":