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 7D113C001DC for ; Wed, 19 Jul 2023 23:54:16 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CC47A86814; Thu, 20 Jul 2023 01:51:11 +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="cNVqe08O"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D711186702; Thu, 20 Jul 2023 01:50:24 +0200 (CEST) Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) (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 D3BF8867C5 for ; Thu, 20 Jul 2023 01:50:18 +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-io1-xd31.google.com with SMTP id ca18e2360f4ac-7835971026fso8362039f.3 for ; Wed, 19 Jul 2023 16:50:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1689810617; x=1690415417; 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=KYaMb/PwcosMIpxLwy6IVzILU2OPxPJhvcgOktCbD8s=; b=cNVqe08OMGMnNtnwG+2wK9yxUp24MyOGV/0vSqcjzJDLgMrzvWPwHaaxg+8sckS6UN sb6QjCdQEVUhFjlSLM0M3vBTNGdIvWyc1yJ046kR2pS8MxtA0w/sFCLnxPPnKyhN8Tfy e0q0bFuXJHlfHuc1BA5TViN0TLPFD5VGw+VYU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689810617; x=1690415417; 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=KYaMb/PwcosMIpxLwy6IVzILU2OPxPJhvcgOktCbD8s=; b=YfzvBnJ3H6p9rc1FG9kjVdfGA4VrbyD3RQrOolfcEomJZN8maQVTjqjGbmxu1MY9Ew 1YMhYmU3ekGoz9/ke5hzkYYM8wrCY8W998J34VrUh3VYwzUniZjjjv4NL2s82Tk0z1Xg 0kpHJTy41/q7ovu8M7UjMuIyrnBgSKWBUkiaCk4HYv2M5f9D+LmDh08BE9yNG/bH598c VSQ444ACNl7c5kCK1g9Y+sG/kcr3Fzaca+XtXj7EaqTVhB7miWbT7s5deuUfJMRjqRpu EiJOF+lr7FV/VPyBiEQTjIArLTkUIT9QnzKac58NGuCR/34y5oDVbPrZM0VEJTsvGl4b +XFw== X-Gm-Message-State: ABy/qLbN+D7ZxOZxWM03XIrO19TcAZY7+Fbugrq6WL39ODlla4mHSkxc CBfctY6GP4StCiJMlQoy2YlROR2rsY8ZyyQrOMo= X-Google-Smtp-Source: APBJJlHozo/360ASwwyP5KZJh1Hs3S0fh3fdu2hKNpeg98vhsfl72ZsAThXxNmAsJKnLsQs2mpHGsw== X-Received: by 2002:a5e:a61a:0:b0:783:49ec:8115 with SMTP id q26-20020a5ea61a000000b0078349ec8115mr3809905ioi.5.1689810617351; Wed, 19 Jul 2023 16:50:17 -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 ed16-20020a056638291000b0042bb1779c18sm1551779jab.151.2023.07.19.16.50.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jul 2023 16:50:17 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Mike Frysinger , Simon Glass Subject: [PATCH v4 24/83] buildman: Move full-help processing to main Date: Wed, 19 Jul 2023 17:48:32 -0600 Message-ID: <20230719234953.796101-25-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230719234953.796101-1-sjg@chromium.org> References: <20230719234953.796101-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.487.g6d72f3e995-goog