Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AFBBFC0015E for ; Sun, 16 Jul 2023 00:41:09 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 260F986627; Sun, 16 Jul 2023 02:38:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="CwiS2XE8"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 996E586351; Sun, 16 Jul 2023 02:37:46 +0200 (CEST) Received: from mail-il1-x12d.google.com (mail-il1-x12d.google.com [IPv6:2607:f8b0:4864:20::12d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 85F5D86351 for ; Sun, 16 Jul 2023 02:37:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x12d.google.com with SMTP id e9e14a558f8ab-345d6dc271dso16223515ab.0 for ; Sat, 15 Jul 2023 17:37:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1689467859; x=1692059859; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VDXqPBmNQ0IR427SYvre4cgr2dWmKxg/G20OEOv16Rw=; b=CwiS2XE8rlfhnjAe4TUYPo73nYE3oyOEdMCd5tZo5VkExWfLS68okqsTjtaM4YIO9N gxSaDIp74WfU4LdLjVqh5pVvDBhQDotsEHj+FyDZpPyIwpIiaeOraBnOHrge3rzCsgDS CutRl9WcUR02DWm5rQqoKKRJky93czB8EUjAg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689467859; x=1692059859; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VDXqPBmNQ0IR427SYvre4cgr2dWmKxg/G20OEOv16Rw=; b=Yt0WFY+el5+ew1FnwyxthSwgYAXylW5T7zNt28/at4JBGnFhQ5wb4/s0RPFr2Uq1tV f0NnTFHVBzr4TieU4ix1sP/FCcDxHujBTMwxLap32ZNjvw46v/Ap369lZl+p4Ht9ZQfa pHy2j6YUDBnYA9vHAWedLupjL1CReV/kKbxTS4HnMZUYQ3sM9AtZAVWBwkycIrJC6liw uIstZe5bCcuoq3R4Dy0wHVFYdO2fbY9TD3gNRdnaxPhSPutlBXKhXn2HzYMq+fh8Ra53 OSzIsVUsZl1dLIZWfIL8IkcMmPmWRqZDmJWK1s7n396sdqyHGPxVOBIVOQGT2B+2NQsl BX1g== X-Gm-Message-State: ABy/qLZHcYrrwH7kAGHFho6CAqsRJ/HETP4Q+F/bjsBM4y3nCMAlBca9 8LruQo+ljETGsdC9lyjqeO1o5AsOFDZMGeZH1wI= X-Google-Smtp-Source: APBJJlEXDVoefKG4Si/6NZFdmkUsHDPgwrExZ6jkWQPmKcJRtbpk732LR/18PAqYoNZG16srHs8tmw== X-Received: by 2002:a92:d4d2:0:b0:345:d470:baa6 with SMTP id o18-20020a92d4d2000000b00345d470baa6mr7106092ilm.29.1689467859084; Sat, 15 Jul 2023 17:37:39 -0700 (PDT) Received: from sjg1.lan (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id t3-20020a05663801e300b0042b52dc77e3sm3510512jaq.158.2023.07.15.17.37.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Jul 2023 17:37:38 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Mike Frysinger , Simon Glass Subject: [PATCH v3 22/81] buildman: Move full-help processing to main Date: Sat, 15 Jul 2023 18:35:50 -0600 Message-ID: <20230716003718.231903-23-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.455.g037347b96a-goog In-Reply-To: <20230716003718.231903-1-sjg@chromium.org> References: <20230716003718.231903-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean This does not need any of the control features. Move it out of main to reduce the size of the do_buildman() function. For Python 3.6 the -H feature will not work, but this does not seem to be a huge problem, as it dates from 2016. Signed-off-by: Simon Glass --- (no changes since v1) tools/buildman/control.py | 11 ----------- tools/buildman/main.py | 9 +++++++++ 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/tools/buildman/control.py b/tools/buildman/control.py index c4be1ad2f4ec..2e4ba0b21785 100644 --- a/tools/buildman/control.py +++ b/tools/buildman/control.py @@ -8,11 +8,6 @@ This holds the main control logic for buildman, when not running tests. """ import multiprocessing -try: - import importlib.resources -except ImportError: - # for Python 3.6 - import importlib_resources import os import shutil import sys @@ -26,7 +21,6 @@ from patman import gitutil from patman import patchstream from u_boot_pylib import command from u_boot_pylib import terminal -from u_boot_pylib import tools from u_boot_pylib.terminal import tprint TEST_BUILDER = None @@ -177,11 +171,6 @@ def do_buildman(options, args, toolchains=None, make_func=None, brds=None, # Used so testing can obtain the builder: pylint: disable=W0603 global TEST_BUILDER - if options.full_help: - with importlib.resources.path('buildman', 'README.rst') as readme: - tools.print_full_help(str(readme)) - return 0 - gitutil.setup() col = terminal.Color() diff --git a/tools/buildman/main.py b/tools/buildman/main.py index d9ad83621509..9a1d59964ea9 100755 --- a/tools/buildman/main.py +++ b/tools/buildman/main.py @@ -6,6 +6,11 @@ """See README for more information""" +try: + from importlib.resources import files +except ImportError: + # for Python 3.6 + import importlib_resources import os import sys @@ -19,6 +24,7 @@ from buildman import bsettings from buildman import cmdline from buildman import control from u_boot_pylib import test_util +from u_boot_pylib import tools def run_tests(skip_net_tests, debug, verbose, args): """Run the buildman tests @@ -64,6 +70,9 @@ def run_buildman(): return run_tests(options.skip_net_tests, options.debug, options.verbose, args) + elif options.full_help: + tools.print_full_help(str(files('buildman').joinpath('README.rst'))) + # Build selected commits for selected boards else: bsettings.Setup(options.config_file) -- 2.41.0.455.g037347b96a-goog