From patchwork Mon Dec 19 14:52:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 1717404 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=Pcs0Ei9q; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NbN4F03s0z1ydd for ; Tue, 20 Dec 2022 01:53:16 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 973F4850CB; Mon, 19 Dec 2022 15:53:10 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Pcs0Ei9q"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D563285165; Mon, 19 Dec 2022 15:53:08 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) (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 EBA2E8504A for ; Mon, 19 Dec 2022 15:53:04 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=maxim.cournoyer@gmail.com Received: by mail-qt1-x831.google.com with SMTP id z12so8364823qtv.5 for ; Mon, 19 Dec 2022 06:53:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=vvzXGlxu0iepwCa0ffXqdHKjaOaJpH6tkbwLgqMOxXM=; b=Pcs0Ei9qdUEeFUjZr6LdoYbk9XqT3F7SxRsFA37Kd6H1CTrDhE7vNHRHR7WP87gYSV HhBbm/N2/wTAyBbHRZhjZH3AtXN4WtTkBrIUSDIYdL3UILlQvmHoOKcSWJEontKRvRQp RjfKA8LVqZGTjsDwtAMJgwIogLtc0oSlekKez4m2gObivNrlUAZuNb+wXNMtF8mgBK5i eZgr2otGAP6bamRnxljU/kXhVVvjFryIpVfn7G4rSqqNtRduxJr1rHRj9vRgpOIhzOJf V348dVw3w/U3TyvmTavOqsbkc4Ehf9Hu9xJqyOe6/1yQwvkfTIYxghjQF/5IkufOdP0Q CE1w== 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=vvzXGlxu0iepwCa0ffXqdHKjaOaJpH6tkbwLgqMOxXM=; b=OXB5r0JBo/TgYga7sAeR83W/C8FtBPgO6H9x8yylluJcjlMReWKShnaP6ni2X5eOb0 WxBjoTQ+PSx1Hh6awe8IYkpWC3MJe9l4HrvlAo7emKUUy+uCoUWq40MM3/DoQP77YX3d 8IY2fd82GzpG0ulAnjX24xdVDMZv9d0PLVTww59DFavtHzWrSJiHbXlgAzYfdrTXfShK a/TvjTxTaMrK1rxh+9vNE58cNAdhMfS3yrnOSlK1FGgnLOyOs3QHiNS61H5+emQ8Ig3v yHv59YqtFfH/xs3gVZhZq+lsYf0MKTutQp6Gp2j4CwEshLdmlPG8EhmDw8lElvbx2JyU 8MLQ== X-Gm-Message-State: ANoB5pneGcunbfBTzMPbd0fIthWq73+Tx+dNLWdKnRcHR7VsASNY0a5k /03zV3gHj5otyLTHs5ycGKwYlEnjLvRRzg== X-Google-Smtp-Source: AA0mqf6b/nYkjHkuF48bJVHVVHPKgWpzsGc3XWBZzsTcZa2V8QgOlQdssnkdwBOxfVvT1Oxy16F05w== X-Received: by 2002:ac8:7285:0:b0:3a8:18fa:ce8a with SMTP id v5-20020ac87285000000b003a818face8amr37850080qto.55.1671461583318; Mon, 19 Dec 2022 06:53:03 -0800 (PST) Received: from localhost.localdomain (dsl-10-133-202.b2b2c.ca. [72.10.133.202]) by smtp.gmail.com with ESMTPSA id y6-20020a05620a44c600b006fcb4e01345sm7289942qkp.24.2022.12.19.06.53.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Dec 2022 06:53:02 -0800 (PST) From: Maxim Cournoyer X-Google-Original-From: Maxim Cournoyer To: U-Boot Mailing List Cc: Maxim Cournoyer , Simon Glass Subject: [PATCH v2 1/8] patman: cosmetic: Fix PEP 8 warnings for the gitutil module. Date: Mon, 19 Dec 2022 09:52:50 -0500 Message-Id: <20221219145258.32046-1-maxim.cournoyer@savoirfairelinux.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 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 This patch fixes all the PEP 8 warnings reported by Pyflake for the gitutil module. Signed-off-by: Maxim Cournoyer Reviewed-by: Simon Glass --- (no changes since v1) tools/patman/gitutil.py | 106 ++++++++++++++++++++++++---------------- 1 file changed, 65 insertions(+), 41 deletions(-) base-commit: 9bd3d354a1a0712ac27c717df9ad60566b0406ee diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py index ceaf2ce150..74c6e94494 100644 --- a/tools/patman/gitutil.py +++ b/tools/patman/gitutil.py @@ -2,21 +2,19 @@ # Copyright (c) 2011 The Chromium OS Authors. # -import re import os -import subprocess import sys from patman import command from patman import settings from patman import terminal -from patman import tools # True to use --no-decorate - we check this in setup() use_no_decorate = True + def log_cmd(commit_range, git_dir=None, oneline=False, reverse=False, - count=None): + count=None): """Create a command to perform a 'git log' Args: @@ -49,6 +47,7 @@ def log_cmd(commit_range, git_dir=None, oneline=False, reverse=False, cmd.append('--') return cmd + def count_commits_to_branch(branch): """Returns number of commits between HEAD and the tracking branch. @@ -68,13 +67,14 @@ def count_commits_to_branch(branch): rev_range = '@{upstream}..' pipe = [log_cmd(rev_range, oneline=True)] result = command.run_pipe(pipe, capture=True, capture_stderr=True, - oneline=True, raise_on_error=False) + oneline=True, raise_on_error=False) if result.return_code: raise ValueError('Failed to determine upstream: %s' % result.stderr.strip()) patch_count = len(result.stdout.splitlines()) return patch_count + def name_revision(commit_hash): """Gets the revision name for a commit @@ -91,6 +91,7 @@ def name_revision(commit_hash): name = stdout.split(' ')[1].strip() return name + def guess_upstream(git_dir, branch): """Tries to guess the upstream for a branch @@ -109,7 +110,7 @@ def guess_upstream(git_dir, branch): """ pipe = [log_cmd(branch, git_dir=git_dir, oneline=True, count=100)] result = command.run_pipe(pipe, capture=True, capture_stderr=True, - raise_on_error=False) + raise_on_error=False) if result.return_code: return None, "Branch '%s' not found" % branch for line in result.stdout.splitlines()[1:]: @@ -121,6 +122,7 @@ def guess_upstream(git_dir, branch): return name, "Guessing upstream as '%s'" % name return None, "Cannot find a suitable upstream for branch '%s'" % branch + def get_upstream(git_dir, branch): """Returns the name of the upstream for a branch @@ -135,10 +137,10 @@ def get_upstream(git_dir, branch): """ try: remote = command.output_one_line('git', '--git-dir', git_dir, 'config', - 'branch.%s.remote' % branch) + 'branch.%s.remote' % branch) merge = command.output_one_line('git', '--git-dir', git_dir, 'config', - 'branch.%s.merge' % branch) - except: + 'branch.%s.merge' % branch) + except Exception: upstream, msg = guess_upstream(git_dir, branch) return upstream, msg @@ -149,7 +151,8 @@ def get_upstream(git_dir, branch): return '%s/%s' % (remote, leaf), None else: raise ValueError("Cannot determine upstream branch for branch " - "'%s' remote='%s', merge='%s'" % (branch, remote, merge)) + "'%s' remote='%s', merge='%s'" + % (branch, remote, merge)) def get_range_in_branch(git_dir, branch, include_upstream=False): @@ -168,6 +171,7 @@ def get_range_in_branch(git_dir, branch, include_upstream=False): rstr = '%s%s..%s' % (upstream, '~' if include_upstream else '', branch) return rstr, msg + def count_commits_in_range(git_dir, range_expr): """Returns the number of commits in the given range. @@ -180,12 +184,13 @@ def count_commits_in_range(git_dir, range_expr): """ pipe = [log_cmd(range_expr, git_dir=git_dir, oneline=True)] result = command.run_pipe(pipe, capture=True, capture_stderr=True, - raise_on_error=False) + raise_on_error=False) if result.return_code: return None, "Range '%s' not found or is invalid" % range_expr patch_count = len(result.stdout.splitlines()) return patch_count, None + def count_commits_in_branch(git_dir, branch, include_upstream=False): """Returns the number of commits in the given branch. @@ -201,6 +206,7 @@ def count_commits_in_branch(git_dir, branch, include_upstream=False): return None, msg return count_commits_in_range(git_dir, range_expr) + def count_commits(commit_range): """Returns the number of commits in the given range. @@ -215,6 +221,7 @@ def count_commits(commit_range): patch_count = int(stdout) return patch_count + def checkout(commit_hash, git_dir=None, work_tree=None, force=False): """Checkout the selected commit for this build @@ -231,10 +238,11 @@ def checkout(commit_hash, git_dir=None, work_tree=None, force=False): pipe.append('-f') pipe.append(commit_hash) result = command.run_pipe([pipe], capture=True, raise_on_error=False, - capture_stderr=True) + capture_stderr=True) if result.return_code != 0: raise OSError('git checkout (%s): %s' % (pipe, result.stderr)) + def clone(git_dir, output_dir): """Checkout the selected commit for this build @@ -243,10 +251,11 @@ def clone(git_dir, output_dir): """ pipe = ['git', 'clone', git_dir, '.'] result = command.run_pipe([pipe], capture=True, cwd=output_dir, - capture_stderr=True) + capture_stderr=True) if result.return_code != 0: raise OSError('git clone: %s' % result.stderr) + def fetch(git_dir=None, work_tree=None): """Fetch from the origin repo @@ -263,6 +272,7 @@ def fetch(git_dir=None, work_tree=None): if result.return_code != 0: raise OSError('git fetch: %s' % result.stderr) + def check_worktree_is_available(git_dir): """Check if git-worktree functionality is available @@ -274,9 +284,10 @@ def check_worktree_is_available(git_dir): """ pipe = ['git', '--git-dir', git_dir, 'worktree', 'list'] result = command.run_pipe([pipe], capture=True, capture_stderr=True, - raise_on_error=False) + raise_on_error=False) return result.return_code == 0 + def add_worktree(git_dir, output_dir, commit_hash=None): """Create and checkout a new git worktree for this build @@ -290,10 +301,11 @@ def add_worktree(git_dir, output_dir, commit_hash=None): if commit_hash: pipe.append(commit_hash) result = command.run_pipe([pipe], capture=True, cwd=output_dir, - capture_stderr=True) + capture_stderr=True) if result.return_code != 0: raise OSError('git worktree add: %s' % result.stderr) + def prune_worktrees(git_dir): """Remove administrative files for deleted worktrees @@ -305,7 +317,8 @@ def prune_worktrees(git_dir): if result.return_code != 0: raise OSError('git worktree prune: %s' % result.stderr) -def create_patches(branch, start, count, ignore_binary, series, signoff = True): + +def create_patches(branch, start, count, ignore_binary, series, signoff=True): """Create a series of patches from the top of the current branch. The patch files are written to the current directory using @@ -321,9 +334,7 @@ def create_patches(branch, start, count, ignore_binary, series, signoff = True): Filename of cover letter (None if none) List of filenames of patch files """ - if series.get('version'): - version = '%s ' % series['version'] - cmd = ['git', 'format-patch', '-M' ] + cmd = ['git', 'format-patch', '-M'] if signoff: cmd.append('--signoff') if ignore_binary: @@ -341,9 +352,10 @@ def create_patches(branch, start, count, ignore_binary, series, signoff = True): # We have an extra file if there is a cover letter if series.get('cover'): - return files[0], files[1:] + return files[0], files[1:] else: - return None, files + return None, files + def build_email_list(in_list, tag=None, alias=None, warn_on_error=True): """Build a list of email addresses based on an input list. @@ -385,40 +397,43 @@ def build_email_list(in_list, tag=None, alias=None, warn_on_error=True): raw += lookup_email(item, alias, warn_on_error=warn_on_error) result = [] for item in raw: - if not item in result: + if item not in result: result.append(item) if tag: return ['%s %s%s%s' % (tag, quote, email, quote) for email in result] return result + def check_suppress_cc_config(): """Check if sendemail.suppresscc is configured correctly. Returns: True if the option is configured correctly, False otherwise. """ - suppresscc = command.output_one_line('git', 'config', 'sendemail.suppresscc', - raise_on_error=False) + suppresscc = command.output_one_line( + 'git', 'config', 'sendemail.suppresscc', raise_on_error=False) # Other settings should be fine. if suppresscc == 'all' or suppresscc == 'cccmd': col = terminal.Color() print((col.build(col.RED, "error") + - ": git config sendemail.suppresscc set to %s\n" % (suppresscc)) + - " patman needs --cc-cmd to be run to set the cc list.\n" + - " Please run:\n" + - " git config --unset sendemail.suppresscc\n" + - " Or read the man page:\n" + - " git send-email --help\n" + - " and set an option that runs --cc-cmd\n") + ": git config sendemail.suppresscc set to %s\n" + % (suppresscc)) + + " patman needs --cc-cmd to be run to set the cc list.\n" + + " Please run:\n" + + " git config --unset sendemail.suppresscc\n" + + " Or read the man page:\n" + + " git send-email --help\n" + + " and set an option that runs --cc-cmd\n") return False return True + def email_patches(series, cover_fname, args, dry_run, warn_on_error, cc_fname, - self_only=False, alias=None, in_reply_to=None, thread=False, - smtp_server=None): + self_only=False, alias=None, in_reply_to=None, thread=False, + smtp_server=None): """Email a patch series. Args: @@ -487,9 +502,10 @@ send --cc-cmd cc-fname" cover p1 p2' "git config sendemail.to u-boot@lists.denx.de") return cc = build_email_list(list(set(series.get('cc')) - set(series.get('to'))), - '--cc', alias, warn_on_error) + '--cc', alias, warn_on_error) if self_only: - to = build_email_list([os.getenv('USER')], '--to', alias, warn_on_error) + to = build_email_list([os.getenv('USER')], '--to', + alias, warn_on_error) cc = [] cmd = ['git', 'send-email', '--annotate'] if smtp_server: @@ -565,7 +581,7 @@ def lookup_email(lookup_name, alias=None, warn_on_error=True, level=0): if not alias: alias = settings.alias lookup_name = lookup_name.strip() - if '@' in lookup_name: # Perhaps a real email address + if '@' in lookup_name: # Perhaps a real email address return [lookup_name] lookup_name = lookup_name.lower() @@ -581,7 +597,7 @@ def lookup_email(lookup_name, alias=None, warn_on_error=True, level=0): return out_list if lookup_name: - if not lookup_name in alias: + if lookup_name not in alias: msg = "Alias '%s' not found" % lookup_name if warn_on_error: print(col.build(col.RED, msg)) @@ -589,11 +605,12 @@ def lookup_email(lookup_name, alias=None, warn_on_error=True, level=0): for item in alias[lookup_name]: todo = lookup_email(item, alias, warn_on_error, level + 1) for new_item in todo: - if not new_item in out_list: + if new_item not in out_list: out_list.append(new_item) return out_list + def get_top_level(): """Return name of top-level directory for this git repo. @@ -608,6 +625,7 @@ def get_top_level(): """ return command.output_one_line('git', 'rev-parse', '--show-toplevel') + def get_alias_file(): """Gets the name of the git alias file. @@ -615,7 +633,7 @@ def get_alias_file(): Filename of git alias file, or None if none """ fname = command.output_one_line('git', 'config', 'sendemail.aliasesfile', - raise_on_error=False) + raise_on_error=False) if not fname: return None @@ -625,6 +643,7 @@ def get_alias_file(): return os.path.join(get_top_level(), fname) + def get_default_user_name(): """Gets the user.name from .gitconfig file. @@ -634,6 +653,7 @@ def get_default_user_name(): uname = command.output_one_line('git', 'config', '--global', 'user.name') return uname + def get_default_user_email(): """Gets the user.email from the global .gitconfig file. @@ -643,17 +663,19 @@ def get_default_user_email(): uemail = command.output_one_line('git', 'config', '--global', 'user.email') return uemail + def get_default_subject_prefix(): """Gets the format.subjectprefix from local .git/config file. Returns: Subject prefix found in local .git/config file, or None if none """ - sub_prefix = command.output_one_line('git', 'config', 'format.subjectprefix', - raise_on_error=False) + sub_prefix = command.output_one_line( + 'git', 'config', 'format.subjectprefix', raise_on_error=False) return sub_prefix + def setup(): """Set up git utils, by reading the alias files.""" # Check for a git alias file also @@ -666,6 +688,7 @@ def setup(): use_no_decorate = (command.run_pipe([cmd], raise_on_error=False) .return_code == 0) + def get_head(): """Get the hash of the current HEAD @@ -674,6 +697,7 @@ def get_head(): """ return command.output_one_line('git', 'show', '-s', '--pretty=format:%H') + if __name__ == "__main__": import doctest From patchwork Mon Dec 19 14:52:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 1717405 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=B3lzFs16; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NbN4S0zRZz1ydd for ; Tue, 20 Dec 2022 01:53:28 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 72AF8853DA; Mon, 19 Dec 2022 15:53:20 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="B3lzFs16"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 51CF7853D1; Mon, 19 Dec 2022 15:53:18 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) (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 BD08A8504A for ; Mon, 19 Dec 2022 15:53:14 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=maxim.cournoyer@gmail.com Received: by mail-qt1-x82e.google.com with SMTP id c7so8346201qtw.8 for ; Mon, 19 Dec 2022 06:53:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=7A3ccDiFQ6Uug9z1+LoyKkOpRBWFfAt33vgGoZlijks=; b=B3lzFs16DkIR8PWH+U3JpnZuCdAHta1oP6jTv5w8C8SXxYkeLyl26NyvqwlLrIM5KP +Ymxb0tHB7122K6kTB1FX5Gr6Nk0DJ/WNnWlaZGrZAZSNXfdTd0aKcayd8wjtY1KQ9cZ GBlMUEehGXI77e+oXBkvL5RW4vPhz7b+FZ/04GblxnxAAeiAF7+CRvSiiB3cPvB2GKgn vqht2mPryefJX7juD2IYBqXr4iIIdrRpX2ldyF2Q4Nw5V05EoYB99MTpaLyHV1HapFTa 3QY59QLUSF1tWIRBfFtZmdUwZR1vBf2z8vntXGLglh8I1geR5QUHlmSfg1sWPnXPSpWR MTNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=7A3ccDiFQ6Uug9z1+LoyKkOpRBWFfAt33vgGoZlijks=; b=wECElptf6QkYspOKjdGGGJTmR3jtkU+dF5j8gXgClyNEXQISASOkSQj0/i1PgL/Kd2 QMiHyxOHTTffnarnIYTYBKTOzZgMgcpqH08P+tjshg0Pg4BL5ZaZkpdjNj6cvf1y1Txp TsYYNIlWcIUf/qnSlYiJUw0fTqgfZd2oFf3kud4LDk69iK3d1C/JBipBVYHo70RZJOHc D0zt/MXkACONxC71i+++2fGW+fJGyTfogwl711qNYxurXkDwKY3Yd0Glkm6GVxWUCeuh 5NC1G72vfNGzAENLfMVGgXcPvUZcjiV86rM/mPOD/t50jgRZctMhjPQegiMcrdM4PSNF 4oWg== X-Gm-Message-State: ANoB5plSHww0eb24C5J/Yc7ZkhvR4+wRKdEQTk7R29CQpcYbDpS9QP4p +IXr2H6Ix/Q5nqjEa4iiTh/2CHmxHcxqDQ== X-Google-Smtp-Source: AA0mqf49CVAUJlej51LQ8bAMJCeRYHNE909ZgmR6BzWnMARkbFzHoqBpUl1mFkQaxrQnmvHJnUi1cg== X-Received: by 2002:a05:622a:1dc4:b0:3a8:1079:b844 with SMTP id bn4-20020a05622a1dc400b003a81079b844mr42635926qtb.46.1671461593265; Mon, 19 Dec 2022 06:53:13 -0800 (PST) Received: from localhost.localdomain (dsl-10-133-202.b2b2c.ca. [72.10.133.202]) by smtp.gmail.com with ESMTPSA id y6-20020a05620a44c600b006fcb4e01345sm7289942qkp.24.2022.12.19.06.53.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Dec 2022 06:53:12 -0800 (PST) From: Maxim Cournoyer X-Google-Original-From: Maxim Cournoyer To: U-Boot Mailing List Cc: Maxim Cournoyer , Simon Glass Subject: [PATCH v2 2/8] patman: locate test data files via __file__ and pathlib Date: Mon, 19 Dec 2022 09:52:51 -0500 Message-Id: <20221219145258.32046-2-maxim.cournoyer@savoirfairelinux.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221219145258.32046-1-maxim.cournoyer@savoirfairelinux.com> References: <20221219145258.32046-1-maxim.cournoyer@savoirfairelinux.com> MIME-Version: 1.0 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 Previously it would rely on the executing script location, which could break for example when running the tests via 'pytest'. Signed-off-by: Maxim Cournoyer Reviewed-by: Simon Glass --- (no changes since v1) tools/patman/func_test.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/patman/func_test.py b/tools/patman/func_test.py index 7b92bc67be..7fa4a00786 100644 --- a/tools/patman/func_test.py +++ b/tools/patman/func_test.py @@ -7,6 +7,7 @@ """Functional tests for checking that patman behaves correctly""" import os +import pathlib import re import shutil import sys @@ -28,6 +29,10 @@ from patman.test_util import capture_sys_output import pygit2 from patman import status + +TEST_DATA_DIR = pathlib.Path(__file__).parent / 'test/' + + class TestFunctional(unittest.TestCase): """Functional tests for checking that patman behaves correctly""" leb = (b'Lord Edmund Blackadd\xc3\xabr '. @@ -57,8 +62,7 @@ class TestFunctional(unittest.TestCase): Returns: str: Full path to file in the test directory """ - return os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), - 'test', fname) + return TEST_DATA_DIR / fname @classmethod def _get_text(cls, fname): From patchwork Mon Dec 19 14:52:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 1717406 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=hFNtQFEv; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NbN4h0WqTz1ydd for ; Tue, 20 Dec 2022 01:53:40 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 58A9E853C0; Mon, 19 Dec 2022 15:53:27 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="hFNtQFEv"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 657ED85397; Mon, 19 Dec 2022 15:53:19 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) (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 19856853BB for ; Mon, 19 Dec 2022 15:53:16 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=maxim.cournoyer@gmail.com Received: by mail-qt1-x82f.google.com with SMTP id s9so8355176qtx.6 for ; Mon, 19 Dec 2022 06:53:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=LJjGYezbgWtYEcSU+JykI50vd1znog5M8R1kLA9/xtk=; b=hFNtQFEvkbo1sTv0agGUdIKQLKmurLo1PZ2oNt9yKQo5dwJnEVF88DosOt0KNFvg5Y 4Nau06rDo2RoQVOg329tj+0htdOYrbuA78BlFY29nry+l5iXCWZZAaMha5kv+ZqpFtrS 1B7SO2/x/g+Y6rx7zwFUyNr+5VPtn9GmBqbwvhFgH0+S0oGT8ECm5LLocTaYe3fmlE2t 5WG1HoZ5RG0qh1aLWoeomJ8NDY5YlSEJk0SfiSdLZMcPVkZ3I86qPGH757ZiDuCVpO2a JMOzJvYOcGl1mPKaySKE6Gyge/l46gWfQ91950crI+mYhaYL4myWUqyfi1RsEQdYdiy0 7jqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=LJjGYezbgWtYEcSU+JykI50vd1znog5M8R1kLA9/xtk=; b=4pN53/DF1RzkZ51XYwXLqzlzIJTs2YASC8IC318hk2JHS+59nAZ1ftM9t6ZPY4nLUs xgc5jzhnp53f0ee41Oz94xsy+fo1yARigB4Fy7EITpDbjzqdbRAK7qBuiMUOSOHY6GlM UIkyL3x0vjhKGCvnlDLNXWCJztE0uZdCj0RTJQVEyJt0fwQJOO2c0aGaykEGGj/JwCdl me1PmXJpWkIEANgwo5rWiZyC+58jEjeD26Susdq5wE/9bIQIbJAeufsbcCC9Y4znnL3G I/RrD/SuGy4HWE1WmOmxkJi8t2D83NtTfF9ze7AGNmk/SHBX/dLELjjzw52ERNbPPyW8 kilg== X-Gm-Message-State: ANoB5plvqHb6dj8Qbc6qUfNO70PSwkX9iddekviDvu6nekwFaudm9Lvm 0jW3btWtxs2Tl08uueI5EyDDLnxGIMeo1A== X-Google-Smtp-Source: AA0mqf4Tp55xvlu14u3VEkUhuTuBoP4jAfyIeTXF8kofCDsZeIuZYtKHQdxUqGd+eU2jAX3R6lgVhg== X-Received: by 2002:ac8:4688:0:b0:3a7:d465:e with SMTP id g8-20020ac84688000000b003a7d465000emr56318808qto.13.1671461594391; Mon, 19 Dec 2022 06:53:14 -0800 (PST) Received: from localhost.localdomain (dsl-10-133-202.b2b2c.ca. [72.10.133.202]) by smtp.gmail.com with ESMTPSA id y6-20020a05620a44c600b006fcb4e01345sm7289942qkp.24.2022.12.19.06.53.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Dec 2022 06:53:14 -0800 (PST) From: Maxim Cournoyer X-Google-Original-From: Maxim Cournoyer To: U-Boot Mailing List Cc: Maxim Cournoyer , Simon Glass Subject: [PATCH v2 3/8] patman: invoke the checkpatch.pl script with '--u-boot' and '--strict' Date: Mon, 19 Dec 2022 09:52:52 -0500 Message-Id: <20221219145258.32046-3-maxim.cournoyer@savoirfairelinux.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221219145258.32046-1-maxim.cournoyer@savoirfairelinux.com> References: <20221219145258.32046-1-maxim.cournoyer@savoirfairelinux.com> MIME-Version: 1.0 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 This resolves 10 out of 11 test failures seen when running './patman test' from the 'tools/patman' subdirectory. This was caused by the .checkpatch.conf configuration file at the root of the project not being picked up. Make the test suite of patman independant from it by always invoking the checkpatch.pl script with the minimally required arguments for the test suite to pass. Signed-off-by: Maxim Cournoyer Reviewed-by: Simon Glass --- Changes in v2: - Reword the commit message with a better explanation of the problem - Add the '--strict' argument to script invocation tools/patman/checkpatch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/patman/checkpatch.py b/tools/patman/checkpatch.py index d1b902dd96..012c0d895c 100644 --- a/tools/patman/checkpatch.py +++ b/tools/patman/checkpatch.py @@ -211,7 +211,7 @@ def check_patch(fname, verbose=False, show_types=False, use_tree=False): stdout: Full output of checkpatch """ chk = find_check_patch() - args = [chk] + args = [chk, '--u-boot', '--strict'] if not use_tree: args.append('--no-tree') if show_types: From patchwork Mon Dec 19 14:52:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 1717407 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=gQvTdUUK; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NbN4w04rbz1ydd for ; Tue, 20 Dec 2022 01:53:52 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E3F9A853DD; Mon, 19 Dec 2022 15:53:29 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="gQvTdUUK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 98E80853E0; Mon, 19 Dec 2022 15:53:21 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qv1-xf36.google.com (mail-qv1-xf36.google.com [IPv6:2607:f8b0:4864:20::f36]) (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 23437853C0 for ; Mon, 19 Dec 2022 15:53:17 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=maxim.cournoyer@gmail.com Received: by mail-qv1-xf36.google.com with SMTP id d13so6394155qvj.8 for ; Mon, 19 Dec 2022 06:53:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=E4ay29dd3LApaWKjOC1ZyB0a9f7CMa4S5xvv1XUB36Q=; b=gQvTdUUKF8mO6ys3RHtwpArSyKocAlQhMyirebeFqPb+iduYe4UYYrRUCIBlefd8vG TcRHDFEGLie0Ibt22t7bMlwLxHndDh0Mnn0j3QER8dTXw1d2e7JO46XHoCl/yxGk0Yov WmbqJ/xmGpFcNBAsBhvchzZpgCWWSOJKKzGhVE9+LxUmNiV6REjoiFhBs7/3pigAF2zD qoR/xtdSgYYZbZdnBCFzNiyxZkZ4PzBOxr5C/+bPw1Hfq3xgoDotPZawviYL03a/OfrQ og+XzMHXkdv/6VmCdnfq/7QsDaljR02n/0cTwGmDrPmOS5oinULq4NELDHHr7QuAWuFU BVYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=E4ay29dd3LApaWKjOC1ZyB0a9f7CMa4S5xvv1XUB36Q=; b=D60wnYkiba0JE+k3gaB76bUOVLoIUz6I6BKAryxo+cNSSZ4T/d2WEx21+BT0Q7eyMo 6+k6zRVRPEpSYiIX90onT9kmYKk/1rgD56y5rDXBVEGdeNjsSH1xvj5I35uycI2S0+Zv qtWa8E6DZMuUXVN8p1UfKJqLBLFVsZFNiyiHelSsNHvhXT48a7TRKzLvA+LXIh4mYBv5 E73enQc9XIUMC1LE9X4vLd0eHmetNihDuPS2MpoFbiIV/Em48NB4dHdZWuumu4toJjXN IxF3ydVhN0TiFVnIm2DWidEKM3b3hjIT0Ie0T749hWun+pNI6yKYoFtvSVXIWum7w91F 8xdw== X-Gm-Message-State: ANoB5pnhFgU/Ied2OTEAtbpSgaBk2cb9sleFsA5qfh2xa+tG4e2uTfpN JqjKa2EVjdBvX/miWd+Z+9Dj6gJe9D2E8A== X-Google-Smtp-Source: AA0mqf7BN99KtyibvDh+dkPXPk16N7rkEqdYRdhdHHBmOvZGB3gQRgU/THBDdf/vq1GROxI2NFqoIQ== X-Received: by 2002:a05:6214:931:b0:4c6:fcf7:9aea with SMTP id dk17-20020a056214093100b004c6fcf79aeamr51533392qvb.49.1671461595589; Mon, 19 Dec 2022 06:53:15 -0800 (PST) Received: from localhost.localdomain (dsl-10-133-202.b2b2c.ca. [72.10.133.202]) by smtp.gmail.com with ESMTPSA id y6-20020a05620a44c600b006fcb4e01345sm7289942qkp.24.2022.12.19.06.53.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Dec 2022 06:53:15 -0800 (PST) From: Maxim Cournoyer X-Google-Original-From: Maxim Cournoyer To: U-Boot Mailing List Cc: Maxim Cournoyer , Simon Glass Subject: [PATCH v2 4/8] patman: rename main script to __main__.py Date: Mon, 19 Dec 2022 09:52:53 -0500 Message-Id: <20221219145258.32046-4-maxim.cournoyer@savoirfairelinux.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221219145258.32046-1-maxim.cournoyer@savoirfairelinux.com> References: <20221219145258.32046-1-maxim.cournoyer@savoirfairelinux.com> MIME-Version: 1.0 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 This allows running the package as a Python module, like e.g.: $ python -m patman It also prevents Pytest from attempting to parse main.py, which would cause errors. Signed-off-by: Maxim Cournoyer Reviewed-by: Simon Glass --- (no changes since v1) tools/patman/{main.py => __main__.py} | 0 tools/patman/patman | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename tools/patman/{main.py => __main__.py} (100%) diff --git a/tools/patman/main.py b/tools/patman/__main__.py similarity index 100% rename from tools/patman/main.py rename to tools/patman/__main__.py diff --git a/tools/patman/patman b/tools/patman/patman index 11a5d8e18a..5a427d1942 120000 --- a/tools/patman/patman +++ b/tools/patman/patman @@ -1 +1 @@ -main.py \ No newline at end of file +__main__.py \ No newline at end of file From patchwork Mon Dec 19 14:52:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 1717409 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=FixC0T/3; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NbN5N1tZZz1ydd for ; Tue, 20 Dec 2022 01:54:16 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 502B8853FD; Mon, 19 Dec 2022 15:53:38 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="FixC0T/3"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2EE62853E0; Mon, 19 Dec 2022 15:53:23 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) (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 420AC853C5 for ; Mon, 19 Dec 2022 15:53:18 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=maxim.cournoyer@gmail.com Received: by mail-qt1-x82f.google.com with SMTP id jr11so8351557qtb.7 for ; Mon, 19 Dec 2022 06:53:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=Sxpy/fqXN4L/6GzhWHJtkFHWfICxN2lrTZLgS7BKfdA=; b=FixC0T/3ga0Apx8hFvhbFXjRkb2l/dL1R0H4Jn7Rq+SnhDpCJkGsmCl1cmIJkiYXno sG2ZXflq8xt7P9j8NFBoY41aFjEPRwEBbQaIhkETN66Cg2wEl86VzPvIHDhEkAVt8x2f Q0REZR0RTOpj3ga4NyQeU98/cxScmJj7MAskW0IgL1mfUY/vH/WfT1SqcQepBDECBR0S GDAxGRemRimOuUgjUEP3IYMAUgo5jB5AwNMeBiPFL5JNHlJ3B8P18qZKbVlWE8ITULDx ODxbDZiHoN3i0NYZ7Tsaaid+d3rImEo3yCwiXUAeGg76m5F2Txx1fsP+5xligfoIIAYG FNyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=Sxpy/fqXN4L/6GzhWHJtkFHWfICxN2lrTZLgS7BKfdA=; b=XhT4DVdAViAqJdCt+CHqh4js+5o7GqlFNH7XbwrjW5BtnJRyBiC3MSv6Q8LqMnze7l yj6IWoBASqt4xCPyackLPQTFC/DeLM5NFrY133CJilpG7NclS3lNScBv07IcfuxYzMLC IFvIudhd8n0mwzRG+IcfaKzDZE03+pUCbbcqLEjHGP5kXERF9ZKRyfqAZ4l3sqfvl8lB daFURa8QEFEYqkF8RplLRE362u1jxi77REq8+gKid6yDrGsdddj5fmOnktVLePMm4oA0 jTtTFTO5DjKqmoH7OR58jzWamBVbeZQL3EtDqP2sxOPB2qMcozNJ+I7HPdA3DG3cz6oE lPKQ== X-Gm-Message-State: ANoB5pm9BExDMQfNvM9m5Ls2D/+4dOkGAisLRijdpTdmtUUkMZuv3NOQ jeO1jnLukYA/TxRkPlJCwGW8rlsoHKTydQ== X-Google-Smtp-Source: AA0mqf5tftcfEufMFn/3SJW46vIm7Jyv1E4hJp8qpybl7W9Ck90UlkbLTbOwTtARUZMI5BEpVUGuuw== X-Received: by 2002:ac8:5391:0:b0:3a7:f599:9c6c with SMTP id x17-20020ac85391000000b003a7f5999c6cmr56592084qtp.26.1671461596770; Mon, 19 Dec 2022 06:53:16 -0800 (PST) Received: from localhost.localdomain (dsl-10-133-202.b2b2c.ca. [72.10.133.202]) by smtp.gmail.com with ESMTPSA id y6-20020a05620a44c600b006fcb4e01345sm7289942qkp.24.2022.12.19.06.53.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Dec 2022 06:53:16 -0800 (PST) From: Maxim Cournoyer X-Google-Original-From: Maxim Cournoyer To: U-Boot Mailing List Cc: Maxim Cournoyer , Simon Glass Subject: [PATCH v2 5/8] patman: add pytest configuration file Date: Mon, 19 Dec 2022 09:52:54 -0500 Message-Id: <20221219145258.32046-5-maxim.cournoyer@savoirfairelinux.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221219145258.32046-1-maxim.cournoyer@savoirfairelinux.com> References: <20221219145258.32046-1-maxim.cournoyer@savoirfairelinux.com> MIME-Version: 1.0 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 With this change, a user can run the patman test suite using Pytest the same as when using 'patman test': $ cd tools/patman && pytest [...] 44 passed, 8 warnings in 8.87s $ ./patman test Ran 44 tests in 8.460s Signed-off-by: Maxim Cournoyer Reviewed-by: Simon Glass --- (no changes since v1) tools/patman/pytest.ini | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 tools/patman/pytest.ini diff --git a/tools/patman/pytest.ini b/tools/patman/pytest.ini new file mode 100644 index 0000000000..df3eb518d0 --- /dev/null +++ b/tools/patman/pytest.ini @@ -0,0 +1,2 @@ +[pytest] +addopts = --doctest-modules From patchwork Mon Dec 19 14:52:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 1717408 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=l/zagG8M; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NbN580GyRz1ydd for ; Tue, 20 Dec 2022 01:54:04 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5C4DC85406; Mon, 19 Dec 2022 15:53:35 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="l/zagG8M"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 70D4B853F9; Mon, 19 Dec 2022 15:53:24 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) (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 A95D3853BB for ; Mon, 19 Dec 2022 15:53:19 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=maxim.cournoyer@gmail.com Received: by mail-qt1-x82b.google.com with SMTP id x11so8328143qtv.13 for ; Mon, 19 Dec 2022 06:53:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=GylqWI9i7K1IJPKryCuVRN9WlN3AceJ/QcISbKAb5xw=; b=l/zagG8MlWx/TJm0xsMIrY1zfuvfAsq7NgrVi93baexNXr8nAEEsSQuYXCsJ7M3BGI 7aZwNDIEehBxXEe66167e9PhMr38v3nhFD7PPRiyiYLNMlSR8vGsHdjY5LoX5pz/Tz7B Fd6dTqRKWad5uX65QJL8ft6LIe2Nq87HwWKkQPzyUIDbcyulExK+uiGAm4HNzG72M/rl YWfxq6qGm1byiDBNxrcTa2yVRLQUwICUMTtJlPs4O6rML9IHDSJonQjglctUSeEG4q0X rkYspxzjO8HuqiB9dLexY14kDA0gtCMgakA0lINM9M6lmGgJipkiOQOhqFA3HUikr75s 7D6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=GylqWI9i7K1IJPKryCuVRN9WlN3AceJ/QcISbKAb5xw=; b=pGQmL1vanRfvvVzKFIuCL6cpquqjLLv5xUsuf1P/RF+fiZk/GUYygobYIAA9iOPEQT Tu0gQEsh1GgLfrsg1vwKqyaORSicLelilS3VWlWYh9rcDM/N7myDogaFiAXSy7eXdgka p8q6gixZg9g5ztVi0Ufjz1bn4OFpwSUrMxvmRjudbu52ytx0UpNqNIJCuN5Mr44xKtEC YVGIP+36Bz+bmp+/0vyE3aBE3o4L6j43vB+rBf24yDn5DaBP8EK+6Pwu0EGDIHP16j8R 746HkazgmJK2mJQ8cRZDFjbP5FmzDtqVTjXPQKTBAMXSKkwLzqvkN7k56X5k/ao6Htwa 9uwg== X-Gm-Message-State: ANoB5pnVtTGuR5UvVdSuvq16YU/PN/9tmwdlC3cbx5r2sZ7dQV28p/0N 3kGib2r+E/oGtVFsK0d7DoLkP6xHMLA+dg== X-Google-Smtp-Source: AA0mqf7JSB9B3DtUii4WVxaW4mxdtWD07/vx60OAEgup8ONYRTz7IqoxRGEl9gQNRPkvr44uwoufjg== X-Received: by 2002:a05:622a:6030:b0:3a6:8af6:2eb4 with SMTP id he48-20020a05622a603000b003a68af62eb4mr51925938qtb.49.1671461597950; Mon, 19 Dec 2022 06:53:17 -0800 (PST) Received: from localhost.localdomain (dsl-10-133-202.b2b2c.ca. [72.10.133.202]) by smtp.gmail.com with ESMTPSA id y6-20020a05620a44c600b006fcb4e01345sm7289942qkp.24.2022.12.19.06.53.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Dec 2022 06:53:17 -0800 (PST) From: Maxim Cournoyer X-Google-Original-From: Maxim Cournoyer To: U-Boot Mailing List Cc: Maxim Cournoyer , Simon Glass Subject: [PATCH v2 6/8] patman: hide the 'test' action unless test data is available Date: Mon, 19 Dec 2022 09:52:55 -0500 Message-Id: <20221219145258.32046-6-maxim.cournoyer@savoirfairelinux.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221219145258.32046-1-maxim.cournoyer@savoirfairelinux.com> References: <20221219145258.32046-1-maxim.cournoyer@savoirfairelinux.com> MIME-Version: 1.0 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 tests would fail when the test data is not available, so it doesn't make much sense to expose the action when patman is running outside of the u-boot git checkout. Signed-off-by: Maxim Cournoyer Reviewed-by: Simon Glass --- (no changes since v1) tools/patman/__main__.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/patman/__main__.py b/tools/patman/__main__.py index 5a7756a221..82cef4fc0b 100755 --- a/tools/patman/__main__.py +++ b/tools/patman/__main__.py @@ -21,6 +21,7 @@ if __name__ == "__main__": # Our modules from patman import command from patman import control +from patman import func_test from patman import gitutil from patman import project from patman import settings @@ -96,9 +97,11 @@ send.add_argument('--smtp-server', type=str, send.add_argument('patchfiles', nargs='*') -test_parser = subparsers.add_parser('test', help='Run tests') -test_parser.add_argument('testname', type=str, default=None, nargs='?', - help="Specify the test to run") +# Only add the 'test' action if the test data files are available. +if os.path.exists(func_test.TEST_DATA_DIR): + test_parser = subparsers.add_parser('test', help='Run tests') + test_parser.add_argument('testname', type=str, default=None, nargs='?', + help="Specify the test to run") status = subparsers.add_parser('status', help='Check status of patches in patchwork') From patchwork Mon Dec 19 14:52:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 1717410 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=BcpNHHEQ; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NbN5c3wtxz1ydd for ; Tue, 20 Dec 2022 01:54:28 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EDD2E853E2; Mon, 19 Dec 2022 15:53:40 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="BcpNHHEQ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A1040853BB; Mon, 19 Dec 2022 15:53:24 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qt1-x82d.google.com (mail-qt1-x82d.google.com [IPv6:2607:f8b0:4864:20::82d]) (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 C1376853DD for ; Mon, 19 Dec 2022 15:53:20 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=maxim.cournoyer@gmail.com Received: by mail-qt1-x82d.google.com with SMTP id cg5so8323746qtb.12 for ; Mon, 19 Dec 2022 06:53:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=JT0nCwYu4rVqyu1vdmn8Y/WBVNCV+khF1S2X/kI1Xf4=; b=BcpNHHEQCVDZOtPm1C+I4ZtOB+7ajLYjRNT0ZYLqU9fQwZ3c84o9TqYS4ROtpc5+Zo 9sYTWGrpTg5ngGMw3auUNylZRfGS/UAbL0C4N6X9+RkMXtrq+8Mi19SIFSUQM81NvBw3 mPVqbGYT2pR9qkedFWGrMpsA0dcaqgjGmf8zRP05VZVnPrRv8mACZphmJzvNFRq1Fjrw 7IDUDqx0r/WWEms5wKyKA5nfpvagZiznkJPr/43eD7MqPaCrsQJ6eqKp6WD4QSiY8c+T wO9Wee7wODydQ+wBioonL01N/PJeu7h4VN2zrFuH0RXlVrm9PNoc+7koY3dlt6Yxfvti 5ruw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=JT0nCwYu4rVqyu1vdmn8Y/WBVNCV+khF1S2X/kI1Xf4=; b=5aAT3Oa1Ft8rPbdJ/3phwEV+4nwFOrBTRFn45MyzVTpPdOCE1bQg6I70hijkx/cLFY j6DpoAf1FufKpFg/zWzvqILkzdV1ZHH+W6rUOem2gePOsgp4wOghMlYbe4z6GgUFM9D5 EfM5ZIPxzsfbO2v1Y1GxsZtvG15SJGNwRLgC8NkqXUmOrKo+Jk25JHMrQgE0ge2czN0O wuV+8NElNOIyPlMFhILQRkD2xiQJclg1ahTwhx+Msg0xgelpq/EUV8Ne5z0eQY8WWC8Z VVIONKpAD6C/Y7S2jZ11XvfWwP1Nh3X6zDEwXC6VUCggPrL1ONsdohHH8mhnNKkLBigw H0Tw== X-Gm-Message-State: AFqh2kqJVZdR9jjr2uHSaqu+gpbCRh0PMXgvf03Vi/xYgk0lv2XV32r7 8XDbsVjGedIqhGPVJ1EIbFHEhIFH72VYEA== X-Google-Smtp-Source: AMrXdXuF7aP+h1O0FREv57+LF9wRpPv1i3csHNmG2XGc+Z6dQY0aBf4BB01fwELuGXwZ64b5DbWKeA== X-Received: by 2002:ac8:46ce:0:b0:3a9:77d7:a2fe with SMTP id h14-20020ac846ce000000b003a977d7a2femr15396160qto.1.1671461599196; Mon, 19 Dec 2022 06:53:19 -0800 (PST) Received: from localhost.localdomain (dsl-10-133-202.b2b2c.ca. [72.10.133.202]) by smtp.gmail.com with ESMTPSA id y6-20020a05620a44c600b006fcb4e01345sm7289942qkp.24.2022.12.19.06.53.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Dec 2022 06:53:18 -0800 (PST) From: Maxim Cournoyer X-Google-Original-From: Maxim Cournoyer To: U-Boot Mailing List Cc: Maxim Cournoyer , Simon Glass Subject: [PATCH v2 7/8] patman: document how to run test suite via pytest Date: Mon, 19 Dec 2022 09:52:56 -0500 Message-Id: <20221219145258.32046-7-maxim.cournoyer@savoirfairelinux.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221219145258.32046-1-maxim.cournoyer@savoirfairelinux.com> References: <20221219145258.32046-1-maxim.cournoyer@savoirfairelinux.com> MIME-Version: 1.0 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 Pytest offers useful features such as selecting tests by means of a regular expression, or running the pdb debugger upon encountering a test failure. Signed-off-by: Maxim Cournoyer Reviewed-by: Simon Glass --- (no changes since v1) tools/patman/patman.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/patman/patman.rst b/tools/patman/patman.rst index 8c5c9cc2cc..b06399b459 100644 --- a/tools/patman/patman.rst +++ b/tools/patman/patman.rst @@ -680,6 +680,12 @@ them: $ tools/patman/patman test +Alternatively, you can run the test suite via Pytest: + +.. code-block:: bash + + $ cd tools/patman && pytest + Error handling doesn't always produce friendly error messages - e.g. putting an incorrect tag in a commit may provide a confusing message. From patchwork Mon Dec 19 14:52:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 1717411 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=gjL9wF5F; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NbN5s2Ltzz1ydd for ; Tue, 20 Dec 2022 01:54:41 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B3A0185411; Mon, 19 Dec 2022 15:53:43 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="gjL9wF5F"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7FED1853C1; Mon, 19 Dec 2022 15:53:25 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qt1-x82d.google.com (mail-qt1-x82d.google.com [IPv6:2607:f8b0:4864:20::82d]) (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 04C21853EC for ; Mon, 19 Dec 2022 15:53:22 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=maxim.cournoyer@gmail.com Received: by mail-qt1-x82d.google.com with SMTP id bw27so6236154qtb.3 for ; Mon, 19 Dec 2022 06:53:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=CMxyXsyZQIaX2BUDkSbT8k4bvII91N3H5VodYbrFe9g=; b=gjL9wF5FxPdhPUHdW0Rsut8Pa+8HUe6KAw/+X0dCMWoQhfCGWwnlb/BE1ursmCBDBo vSFxpRc8Yl5k5o0izNVVxyVWmxtB4fLLc7mLLpKimiReFwqHH9AqQpjnmPMpdvgKf7eM IcePFSP+RsYlGnb2odDDqkwi0ixtSfykoWhyGJxLqp7Ky9cSx3PNcGDWIlZiWo+LHxYm OJPKGby2DhtkuHmS+J8xsIZwUwWA8rC1+2hwoOtvxbMpy72GpnQncaFjy+OYyFlekB4v rQoPhWiEe0niC2NLL6z5u/w8xjzyUmziVd0UcjLPwzOXFcyAoUZb9UPvkw1lJe4ZClhP +wPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=CMxyXsyZQIaX2BUDkSbT8k4bvII91N3H5VodYbrFe9g=; b=h44uQohzxMpXCJh7QVeH5t4hwcQB4M84vvMC7E+1FJB8zaMIX+vch4/LnuBqBmyU2J fF0qLgAORrMkwBDmCTi1xb95/K1IjXxfpfPU23iacd4Y06Ovxt3Ovk14tv4AHm/ynniu XDSDXm4XkAJF14awIAo0+w78B2GMPoG+gcn51QTSvIJ6a6Zc4YhbAtuIDfejK/DyR2uJ xzO+AneD2tMQHn1izySXI29iI/N4Ql2fpKYsEfKcuKUmuIC5HC8KdW9DHQXB5VTIeKCV tL47DgUpG11BjiXYw+0K7E/phcE3xB9CsrpCe490G18K+WFkD8GZb6VG9DIbAuzwj9H6 LRMA== X-Gm-Message-State: ANoB5pkkjxAJta+M9G0NfPAxX/RLXyX+qPGy0UJB0KWKl9WMd2Spw5bb ixPS2aXEfmNShZz8P6dnn3TjGQYcdRPUbQ== X-Google-Smtp-Source: AA0mqf6SWeQ2MVmQx3npfIAm6UGFRBUfgumExExiNX71Zv1jd7M4UqRMf7ZCGbigW7Dz8N5e6C6cAQ== X-Received: by 2002:ac8:7547:0:b0:3a6:18ff:c6e2 with SMTP id b7-20020ac87547000000b003a618ffc6e2mr52746794qtr.28.1671461600428; Mon, 19 Dec 2022 06:53:20 -0800 (PST) Received: from localhost.localdomain (dsl-10-133-202.b2b2c.ca. [72.10.133.202]) by smtp.gmail.com with ESMTPSA id y6-20020a05620a44c600b006fcb4e01345sm7289942qkp.24.2022.12.19.06.53.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Dec 2022 06:53:20 -0800 (PST) From: Maxim Cournoyer X-Google-Original-From: Maxim Cournoyer To: U-Boot Mailing List Cc: Maxim Cournoyer , Simon Glass Subject: [PATCH v2 8/8] patman: document default 'send' command Date: Mon, 19 Dec 2022 09:52:57 -0500 Message-Id: <20221219145258.32046-8-maxim.cournoyer@savoirfairelinux.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221219145258.32046-1-maxim.cournoyer@savoirfairelinux.com> References: <20221219145258.32046-1-maxim.cournoyer@savoirfairelinux.com> MIME-Version: 1.0 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 Document that this command is the default and what it's intended for. Signed-off-by: Maxim Cournoyer Reviewed-by: Simon Glass --- (no changes since v1) tools/patman/__main__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/patman/__main__.py b/tools/patman/__main__.py index 82cef4fc0b..11f19281fb 100755 --- a/tools/patman/__main__.py +++ b/tools/patman/__main__.py @@ -56,7 +56,8 @@ parser.add_argument('-H', '--full-help', action='store_true', dest='full_help', default=False, help='Display the README file') subparsers = parser.add_subparsers(dest='cmd') -send = subparsers.add_parser('send') +send = subparsers.add_parser( + 'send', help='Format, check and email patches (default command)') send.add_argument('-i', '--ignore-errors', action='store_true', dest='ignore_errors', default=False, help='Send patches email even if patch errors are found')