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 E84ADC61DA4 for ; Fri, 24 Feb 2023 01:18:38 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 37CA185911; Fri, 24 Feb 2023 02:18:36 +0100 (CET) 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="mjf1zf4a"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9F5528338B; Fri, 24 Feb 2023 02:18:33 +0100 (CET) Received: from mail-il1-x133.google.com (mail-il1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) (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 F397D8338B for ; Fri, 24 Feb 2023 02:18:29 +0100 (CET) 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-x133.google.com with SMTP id h10so2247482ila.11 for ; Thu, 23 Feb 2023 17:18:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=yG41t7W3L3jJK+PqYMEoarz6uvOfRGmfFg00ftWJan8=; b=mjf1zf4aJMP+Bax+tBix8BV9f9Y7naaaVVOYj+EHiEKAR8vCUsR6yX3UeIkgCvvxal Pfgvs1R6TjOr/LEB1n3kgu9YrYlSgiH64qq28peIX7rgFrANacVnm+C/f39KTnNZqvp5 ifsB+C/9tuJxplLOqV+GBJNVQwN9pTRYGCl5E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=yG41t7W3L3jJK+PqYMEoarz6uvOfRGmfFg00ftWJan8=; b=tTQujTSpyjUrd4NCl/MLZnnM7jtD6YFK+FN9UTuumBaWpJXs/3g15x7RV+/Zn2piKE St3injWEYW8eKavVVKUWvChBjiTltcwmJwcHoDQg5NHbGnM/CT3xGcyHe9cw0gQwwAyF 5M5yox6bw/XBME+VP6Ba4laaar1XHHS5OHu4QrYhUMIeRit5A0bkyoQ3SvJB+YKIg1v/ ImqVDKYzg7A0ALHlIDQywyTDitQBW9Vh8xqi/K7rnWSmqB7hWVxkaIAVEThq3Ry29GrB Kg98G9sqh1d8i03wc2lEgu+LikoLaw4r1t8qbDU8oRmenlBEa6hfRBNIoD/0NMv7//We Z7rQ== X-Gm-Message-State: AO0yUKXmcwn7ZMRCyB5o/9DlRltoWrUb6QojNw4M/z/Dy2366E122Yby Ys6y/cS/h5jP4Zm/C/eQyzHNHIOCfWKLG7JV X-Google-Smtp-Source: AK7set9DGqUO7JwZj65rKyLKWh7frksZGXmi6GqR0evv3AEUVr2XzWl7qXSHVrmk36m2RfvHfF/cZg== X-Received: by 2002:a05:6e02:b25:b0:315:9891:85d7 with SMTP id e5-20020a056e020b2500b00315989185d7mr9516486ilu.16.1677201508338; Thu, 23 Feb 2023 17:18:28 -0800 (PST) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id q3-20020a92d403000000b003127b668eafsm2677214ilm.19.2023.02.23.17.18.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Feb 2023 17:18:27 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Alper Nebi Yasak , Neha Malcom Francis , Stefan Herbrechtsmeier , Philippe Reynes , Peng Fan , Heinrich Schuchardt , Simon Glass , Joel Stanley , Jonas Karlman , =?UTF-8?q?Marek=20Beh=C3=BAn?= , Maxim Cournoyer , Michal Suchanek , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Quentin Schulz , Rick Chen Subject: [PATCH v2 00/24] tools: Support uploading tools to PyPi for use with pip Date: Thu, 23 Feb 2023 18:18:00 -0700 Message-Id: <20230224011824.2111976-1-sjg@chromium.org> X-Mailer: git-send-email 2.39.2.637.g21b0678d19-goog 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.6 at phobos.denx.de X-Virus-Status: Clean Some of the tools in U-Boot are useful beyond just U-Boot. For example, patman can be used to work with Linux and other projects which use mailing lists (and patchwork) for patch submissions. Binman can be used to package firmware for any project, even though it is heavily slanted towards U-Boot so far. While patman has a setup script which is easy to use, binman is a little more complicated, since it has dependencies, in particular pylibfdt It would be better if we could put all the tools on PyPi. This series adds a script for uploading tools. It makes it easier to update PyPi from time to time, when new features appear. U-Boot uses tools/patman as a common library of Python functions. For this to work with PyPi it is easier to split these into a separate library, used by patman as well. This series creates a new 'u_boot_pylib' package for this purpose. Unfortunately, the U-Boot version of concurrencytest has some local patches. To avoid dependency issues it seems better to revert these and rely on the upstream package[1], although note that it is not actually installed. [1] Which unfortunately may be dead but perhaps we could request a new maintainer? Changes in v2: - Add a patch to hide the test options unless test code is available - Add new patch to avoid importing test_checkpatch before it is needed - Add new patch to use importlib to find the help - Add patch to fix use of a type as a variable - Add patch to split out the main code into a function - Drop test files - Fix removable of the /tmp dir - Quite a few updates to make things work with the new names - Rename the package to patch-manager - Update the cover letter Simon Glass (24): binman: Avoid unwanted output in testFitFirmwareLoadables() Revert "patman: test_util: Print test stdout/stderr within test summaries" Remove concurrencytest patman: Move library functions into a library directory script: Add a script to build a PyPi package patman: Add support for building a u_boot_tools PyPi package patman: Avoid importing test_checkpatch before it is needed patman: Add support for building a patman PyPi package buildman: Move the main code into a function buildman: Hide the test options unless test code is available buildman: Fix use of a type as a variable buildman: Use importlib to find the help buildman: Add support for building a buildman PyPi package dtoc: Hide the test options unless test code is available dtoc: Move the main code into a function dtoc: Use pathlib to find the test directory dtoc: Add support for building a dtoc PyPi package binman: Move the main code into a function binman: Hide the 'test' command unless test code is available binman: Use importlib to find the help binman: Add support for building a binmanu PyPi package test: Add concurrencytest to the requirements doc: Add notes on how to install patman and binman CI: Add a check for building tools for PyPi .azure-pipelines.yml | 10 + .gitlab-ci.yml | 6 + Makefile | 22 +- scripts/event_dump.py | 2 +- scripts/make_pip.sh | 117 ++++++ test/py/requirements.txt | 1 + test/run | 1 + tools/binman/binman.rst | 13 + tools/binman/bintool.py | 8 +- tools/binman/bintool_test.py | 8 +- tools/binman/btool/lz4.py | 2 +- tools/binman/btool/lzma_alone.py | 2 +- tools/binman/cbfs_util.py | 4 +- tools/binman/cbfs_util_test.py | 4 +- tools/binman/cmdline.py | 34 +- tools/binman/control.py | 12 +- tools/binman/elf.py | 6 +- tools/binman/elf_test.py | 8 +- tools/binman/entry.py | 6 +- tools/binman/entry_test.py | 2 +- tools/binman/etype/_testing.py | 2 +- tools/binman/etype/atf_fip.py | 2 +- tools/binman/etype/blob.py | 4 +- tools/binman/etype/blob_ext.py | 4 +- tools/binman/etype/blob_ext_list.py | 4 +- tools/binman/etype/fdtmap.py | 4 +- tools/binman/etype/files.py | 2 +- tools/binman/etype/fill.py | 2 +- tools/binman/etype/fit.py | 2 +- tools/binman/etype/fmap.py | 6 +- tools/binman/etype/gbb.py | 4 +- tools/binman/etype/intel_ifwi.py | 2 +- tools/binman/etype/mkimage.py | 2 +- tools/binman/etype/null.py | 2 +- tools/binman/etype/pre_load.py | 2 +- tools/binman/etype/section.py | 6 +- tools/binman/etype/text.py | 2 +- tools/binman/etype/u_boot_dtb_with_ucode.py | 2 +- tools/binman/etype/u_boot_elf.py | 2 +- tools/binman/etype/u_boot_env.py | 2 +- tools/binman/etype/u_boot_spl_bss_pad.py | 2 +- tools/binman/etype/u_boot_spl_expanded.py | 2 +- tools/binman/etype/u_boot_tpl_bss_pad.py | 2 +- tools/binman/etype/u_boot_tpl_expanded.py | 2 +- .../binman/etype/u_boot_tpl_with_ucode_ptr.py | 4 +- tools/binman/etype/u_boot_ucode.py | 2 +- tools/binman/etype/u_boot_vpl_bss_pad.py | 2 +- tools/binman/etype/u_boot_vpl_expanded.py | 2 +- tools/binman/etype/u_boot_with_ucode_ptr.py | 4 +- tools/binman/etype/vblock.py | 2 +- tools/binman/fdt_test.py | 2 +- tools/binman/fip_util.py | 4 +- tools/binman/fip_util_test.py | 4 +- tools/binman/fmap_util.py | 2 +- tools/binman/ftest.py | 17 +- tools/binman/image.py | 4 +- tools/binman/image_test.py | 2 +- tools/binman/main.py | 19 +- tools/binman/pyproject.toml | 29 ++ tools/binman/state.py | 4 +- tools/buildman/builder.py | 6 +- tools/buildman/builderthread.py | 2 +- tools/buildman/cfgutil.py | 2 +- tools/buildman/cmdline.py | 14 +- tools/buildman/control.py | 18 +- tools/buildman/func_test.py | 8 +- tools/buildman/main.py | 31 +- tools/buildman/pyproject.toml | 29 ++ tools/buildman/test.py | 8 +- tools/buildman/toolchain.py | 6 +- tools/concurrencytest/.gitignore | 1 - tools/concurrencytest/README.md | 74 ---- tools/concurrencytest/__init__.py | 0 tools/concurrencytest/concurrencytest.py | 221 ------------ tools/dtoc/README.rst | 15 + tools/dtoc/fdt.py | 2 +- tools/dtoc/fdt_util.py | 4 +- tools/dtoc/main.py | 110 +++--- tools/dtoc/pyproject.toml | 26 ++ tools/dtoc/test_dtoc.py | 10 +- tools/dtoc/test_fdt.py | 7 +- tools/dtoc/test_src_scan.py | 4 +- tools/patman/__init__.py | 7 +- tools/patman/__main__.py | 10 +- tools/patman/checkpatch.py | 4 +- tools/patman/control.py | 2 +- tools/patman/func_test.py | 6 +- tools/patman/get_maintainer.py | 2 +- tools/patman/gitutil.py | 4 +- tools/patman/patchstream.py | 2 +- tools/patman/patman.rst | 12 + tools/patman/pyproject.toml | 29 ++ tools/patman/series.py | 4 +- tools/patman/status.py | 4 +- tools/patman/test_settings.py | 2 +- tools/rmboard.py | 2 +- tools/u_boot_pylib/LICENSE | 339 ++++++++++++++++++ tools/u_boot_pylib/README.rst | 15 + tools/u_boot_pylib/__init__.py | 4 + tools/u_boot_pylib/__main__.py | 23 ++ tools/{patman => u_boot_pylib}/command.py | 2 +- .../cros_subprocess.py | 0 tools/u_boot_pylib/pyproject.toml | 22 ++ tools/{patman => u_boot_pylib}/terminal.py | 0 tools/{patman => u_boot_pylib}/test_util.py | 39 +- tools/{patman => u_boot_pylib}/tools.py | 4 +- tools/{patman => u_boot_pylib}/tout.py | 2 +- tools/u_boot_pylib/u_boot_pylib | 1 + 108 files changed, 1000 insertions(+), 576 deletions(-) create mode 100755 scripts/make_pip.sh create mode 100644 tools/binman/pyproject.toml create mode 100644 tools/buildman/pyproject.toml delete mode 100644 tools/concurrencytest/.gitignore delete mode 100644 tools/concurrencytest/README.md delete mode 100644 tools/concurrencytest/__init__.py delete mode 100644 tools/concurrencytest/concurrencytest.py create mode 100644 tools/dtoc/README.rst create mode 100644 tools/dtoc/pyproject.toml create mode 100644 tools/patman/pyproject.toml create mode 100644 tools/u_boot_pylib/LICENSE create mode 100644 tools/u_boot_pylib/README.rst create mode 100644 tools/u_boot_pylib/__init__.py create mode 100755 tools/u_boot_pylib/__main__.py rename tools/{patman => u_boot_pylib}/command.py (99%) rename tools/{patman => u_boot_pylib}/cros_subprocess.py (100%) create mode 100644 tools/u_boot_pylib/pyproject.toml rename tools/{patman => u_boot_pylib}/terminal.py (100%) rename tools/{patman => u_boot_pylib}/test_util.py (85%) rename tools/{patman => u_boot_pylib}/tools.py (99%) rename tools/{patman => u_boot_pylib}/tout.py (99%) create mode 120000 tools/u_boot_pylib/u_boot_pylib -- 2.39.2.637.g21b0678d19-goog