List-Id: U-Boot discussion <u-boot.lists.denx.de> From: sjg at chromium.org (Simon Glass) Date: Fri, 17 Apr 2020 18:08:51 -0600 Subject: [PATCH v2 00/14] tools: patman: Convert Python tools to use absolute imports Message-ID: <20200418000905.239056-1-sjg@chromium.org>
At present the Python tools use relative paths to find modules they use from another tool. This means we need to adjust the sys.path variable at times. It also makes installing the tools (with python setup.py install) more difficult, since once installed the path of the executable (e.g. /usr/bin) is not the same as where the modules are installed (e.g. /usr/local/lib/python3.6/dist-packages). It is better to use absolute paths. This series makes this adjustment, with 'tools/' as the base directory. Once the tools are installed, things work correctly. Changes in v2: - Expand to convert all Python tools in U-Boot Simon Glass (14): patman: Rename the main module rmboard: Move to Python 3 patman: Drop references to __future__ patman: Drop Python 2 StringIO code buildman: Rename the main module dtoc: Rename the main module binman: Rename the main module Add a 'make tcheck' option to test tools patman: Drop the python2 code in test coverage patman: Move test running/reporting to test_util buildman: Move to absolute imports binman: Move to absolute imports patman: Move to absolute imports patman: Tidy up sys.path changes Makefile | 6 +- test/run | 26 ++-- tools/binman/binman | 2 +- tools/binman/cbfs_util.py | 8 +- tools/binman/cbfs_util_test.py | 12 +- tools/binman/control.py | 20 ++- tools/binman/elf.py | 8 +- tools/binman/elf_test.py | 10 +- tools/binman/entry.py | 22 +-- tools/binman/entry_test.py | 12 +- tools/binman/etype/__init__.py | 0 tools/binman/etype/_testing.py | 6 +- tools/binman/etype/blob.py | 8 +- tools/binman/etype/blob_dtb.py | 6 +- tools/binman/etype/blob_named_by_arg.py | 4 +- tools/binman/etype/cbfs.py | 10 +- tools/binman/etype/cros_ec_rw.py | 2 +- tools/binman/etype/fdtmap.py | 10 +- tools/binman/etype/files.py | 8 +- tools/binman/etype/fill.py | 6 +- tools/binman/etype/fmap.py | 10 +- tools/binman/etype/gbb.py | 8 +- tools/binman/etype/image_header.py | 4 +- tools/binman/etype/intel_cmc.py | 4 +- tools/binman/etype/intel_descriptor.py | 4 +- tools/binman/etype/intel_fit.py | 2 +- tools/binman/etype/intel_fit_ptr.py | 2 +- tools/binman/etype/intel_fsp.py | 4 +- tools/binman/etype/intel_fsp_m.py | 4 +- tools/binman/etype/intel_fsp_s.py | 4 +- tools/binman/etype/intel_fsp_t.py | 4 +- tools/binman/etype/intel_ifwi.py | 8 +- tools/binman/etype/intel_me.py | 4 +- tools/binman/etype/intel_mrc.py | 4 +- tools/binman/etype/intel_refcode.py | 4 +- tools/binman/etype/intel_vbt.py | 4 +- tools/binman/etype/intel_vga.py | 4 +- .../etype/powerpc_mpc85xx_bootpg_resetvec.py | 4 +- tools/binman/etype/section.py | 10 +- tools/binman/etype/text.py | 6 +- tools/binman/etype/u_boot.py | 4 +- tools/binman/etype/u_boot_dtb.py | 4 +- tools/binman/etype/u_boot_dtb_with_ucode.py | 10 +- tools/binman/etype/u_boot_elf.py | 8 +- tools/binman/etype/u_boot_img.py | 4 +- tools/binman/etype/u_boot_nodtb.py | 4 +- tools/binman/etype/u_boot_spl.py | 7 +- tools/binman/etype/u_boot_spl_bss_pad.py | 10 +- tools/binman/etype/u_boot_spl_dtb.py | 4 +- tools/binman/etype/u_boot_spl_elf.py | 4 +- tools/binman/etype/u_boot_spl_nodtb.py | 4 +- .../binman/etype/u_boot_spl_with_ucode_ptr.py | 6 +- tools/binman/etype/u_boot_tpl.py | 7 +- tools/binman/etype/u_boot_tpl_dtb.py | 4 +- .../binman/etype/u_boot_tpl_dtb_with_ucode.py | 5 +- tools/binman/etype/u_boot_tpl_elf.py | 4 +- .../binman/etype/u_boot_tpl_with_ucode_ptr.py | 10 +- tools/binman/etype/u_boot_ucode.py | 6 +- tools/binman/etype/u_boot_with_ucode_ptr.py | 12 +- tools/binman/etype/vblock.py | 6 +- tools/binman/etype/x86_reset16.py | 4 +- tools/binman/etype/x86_reset16_spl.py | 4 +- tools/binman/etype/x86_reset16_tpl.py | 4 +- tools/binman/etype/x86_start16.py | 4 +- tools/binman/etype/x86_start16_spl.py | 4 +- tools/binman/etype/x86_start16_tpl.py | 4 +- tools/binman/fdt_test.py | 8 +- tools/binman/fmap_util.py | 2 +- tools/binman/ftest.py | 49 ++++--- tools/binman/image.py | 18 ++- tools/binman/image_test.py | 2 +- tools/binman/{binman.py => main.py} | 110 ++++----------- tools/binman/state.py | 10 +- tools/buildman/builder.py | 12 +- tools/buildman/builderthread.py | 4 +- tools/buildman/buildman | 2 +- tools/buildman/control.py | 20 +-- tools/buildman/func_test.py | 18 +-- tools/buildman/{buildman.py => main.py} | 27 ++-- tools/buildman/test.py | 23 ++-- tools/buildman/toolchain.py | 8 +- tools/dtoc/dtb_platdata.py | 6 +- tools/dtoc/dtoc | 2 +- tools/dtoc/fdt.py | 4 +- tools/dtoc/fdt_util.py | 4 +- tools/dtoc/{dtoc.py => main.py} | 10 +- tools/dtoc/test_dtoc.py | 12 +- tools/dtoc/test_fdt.py | 17 +-- tools/genboardscfg.py | 3 +- tools/moveconfig.py | 8 +- tools/patman/checkpatch.py | 8 +- tools/patman/command.py | 5 +- tools/patman/func_test.py | 15 +-- tools/patman/get_maintainer.py | 5 +- tools/patman/gitutil.py | 12 +- tools/patman/{patman.py => main.py} | 27 ++-- tools/patman/patchstream.py | 8 +- tools/patman/patman | 2 +- tools/patman/project.py | 2 +- tools/patman/series.py | 12 +- tools/patman/settings.py | 13 +- tools/patman/terminal.py | 2 - tools/patman/test.py | 10 +- tools/patman/test_util.py | 125 ++++++++++++++++-- tools/patman/tools.py | 6 +- tools/patman/tout.py | 4 +- tools/rmboard.py | 7 +- 107 files changed, 529 insertions(+), 544 deletions(-) delete mode 100644 tools/binman/etype/__init__.py rename tools/binman/{binman.py => main.py} (54%) rename tools/buildman/{buildman.py => main.py} (76%) rename tools/dtoc/{dtoc.py => main.py} (94%) rename tools/patman/{patman.py => main.py} (93%)