From patchwork Mon Dec 19 01:59:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 1717080 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=Tzo3IbE7; 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 4Nb2wR0hxYz240B for ; Mon, 19 Dec 2022 13:00:23 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2BF41853C5; Mon, 19 Dec 2022 03:00:00 +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="Tzo3IbE7"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 60141853C5; Mon, 19 Dec 2022 02:59:58 +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 0AE0F853DA for ; Mon, 19 Dec 2022 02:59:48 +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 bw27so5128441qtb.3 for ; Sun, 18 Dec 2022 17:59:47 -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=sV/fGNUO3c5luHpy/e1A8BIBgbT5opqgVW8h68UC288=; b=Tzo3IbE7EAOAXR5xNhp4rqiAU2TGoPkv3hZBgJgGuQy+G0WtyINjSZd656WLvugdd5 JB2g4Kk6WBL7g+gEDvyjvszOVYVYhoMEbgnyINCDcpSZE/1Gv+PeLIL+sTCA+80Lw4Wl cNn3t3uGvBvSZ7aa0alYqlBLlwEUzXttBP+NzeKmC9a2/JPki5bLxD+XCNiUw2b91N2i LDpZgALoCwCBR2C0SsZ8bNbUaBUk9iD2/sqpw6eJvQCzPrnNQjwq3kTRHfO53xWReWiP wk7w44BVvJ/Rx702pmO+rUoaqF6AI995+S5GFyL+wAG19HkMcqvr6Tsjp+F4V4Rcvmmg ++yQ== 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=sV/fGNUO3c5luHpy/e1A8BIBgbT5opqgVW8h68UC288=; b=EmlUg/YMoQqK/pSzUkydUfqxvnPkx4IFxrsS235nrw/WT3Bwljsd+69QlRuGGDy8Q2 BOmCD4ygySs2RVWF2YRe2zMVb115P0zd9rfepJlWwoKfB/cUk8iF1v69Z682z1r85jaK 8iLKF5MDlJRXUxmUK3c1TmYQAvRlDZ5inBAi2yo5UpTC2UEYUP6BXoRC9qGYkaX9CUa5 0YOJBwNtjrrx/U7u/Mzpt6PTQgpSDSKJZjhgw0AALXSEJGy4m9bXfZBeOu3UoRExtKm7 9WR9TDPLicT8REedFVV4AgZ/aFJSorTdFp9KX2He8sAmdGkiAB6mRDrYO0V02V/PJd1Q QOcQ== X-Gm-Message-State: ANoB5pkB1QIYNbiraHqvvvrUTx5TQ73MqJzWthXxWA31KRv5o90f5mZe TYfEeQxgs7zVPwfheEcOrDehL/4/xkLGsQ== X-Google-Smtp-Source: AA0mqf7OS4IJ8J4XzmOmY3HjLML3IVyEZSIp08z9eySrRHsQ7RRkh9dJNKVt/paf7GfuSRXteFJImw== X-Received: by 2002:a05:622a:4d89:b0:3a8:199b:dcaf with SMTP id ff9-20020a05622a4d8900b003a8199bdcafmr38612356qtb.17.1671415186474; Sun, 18 Dec 2022 17:59:46 -0800 (PST) Received: from localhost.localdomain (dsl-10-133-202.b2b2c.ca. [72.10.133.202]) by smtp.gmail.com with ESMTPSA id dm36-20020a05620a1d6400b006bbc3724affsm6113298qkb.45.2022.12.18.17.59.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Dec 2022 17:59:46 -0800 (PST) From: Maxim Cournoyer X-Google-Original-From: Maxim Cournoyer To: U-Boot Mailing List Cc: Maxim Cournoyer , Simon Glass Subject: [PATCH 1/9] patman: cosmetic: Fix PEP 8 warnings for the gitutil module. Date: Sun, 18 Dec 2022 20:59:14 -0500 Message-Id: <20221219015923.25966-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 --- 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 01:59:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 1717081 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=R1q/puZT; 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 4Nb2wl5Q93z240B for ; Mon, 19 Dec 2022 13:00:39 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DEAFF853E2; Mon, 19 Dec 2022 03:00: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="R1q/puZT"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AB04D853BE; Mon, 19 Dec 2022 03:00:28 +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 9DE3A853E3 for ; Mon, 19 Dec 2022 03:00:02 +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 bw27so5128710qtb.3 for ; Sun, 18 Dec 2022 18:00:02 -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=z50gSjlXRbQ/lw/ZFmzDmtZGy/hxmpOK4ViRNLcMpK8=; b=R1q/puZT6wIxYNY7cZ0QbNUfveaJV/Cn40GjjkCMukxucpOafSmFyYvfqfRuztTFwC uR7Ht3qA6hT7kljZ67/C3TxpK8oBBfpjLU82wmfA4DyPBJL/7C0GuFc1ThWSa9libI8c eogb0EzljKcAXj5+bn4oY4Sc2tvPfeADbs6RpLEh0HHprowA5ig5BjCKb5GmbaI3ghJ6 1jgZxV7m9li/E5xTRHB3RTUdDbo/dwoo5xjTTPTmklxezmR9B5ve4X60GcNwvDWn0Rf5 mHysVZ26EyaKU0NXRZxyqgvgHBlLVSXr4WtPX5fgshyO3zvrNl+AHKOsw0igA5xApsWM YlyA== 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=z50gSjlXRbQ/lw/ZFmzDmtZGy/hxmpOK4ViRNLcMpK8=; b=t3pux4DBEoXVGA8L7X/Sx3VWmYvOOuF1WehbN2rqZivrdOy+ifDcb5rKQc/dKNfiJT dtvDlz7wpMC2txZN27BJn8KY9IjKf1Y36WsWsEX9ol7FZ29ckTYipUJKl1P6i7XQdWpH ECf7krrX20R0mx/YG08YrUc/5y+fGdweGl6EyVhhRhV9yQ4/xplLGL3J6p/fMx8cv7n3 ti7aLttb+Vz4zghHVpTslbdt8S1t+BUPTg+8UqjOyx0K/G2dM+2SxxBRjYGo3G/DODVP PE1gtPfsfwYahq774srSploN3aE13X9PJXnkjFKJSh/e2NX5Wwh4N6HiubF9wcRxZRVA 1t1w== X-Gm-Message-State: ANoB5pm8hXW9iHYo+rFM8y8MSdqTJqOmXT1hVVTDJoanlKtfCwoob3uM Sax3jlst24JXWvGmqIFeDZ83xIPxIgXl4Q== X-Google-Smtp-Source: AA0mqf7Ijycc7yuoaphMqTrKgYt1ZWMnvHJ8yV1UfjRPIOnrrFLfuIxHjO+zD0bbkAjuY0aHGTChvg== X-Received: by 2002:ac8:4c9a:0:b0:3a7:f9b6:ac33 with SMTP id j26-20020ac84c9a000000b003a7f9b6ac33mr52970185qtv.61.1671415201945; Sun, 18 Dec 2022 18:00:01 -0800 (PST) Received: from localhost.localdomain (dsl-10-133-202.b2b2c.ca. [72.10.133.202]) by smtp.gmail.com with ESMTPSA id dm36-20020a05620a1d6400b006bbc3724affsm6113298qkb.45.2022.12.18.18.00.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Dec 2022 18:00:01 -0800 (PST) From: Maxim Cournoyer X-Google-Original-From: Maxim Cournoyer To: U-Boot Mailing List Cc: Maxim Cournoyer , Simon Glass Subject: [PATCH 2/9] patman: locate test data files via __file__ and pathlib Date: Sun, 18 Dec 2022 20:59:15 -0500 Message-Id: <20221219015923.25966-2-maxim.cournoyer@savoirfairelinux.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221219015923.25966-1-maxim.cournoyer@savoirfairelinux.com> References: <20221219015923.25966-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 --- 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 01:59:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 1717082 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=C5cuRe6K; 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 4Nb2x1505Cz240B for ; Mon, 19 Dec 2022 13:00:53 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D49DE836CF; Mon, 19 Dec 2022 03:00:47 +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="C5cuRe6K"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3642E85391; Mon, 19 Dec 2022 03:00:35 +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-x833.google.com (mail-qt1-x833.google.com [IPv6:2607:f8b0:4864:20::833]) (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 3A61F80077 for ; Mon, 19 Dec 2022 03:00: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-x833.google.com with SMTP id g7so7272847qts.1 for ; Sun, 18 Dec 2022 18:00: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=gBBmIKHP2p/ZETkQkS5hjWlbFpgGwXNUmQmD5fQI54M=; b=C5cuRe6K27r6FXUi9DHTYyHiygkauyvO2Oqb4PXqRzBL9KK4YGDSKoFd0iW6a6RHCs FlkOg+rlubwxCCbFGpE0t+mfxLsRvNx8QusyyGqT7WRQhptuHxG7XNAsAVDMD+ZyxyT3 qmQDZg70oXF8AYQ5cs/JUtmwMj4EPTQ+KNO57OjA3mYbOkKXcwWWBEXRdYNNiVrmsROd XEkGieYs8xIFM4uSl6Xvvtr2ZYrp8rKMf05sOundgLaey51YSh6D/oSQPHcM8Uh/x/// p5+kWyEHXb2vmoeIBF5J8Xm7mG5pfcd5Y3UfK0nEDukBdWAWC3Lj9aPDqVpEQmoHgyil 06kw== 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=gBBmIKHP2p/ZETkQkS5hjWlbFpgGwXNUmQmD5fQI54M=; b=5TKdChBPHO1AWtFNblP1i6zQWQEl4RVDK2xDMe96Pv0PWfqJIDzqOfGXjiTbmwmvY3 MhN+VpAEu/GQ2l0lYOKWeGNzw+ySQxKjgOfvpv0kk09FJq8SQayAsqe/SX3XKbwwG4lV NRMzbcflxEUvwLEtWcj8W1V7DfWNpsWxU5mfu4SpC65X8DFNpQFEG94MPjIq2kDaoJvw oM0WDRiFzJpIu6A5y/ssNUvF53CgF30ktKUQbPZTKnfn7w60CrCI9H1Uw66qWMwOkmNA N3stmNrrI0QIoHioCenJ7RLWxwg/j8O6HN3QAsnH4HUso2yCLI0JaBFAdOxrvPxRkEOJ 4kbA== X-Gm-Message-State: ANoB5pmaGQQR2jckc2HuxjN0j0LMcYcouW+QwDNVZfxCB7ZEPWOneMvg 8t3YZMzh6022tyrEZNINMOA2vaLsmtIF/Q== X-Google-Smtp-Source: AA0mqf6qBsthxwuVMDqGC74egyKm9waSdt1EpE8K8V6YR20WgABOPiAATRASLYLmMbGOB7vzgIO4bg== X-Received: by 2002:ac8:4885:0:b0:3a8:299a:9843 with SMTP id i5-20020ac84885000000b003a8299a9843mr27652138qtq.39.1671415205800; Sun, 18 Dec 2022 18:00:05 -0800 (PST) Received: from localhost.localdomain (dsl-10-133-202.b2b2c.ca. [72.10.133.202]) by smtp.gmail.com with ESMTPSA id dm36-20020a05620a1d6400b006bbc3724affsm6113298qkb.45.2022.12.18.18.00.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Dec 2022 18:00:05 -0800 (PST) From: Maxim Cournoyer X-Google-Original-From: Maxim Cournoyer To: U-Boot Mailing List Cc: Maxim Cournoyer , Simon Glass Subject: [PATCH 3/9] patman: invoke the checkpatch.pl script with '--u-boot' Date: Sun, 18 Dec 2022 20:59:16 -0500 Message-Id: <20221219015923.25966-3-maxim.cournoyer@savoirfairelinux.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221219015923.25966-1-maxim.cournoyer@savoirfairelinux.com> References: <20221219015923.25966-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 'tools/patman/patman test', which were caused by a change in the checkpatch.pl script. Signed-off-by: Maxim Cournoyer --- 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..8755470ddb 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'] if not use_tree: args.append('--no-tree') if show_types: From patchwork Mon Dec 19 01:59:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 1717083 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=bc9QW5j9; 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 4Nb2xK2RwNz240B for ; Mon, 19 Dec 2022 13:01:09 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B992F853EB; Mon, 19 Dec 2022 03:00:50 +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="bc9QW5j9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0C5CB85062; Mon, 19 Dec 2022 03:00:37 +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-xf34.google.com (mail-qv1-xf34.google.com [IPv6:2607:f8b0:4864:20::f34]) (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 2563B849C0 for ; Mon, 19 Dec 2022 03:00: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-qv1-xf34.google.com with SMTP id i12so5509508qvs.2 for ; Sun, 18 Dec 2022 18:00: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=M3mXcNVlv854Wh65nKrB8nbMNpZAK5xS1khsh8qNqRg=; b=bc9QW5j9u4OamrE91dUgvGulihO+UA8BlFM4LwdEuNDhBtXxytvD51opNYNMx7bUrx AC2lHY+wsjDlbLF7s3Mx3VyjPTCz/v1urSTxJkSHUcwLC67mEPZ8yn8V7jE8SAyQ53m5 pfLi4oeQ8IGQxGxYb3jGNvKsKcraeTRgXD8NP9mcu5/HOky7SpFpFszdzEj4iQYlnRZf HaKJq4rHHC+vVqC/aAm+zGjvdUPMZqjbsYFTFwrGlOD0QCGd0ocQTYhe9EP8CdAt9nMy Nv4IxJQ17QX2zdYHDxW+be3vTNyMN47UfWy2A6+/fcYEeAUONdr5nRrmbYpKE1mysQ2h V63A== 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=M3mXcNVlv854Wh65nKrB8nbMNpZAK5xS1khsh8qNqRg=; b=nuJ6RACLRiWP/mspsHRzpAsu5idfGneOAEQDjAeXPILtqaF72X/hucQlugwHRxVIlA p4loXQEwcJRIh85wX75zVr9XbAJ4qwGr+g9WuSRhgvT31H0tzN//uzpcDLAx+sHXiRsN atO7oKTZUDxSN/pYm6AUHBc1F5xHNq/hmqceT3y8huQ4qMWU4jd2nJ5nIWN9Zd2rAKXu cmM5eZFhO+IbmvAp7VIdIhD4tG7jfObr1C77vqB0JsXnWm/Z7ehNgoseK7sF0rIYoIeB 2dm0vN8bkayRcufFoFa835lF819e9SxUrtuQnRaFcuQ4GubIOI/1fLSrsyH0Iv47PqrM tTYA== X-Gm-Message-State: AFqh2kqXcjEhygW8u4ZfeeENilhzV4586pR0d0uU7yBTBwlJjNgAfpoN p006M82jj7kPucMvIHZ0ZFLJEAer0z4Fvg== X-Google-Smtp-Source: AMrXdXu40mWvxcoG4wFHdcRf523nH59T4vA1AOl/WGT8RJ9KeXjHDQFU5iyPn7WMvp4W5+FvGjCGWg== X-Received: by 2002:a05:6214:3247:b0:4f5:3b38:c39 with SMTP id mt7-20020a056214324700b004f53b380c39mr19537602qvb.44.1671415208493; Sun, 18 Dec 2022 18:00:08 -0800 (PST) Received: from localhost.localdomain (dsl-10-133-202.b2b2c.ca. [72.10.133.202]) by smtp.gmail.com with ESMTPSA id dm36-20020a05620a1d6400b006bbc3724affsm6113298qkb.45.2022.12.18.18.00.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Dec 2022 18:00:08 -0800 (PST) From: Maxim Cournoyer X-Google-Original-From: Maxim Cournoyer To: U-Boot Mailing List Cc: Maxim Cournoyer , Simon Glass Subject: [PATCH 4/9] patman: fix test_indent test Date: Sun, 18 Dec 2022 20:59:17 -0500 Message-Id: <20221219015923.25966-4-maxim.cournoyer@savoirfairelinux.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221219015923.25966-1-maxim.cournoyer@savoirfairelinux.com> References: <20221219015923.25966-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 The checkpatch.pl script indentation check now checks that lines start with tabs an complains otherwise, so to make the test fail, start a line with spaces. This is now also emitted as a warning rather than as a check. Signed-off-by: Maxim Cournoyer --- tools/patman/test_checkpatch.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/patman/test_checkpatch.py b/tools/patman/test_checkpatch.py index 8960cd505f..bd53ae3ca5 100644 --- a/tools/patman/test_checkpatch.py +++ b/tools/patman/test_checkpatch.py @@ -4,6 +4,7 @@ # Tests for U-Boot-specific checkpatch.pl features # # Copyright (c) 2011 The Chromium OS Authors. +# Copyright (c) 2022 Maxim Cournoyer # import os @@ -257,7 +258,7 @@ index 0000000..2234c87 + rec->name = name; + } + if (!rec->name && -+ %ssomething_else) { ++%ssomething_else) { + rec->time_us = (u32)timer_get_us(); + rec->name = name; + } @@ -269,7 +270,7 @@ index 0000000..2234c87 signoff = 'Signed-off-by: Simon Glass \n' license = '// SPDX-License-Identifier: GPL-2.0+' tab = ' ' - indent = ' ' + indent = tab if data_type == 'good': pass elif data_type == 'no-signoff': @@ -279,7 +280,7 @@ index 0000000..2234c87 elif data_type == 'spaces': tab = ' ' elif data_type == 'indent': - indent = tab + indent = ' ' # must use tabs, not spaces! else: print('not implemented') return data % (signoff, license, tab, indent, tab) @@ -343,8 +344,8 @@ index 0000000..2234c87 self.assertEqual(result.ok, False) self.assertEqual(len(result.problems), 1) self.assertEqual(result.errors, 0) - self.assertEqual(result.warnings, 0) - self.assertEqual(result.checks, 1) + self.assertEqual(result.warnings, 1) + self.assertEqual(result.checks, 0) self.assertEqual(result.lines, 62) os.remove(inf) From patchwork Mon Dec 19 01:59:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 1717085 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=P0gETCln; 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 4Nb2xr3H2Dz240B for ; Mon, 19 Dec 2022 13:01:36 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AE6FC853E3; Mon, 19 Dec 2022 03:01:03 +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="P0gETCln"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C14DB85062; Mon, 19 Dec 2022 03:00:41 +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 80025853FD for ; Mon, 19 Dec 2022 03:00: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-x82b.google.com with SMTP id cg5so7218864qtb.12 for ; Sun, 18 Dec 2022 18:00: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=zWcGUYNkT3TY1q63omajiHOVCePPJXRvFxwcXLO0fLU=; b=P0gETCln5pY12GMOTv59jhlY/t0OtLfonVQMT2pkBc2M5dMeMWcdNw1jOjqV/usC+9 D+aV5SKxJmqUOzyrOA509lXYzqGhtdkfP9q91GRT6sql/ErRcEAilq1BgfufXgbv1hFx 3vL9oxJlBCMMXc40mSKb9/OOlsf+Nu8lJtaaEtDVTwN/CrJ0XfmxsdJjSF7Z44YhLjXr yf1D3fZ/7w5EjRp20lyNfdvgjo1R6j19Kg38F/OqWm0+CEzokCtrcU5BY8gd9RNwRWNV bgs6whuzaYgFht2uYLv3q1eT8vduNkENsHyVsRP6U1gTWY7OMHXsljOtQak5zXQ5AbPK HRGw== 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=zWcGUYNkT3TY1q63omajiHOVCePPJXRvFxwcXLO0fLU=; b=lpP4FyYAYcaFOSrp9gM3eAVm2qAH/SbQlwwcsbc+XSOkqnfzDuWKHosgIRyGdUJs2Y xQiIdFHYZR6gF1cWRxzMnxQvzpDUn6n742OxHAgV79klTAxXHaDCyvHvkNwwD2X4rY57 bBqIQGIIWWyKSrH3QnMyTkv1puZ0eYY3HAL7ks4jWbw16XXE1015y+LaSZEC300PbtRx WAKT4Ru1kCQWlYYv2g5jjfmcwxHl+OBSspQo2SBeoXekwz+5YcTY5x5p120VwHK5oePB kzJa8thOlzi+h8kEyryDDO/e4jv2Rj8IeQNt/pHvzuw2tOgEtbT0qjx20p7s1VZJwvAB RNPQ== X-Gm-Message-State: ANoB5pmpMpuy34j90WBmAJYAILVlUriVKFWEqwsD1RV92NooFGVnWSRw gqg4lTom7qaTCH3cAPtvhGSa1D0qCDmecA== X-Google-Smtp-Source: AA0mqf65DCeyZC8b8yx3fGMnSZAXDv7t66NyA2Ow4l9lER7ItznpqTdHwMoF04HF79E4zUgoK3rHhw== X-Received: by 2002:a05:622a:4d06:b0:3a5:20b1:e306 with SMTP id fd6-20020a05622a4d0600b003a520b1e306mr69067197qtb.16.1671415213379; Sun, 18 Dec 2022 18:00:13 -0800 (PST) Received: from localhost.localdomain (dsl-10-133-202.b2b2c.ca. [72.10.133.202]) by smtp.gmail.com with ESMTPSA id dm36-20020a05620a1d6400b006bbc3724affsm6113298qkb.45.2022.12.18.18.00.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Dec 2022 18:00:13 -0800 (PST) From: Maxim Cournoyer X-Google-Original-From: Maxim Cournoyer To: U-Boot Mailing List Cc: Maxim Cournoyer , Simon Glass Subject: [PATCH 5/9] patman: rename main script to __main__.py Date: Sun, 18 Dec 2022 20:59:18 -0500 Message-Id: <20221219015923.25966-5-maxim.cournoyer@savoirfairelinux.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221219015923.25966-1-maxim.cournoyer@savoirfairelinux.com> References: <20221219015923.25966-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 --- 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 01:59:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 1717087 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=AUCfesRF; 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 4Nb2yM0FD7z240B for ; Mon, 19 Dec 2022 13:02:03 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B1FEA853F8; Mon, 19 Dec 2022 03:01:23 +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="AUCfesRF"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EC799853BE; Mon, 19 Dec 2022 03:00:40 +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-xf2a.google.com (mail-qv1-xf2a.google.com [IPv6:2607:f8b0:4864:20::f2a]) (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 A2F61853E0 for ; Mon, 19 Dec 2022 03:00: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-qv1-xf2a.google.com with SMTP id i12so5509661qvs.2 for ; Sun, 18 Dec 2022 18:00:22 -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=z06F0sY1hANEEB8JIDHd/5eWRZ22Vw3Hw+MJSQGWxC4=; b=AUCfesRFX8+9JdUznYW0kEUrZDlHla73m0cOEGkGtLvh2TJASZ0XRTZAVixttNxzOD WFXaigA+OZ45/CaOLHXbJkOMRTi1/FinZtq8FgY9stku7EzKvkqqolyrun3Qmtb3r6Yz D8/O6gsRhv5z6GlNl7AUjr8NxmX4lM2L7KwwjTqhCiiCEW3inGbQY0cz/Y+QZR2h1Kaz +u6r+Jd1UJ5L+O9XG+zxH8KXqW2gnT0pS3al8jUPbqXjQ6BRHHCate9oc7Ndma23OHdz yR5p4Al4RAEHNBjbCePv2/FLpflECkJ7I7UX1SW9aHgz89Hvsc+OMtn6/naOyilhCUkc kujw== 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=z06F0sY1hANEEB8JIDHd/5eWRZ22Vw3Hw+MJSQGWxC4=; b=HF4BCaGS7Fz2YiAzKZCZWhoY+bqgJzcIt4d3JSgt+M5OccDfPsSrSSGM2l8W2/L7y9 ynfMakTOkudt6+izqrtEJyl5ZKE3g1Hj6A/7/6+ZpCn22TKgSu68FWWl7eNFwYmZJb2r /TGk6xudhT1dLxHOlOFQ9dbn6d5iaDxaJuvxlfKSmm1LGiRfKyitIBYifuOCUnjQ/0Cb 83AzpLZvTKqJigw5frrOVh6VBxUYMeSgAcqlehrUwYrkfY0sOmwo2xF2I4SBZoN5CZt8 XWl1hy+n9xRgigyPILWjvlXa6O2a3ah8zVCFAZyz/Gn6t6ehX50E3JttBoYoxB9N8qPD ywoQ== X-Gm-Message-State: ANoB5pkykCrwQ2/3B+2zZuaujASNnMDS4AtGwpexH0VwAkJKTGiU8mWV ZBWKVFb3tfkDC0YT3jzI7iMeKT5W1QQ4vw== X-Google-Smtp-Source: AA0mqf5LLioR2QZT/vn/e0+QY5YtbLY/iJUbKv7XDv2wDB4essiCmoBW32nVsP7O3qeeykJV26jrdA== X-Received: by 2002:ad4:544b:0:b0:4bb:654c:44f9 with SMTP id h11-20020ad4544b000000b004bb654c44f9mr52593621qvt.32.1671415216531; Sun, 18 Dec 2022 18:00:16 -0800 (PST) Received: from localhost.localdomain (dsl-10-133-202.b2b2c.ca. [72.10.133.202]) by smtp.gmail.com with ESMTPSA id dm36-20020a05620a1d6400b006bbc3724affsm6113298qkb.45.2022.12.18.18.00.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Dec 2022 18:00:16 -0800 (PST) From: Maxim Cournoyer X-Google-Original-From: Maxim Cournoyer To: U-Boot Mailing List Cc: Maxim Cournoyer , Simon Glass Subject: [PATCH 6/9] patman: add pytest configuration file Date: Sun, 18 Dec 2022 20:59:19 -0500 Message-Id: <20221219015923.25966-6-maxim.cournoyer@savoirfairelinux.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221219015923.25966-1-maxim.cournoyer@savoirfairelinux.com> References: <20221219015923.25966-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 --- 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 01:59:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 1717086 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=SF4ktsc2; 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 4Nb2y64DLdz240B for ; Mon, 19 Dec 2022 13:01:50 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 69E1E853FD; Mon, 19 Dec 2022 03:01: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=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="SF4ktsc2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 16785853E0; Mon, 19 Dec 2022 03:00:44 +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-xf32.google.com (mail-qv1-xf32.google.com [IPv6:2607:f8b0:4864:20::f32]) (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 1BC7785408 for ; Mon, 19 Dec 2022 03:00:25 +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-xf32.google.com with SMTP id q10so5474384qvt.10 for ; Sun, 18 Dec 2022 18:00:25 -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=KwhUzG81L7+tLdZXew2HRdsFgQklY1tAbR0EaPUNMQo=; b=SF4ktsc2Em08bYG/xvS4p4fblPxhx7FxFpvpVPb1QBpUhzMGdtC85xWaxeDXEoDs2P j+p9zNYCTcfyIb5OFAhhbI66qHfS130a3mhdk59PfjQX/eO/hTJ5L9aANbKyyKxgZiqK T1Bvz8oedungVzz6s3p3WlqB19ucpjBRj56KymEOacifMAtXctYuiWKGd41v3TQmCvRB w2cZsWz5iUChY624eMZLsLwyFzrv5qKo4w60x0F0xbQYQV1SDjANf41WmRYwXam/3Oe7 N/sLQUAuhJbAjCsJ/+JdJip1dm6avr1gz39A8XPdY4o83tqllQV79qLIth6EdXC1A6a1 wuTA== 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=KwhUzG81L7+tLdZXew2HRdsFgQklY1tAbR0EaPUNMQo=; b=oQJ9EKK+DYqs5e0jI6KaFMUmJ2InOnnbS+6CEbqICJr6Au+9SYYrsHDExBBQ0q8fIA STMUmTxcizAVwNDCxjs9ck+vxrckGaawvb1uFGdjCr+vA5K1puvb26lBxYsVsqOCnCTk nG0J7UiQWrOXKoTaJ124feQpxwqK7rZuLFtGJaB0p9LT5B2TNU1KL01ombKkfQFc67St lY0U2ymGZA7VD5VKzJemAJe6s18MQSlCv2ajcoCb4TEjk05/yiAB87gHA+1RdxW8ikqA vJdOAXcwxbShvM4sD+YrQUC+1UZ+iNe6nHE/f+W/rTZEM4E8DITwzmg5MigmdiMwtBmD Ladg== X-Gm-Message-State: AFqh2kroAhmaegv7rQUyIVwWpQNyFMi5TOiCZlquBQ+utnkPY681vAws zTmURNiu3v0oUUYsUKK6tda8cO9Z0fr2fw== X-Google-Smtp-Source: AMrXdXulZWKQmuZLl+JNfAV5aN/+I0/acamhZgaFBAiQNPLQjI3zKyR5E88T1WdoXi0ShR82UZvnJw== X-Received: by 2002:a05:6214:440d:b0:504:9836:bfa9 with SMTP id oj13-20020a056214440d00b005049836bfa9mr11875302qvb.24.1671415223288; Sun, 18 Dec 2022 18:00:23 -0800 (PST) Received: from localhost.localdomain (dsl-10-133-202.b2b2c.ca. [72.10.133.202]) by smtp.gmail.com with ESMTPSA id dm36-20020a05620a1d6400b006bbc3724affsm6113298qkb.45.2022.12.18.18.00.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Dec 2022 18:00:22 -0800 (PST) From: Maxim Cournoyer X-Google-Original-From: Maxim Cournoyer To: U-Boot Mailing List Cc: Maxim Cournoyer , Simon Glass Subject: [PATCH 7/9] patman: hide the 'test' action unless test data is available Date: Sun, 18 Dec 2022 20:59:20 -0500 Message-Id: <20221219015923.25966-7-maxim.cournoyer@savoirfairelinux.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221219015923.25966-1-maxim.cournoyer@savoirfairelinux.com> References: <20221219015923.25966-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 --- 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 01:59:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 1717084 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=IEtcxDiN; 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 4Nb2xb2sKPz240B for ; Mon, 19 Dec 2022 13:01:23 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DC7A6853E0; Mon, 19 Dec 2022 03:00:55 +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="IEtcxDiN"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A60A1853C1; Mon, 19 Dec 2022 03:00:42 +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 0B6EA8540D for ; Mon, 19 Dec 2022 03:00:30 +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 d2so5474297qvp.12 for ; Sun, 18 Dec 2022 18:00:29 -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=PocpIdVUB2cGcMsgxvEQ3ywy6WZVrLlKA2uwVDw30aw=; b=IEtcxDiNUGJIDMaA/2wSxEVU/HXEYsoDF6G13YZ76h5npDMQalUvDyxl63HFQ6C2GE 7L/CodJm4SmVdmptD1VEQj5Ch+NMS60zvs5WzEbZ5b5GYAxptR7kPvxM2wszseaCvphd 0ym/+pkKGefHyYv0GTk9r1Y//Nq0XEaCvD5ryiLZo0r17tiHPYTqzK+XoXb+hfr81l5J +GQ57hX3YG84THKt2E5zvncsNS7MnNj8TZ36NGwSXCYWosw2l09Yh4c+YE20ed4s09xN yJXB1oDRiGw14PUCzz4XZzHhLyid+Gx6hG4oaBJNbvl0YQM1awtF/GGmNo9h5rAxKy/E wxIA== 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=PocpIdVUB2cGcMsgxvEQ3ywy6WZVrLlKA2uwVDw30aw=; b=Mrzo05dsYElhENcGDOxo/xPQKXQYJOQDryxAoXPQrRSq9lA6XUXcaCgvwBpZiHb3EM m4xc1PPqI5K0mHmPpSaODOQ9E9hF1Ua1Z/prtWeZ0gbaeiviHvXIra+XwItT1gFcC9GD zME3vkW/SPIPVYStmmWtLKZxGT5mc3FxfE2jymrGesXBygoFvcqbkis6Kv9q84U8XJWI bt+QCZ4d8POmyn+/bs3s0GXMKguq53UgfRGhEZvZQZ/PB7GvS+nQVpb/8/r4TElGySPe VrOaA5aWMaoMMzqNMbD5Dy/8nBW9IM4DIVb2UmTNS413Bd+saijMdu/eCHdhOGhKZ1Wk q3/g== X-Gm-Message-State: ANoB5pltGgHaEa5qiJWZDmIPOE3acx1zjgRsZSOKXDtfaFTxkioKQ3sX IZ8zUqOFXI319BheGPX3XnRDiO7x9zgFOQ== X-Google-Smtp-Source: AA0mqf6u8CZHOwuZsQ2Sj+/SL2EuWKcdakvjQrsOp054EmEVHYqqLpPvlp6/ElAVBAlQv7WQkX6oGg== X-Received: by 2002:a0c:ec03:0:b0:4e3:6abf:ddb6 with SMTP id y3-20020a0cec03000000b004e36abfddb6mr37891185qvo.13.1671415228655; Sun, 18 Dec 2022 18:00:28 -0800 (PST) Received: from localhost.localdomain (dsl-10-133-202.b2b2c.ca. [72.10.133.202]) by smtp.gmail.com with ESMTPSA id dm36-20020a05620a1d6400b006bbc3724affsm6113298qkb.45.2022.12.18.18.00.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Dec 2022 18:00:28 -0800 (PST) From: Maxim Cournoyer X-Google-Original-From: Maxim Cournoyer To: U-Boot Mailing List Cc: Maxim Cournoyer , Simon Glass Subject: [PATCH 8/9] patman: document how to run test suite via pytest Date: Sun, 18 Dec 2022 20:59:21 -0500 Message-Id: <20221219015923.25966-8-maxim.cournoyer@savoirfairelinux.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221219015923.25966-1-maxim.cournoyer@savoirfairelinux.com> References: <20221219015923.25966-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 --- 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 01:59:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 1717088 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=XVYvle+P; 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 4Nb2yb4ltkz240B for ; Mon, 19 Dec 2022 13:02:15 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 42E1585411; Mon, 19 Dec 2022 03:01:26 +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="XVYvle+P"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B8726853EB; Mon, 19 Dec 2022 03:00:46 +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-x82c.google.com (mail-qt1-x82c.google.com [IPv6:2607:f8b0:4864:20::82c]) (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 00338853F9 for ; Mon, 19 Dec 2022 03:00: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=maxim.cournoyer@gmail.com Received: by mail-qt1-x82c.google.com with SMTP id i20so7239863qtw.9 for ; Sun, 18 Dec 2022 18:00:35 -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=BTF+JBPPd7leHn+r+IRTXbbkNnosSksgMDdAj4n/pl0=; b=XVYvle+PhrH0zJuoiw5w0DGI+i28RMvvq/FLpsG4pbFZ4r9ROi7PTXUF1ujeU8CkMd uBffoAkayitBFRY2jYyELi2R6Jxa3TjI09nRSFiIGsbvysM9zn6kKjZYGvW7GFlSd7q4 KEFwPPXZuJVafKJgj5nRr7wJ2kgbFI8p68x1XON13tH/fo+ucuU01ZVxGyRPw/tsDbqr jsRXXmoqpmMEA7VBBrP/A1SjVYbd2oVgOpNw7jh/xLk4h2UdvdIYKZx1fievt293RQuM xUgl7JtNX8X2iPcg2Mxtw1R2RhRA2OWos+xnwEydFabCgUcVCV1u05CboI3YC6bR8gTL swwA== 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=BTF+JBPPd7leHn+r+IRTXbbkNnosSksgMDdAj4n/pl0=; b=PT/RxP8kYuIkvOMBxmXXFg9VYHSi3mHk1S3mItd6/6U5zu0MCJInv1GIal2UYS3IED m6OvbdacpDDlcFk3yKqI1IOAbobJGambUM0fcdgwQLpyz484qq8/wjrEp9nUn5m87Aiq 6bgjLzbgdH0GYQPzqQipVfP2RJTzSuGrSG6xcBrmDlUMzURTrsoEeaZaooAMoPczsGkM r2zheamFe4qcCU8G3yDY5l+9Q6a+zEe7DzPavZV4cbLS87oiHaw2GwXSZj3e/e7oZru7 a2NJ+2scKxTZe716bL9MOx4hK7sgARGQk4T4pocxnnSw4+kodpOPvBe/o1iXzF4RF2e5 RLUQ== X-Gm-Message-State: AFqh2kqIXKldlbL5Mxe4fy/aUfLbSbuBDZcLC/sZH0u7HYShSRknrG/4 1kebe82j6MpZ3f04jEKrJrMBzzNgu7jqlw== X-Google-Smtp-Source: AMrXdXsj7UOFHbEvpCBSu4UtraEqg+qZfP9y0Rd8y0rjL0+SgQDqCnNAciQIka2zYQDE89mZ/l2hFw== X-Received: by 2002:ac8:710b:0:b0:3a9:7dd5:6a33 with SMTP id z11-20020ac8710b000000b003a97dd56a33mr8336660qto.64.1671415234583; Sun, 18 Dec 2022 18:00:34 -0800 (PST) Received: from localhost.localdomain (dsl-10-133-202.b2b2c.ca. [72.10.133.202]) by smtp.gmail.com with ESMTPSA id dm36-20020a05620a1d6400b006bbc3724affsm6113298qkb.45.2022.12.18.18.00.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Dec 2022 18:00:34 -0800 (PST) From: Maxim Cournoyer X-Google-Original-From: Maxim Cournoyer To: U-Boot Mailing List Cc: Maxim Cournoyer , Simon Glass Subject: [PATCH 9/9] patman: document default 'send' command Date: Sun, 18 Dec 2022 20:59:22 -0500 Message-Id: <20221219015923.25966-9-maxim.cournoyer@savoirfairelinux.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221219015923.25966-1-maxim.cournoyer@savoirfairelinux.com> References: <20221219015923.25966-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 --- 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')