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 0313EC0015E for ; Wed, 5 Jul 2023 12:21:22 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C5DEE862AE; Wed, 5 Jul 2023 14:20: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="JlxN3W07"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D23FC86261; Wed, 5 Jul 2023 14:20:26 +0200 (CEST) Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) (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 E656C861EB for ; Wed, 5 Jul 2023 14:20:22 +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-xd29.google.com with SMTP id ca18e2360f4ac-7835ffc53bfso14265339f.1 for ; Wed, 05 Jul 2023 05:20:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1688559621; x=1691151621; 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=nOJTeZG2PtGNFlgaVhzJOQWmke11r82ZpRxgG5lI4Dc=; b=JlxN3W073sdsJGa2ie293iK5OrlhYSjWzzIkQ6kqn/MY6rZrUBYgRY3HS7NF6edWyB YRIXTDPcV47bZA+6m4US0XDePrjCrx2SkqC/0KSTUKbTWJjgx38Y+Gb2G4gC4AqsgQnQ sLIFMmrl00AioVkRMhA50QgjxxB4naAK8+u70= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688559621; x=1691151621; 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=nOJTeZG2PtGNFlgaVhzJOQWmke11r82ZpRxgG5lI4Dc=; b=I/ovseOmF/4C5uMtn7EUnq5FsMjU6NnGGGFmha/ZiBt/LktKzk3g/GQxpWgdEu7KHS vdiTEEfOzAg0OMVHoG8Co39RD5aR1vQBKaj8JRg5fqdTG30hKp1EqnLv8L6FBanLQW7f rcuTnFteo2aqt0/AQLBK2QN7zG6/c0ImbX/JdJKJ3bEiT4mqbqb4FnhCZ+OnC/dUMO6A 8DWErlmNxXulkbFggOsZ4/813KW2GbH6viWf0AU3PZHQjEGD62sSPr07irWZP77xWrvH zAmpdq0f/Tpgj/pGDkuFqvspGK9RXTOj5Y1s6BfpuezgXJmOg6WvAN9EWQPnsJlw/fL3 XqoQ== X-Gm-Message-State: ABy/qLYEFLvb81DYf1Ggcu7Dr6qIW98r/QJWeoBO7Isa3DTVe4VvC2p1 9pTfPalgAJWmkNF4M3RTOABjJJ4QMfLCZjG3V1M= X-Google-Smtp-Source: APBJJlGlAG9lDlFeVVPp6SSGPYDqaaB3q6qxyK2QPTFZT3trMT94SMormuJxyfsvjn6e+fpzHXZtgw== X-Received: by 2002:a05:6602:3e90:b0:783:58f2:b8f2 with SMTP id el16-20020a0566023e9000b0078358f2b8f2mr1512810iob.6.1688559621481; Wed, 05 Jul 2023 05:20:21 -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 i11-20020a02ca4b000000b0042b1543bceasm3998459jal.21.2023.07.05.05.20.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jul 2023 05:20:21 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass Subject: [PATCH v2 04/60] buildman: Move full-help processing to main Date: Wed, 5 Jul 2023 13:18:32 +0100 Message-ID: <20230705121951.1629361-5-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.255.g8b1d071c50-goog In-Reply-To: <20230705121951.1629361-1-sjg@chromium.org> References: <20230705121951.1629361-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 c890f778f501..b27a6b08477f 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 9c84e16e7df0..2253401709a8 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, verbose, args): """Run the buildman tests @@ -62,6 +68,9 @@ def run_buildman(): if cmdline.HAS_TESTS and options.test: run_tests(options.skip_net_tests, 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.255.g8b1d071c50-goog