From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7A4A4C433EF for ; Wed, 27 Apr 2022 20:11:57 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C574780FF0; Wed, 27 Apr 2022 22:11:54 +0200 (CEST) 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="JOIzbqEV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5CE1080FD8; Wed, 27 Apr 2022 22:11:53 +0200 (CEST) Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) (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 5134280FD8 for ; Wed, 27 Apr 2022 22:11:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=alpernebiyasak@gmail.com Received: by mail-wr1-x42e.google.com with SMTP id u3so4011071wrg.3 for ; Wed, 27 Apr 2022 13:11:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:cc:from:in-reply-to:content-transfer-encoding; bh=HJL4QBLbtTzDQTMFLMwqCUMBPEM0T2qSfK9IRGrvyLg=; b=JOIzbqEVWm/FMSdUxxPRv70Tuo6277pgCNzFj6OYfHQgnMcb3D+cGuTscSklMxky3s wJzK+2EuycVY7Rtpl8+R9JFH742NnevWnbk8f4ztZL0B1oqtGawFU+5IhYrnARLvRiu/ 9qmG2WYDfbtbwYzTglkmCN9b4bjUAGGTJQVEhFJKVJcV7qD17Z7ap7diHq+22biIQOpV qiuYXefMheRjsPPP7Uf9Whz+o6b9vLBkas83biIAuMbsuogJW6lHo8QcbAJhSugouNRD hP5jMlgR7FV27gPxV8DFipHQ2znCDX/Fkm6xyVce0wvXOb/Ob73XnvtypQr/lav4yuzL AHnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:cc:from:in-reply-to :content-transfer-encoding; bh=HJL4QBLbtTzDQTMFLMwqCUMBPEM0T2qSfK9IRGrvyLg=; b=a8wNXunbFVt1e+du2PvxE7HHE8yq9WFq1osBaT4uSWhBSZOtDyYYi6dG/qDG6WteGH O4GFX7DZctRA0QMMMGJTG2w9NBURfpQZxoG7hrk6Xe761KHI9Mvktk9dBGGsykpP0K6u 5IvhgCpCBV63/AuTblHrjg+vAGR24KFbXvCLUo411BIKUi8+CasgUL6Odl7pyQu3WjF3 8DinMA8Ih6a0lRAfqNHLlgoqX+nN+griY7SV7wvG7cvL6ML32XcKIz2UZpwWHYTl5+sH vn8vjNpdPUzeQT3GnsQ0Z+GnNOQPb/JhIOms4K27KhgOTU9dS6r2dhJ5tIQkp5kNn2s+ AiFQ== X-Gm-Message-State: AOAM533Q5b4fSQ8gvcQ8VP+iV0ir4r4QH4TYuEjXinPqdBhKv4u82xkc T9S+df/p5AuD8ZJ6AE5PETg= X-Google-Smtp-Source: ABdhPJzzdr9ctFGfTWU8JTxtDc1HQWNngQbjC1P8KoUMwiJna7X+7lFDLaxsrXENfT6VpUYUjHpeGA== X-Received: by 2002:a05:6000:156a:b0:20a:9c1b:6b1b with SMTP id 10-20020a056000156a00b0020a9c1b6b1bmr23801333wrz.683.1651090306854; Wed, 27 Apr 2022 13:11:46 -0700 (PDT) Received: from [192.168.0.74] ([178.233.178.185]) by smtp.gmail.com with ESMTPSA id j13-20020a05600c410d00b00393fff6e3b9sm2496187wmi.0.2022.04.27.13.11.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 27 Apr 2022 13:11:46 -0700 (PDT) Message-ID: <79199473-e674-4302-b1c2-4657b8111f0e@gmail.com> Date: Wed, 27 Apr 2022 23:11:39 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH] patman: Fix defaults not propegating to subparsers Content-Language: en-US To: Sean Anderson References: <20220422165017.2255930-1-sean.anderson@seco.com> Cc: u-boot@lists.denx.de, Simon Glass From: Alper Nebi Yasak In-Reply-To: <20220422165017.2255930-1-sean.anderson@seco.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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.5 at phobos.denx.de X-Virus-Status: Clean On 22/04/2022 19:50, Sean Anderson wrote: > On python 3.8.10, subparsers are not updated with defaults. I suspect > this is related to [1]. Fix this by explicitly updating subparsers with > settings. > > [1] https://github.com/python/cpython/issues/89398 > > Fixes: 3145b63513 ("patman: Update defaults in subparsers") > Signed-off-by: Sean Anderson > --- > > tools/patman/settings.py | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) Also happens on Python 3.10. I can add the following to ~/.patman: [settings] ignore_bad_tags: True dry_run: True and they start taking effect only after this patch. Reviewed-by: Alper Nebi Yasak Tested-by: Alper Nebi Yasak > > diff --git a/tools/patman/settings.py b/tools/patman/settings.py > index 7c2b5c196c..658fe12be5 100644 > --- a/tools/patman/settings.py > +++ b/tools/patman/settings.py > @@ -246,8 +246,10 @@ def _UpdateDefaults(main_parser, config): > > # Collect the defaults from each parser > defaults = {} > + parser_defaults = [] > for parser in parsers: > pdefs = parser.parse_known_args()[0] > + parser_defaults.append(pdefs) > defaults.update(vars(pdefs)) > > # Go through the settings and collect defaults > @@ -264,8 +266,10 @@ def _UpdateDefaults(main_parser, config): > else: > print("WARNING: Unknown setting %s" % name) > > - # Set all the defaults (this propagates through all subparsers) > + # Set all the defaults (this does NOT propagate through all subparsers) Something like 'Set all the defaults and manually propagate ...' would be clearer here. > main_parser.set_defaults(**defaults) > + for parser, pdefs in zip(parsers, parser_defaults): > + parser.set_defaults(**{ k: v for k, v in defaults.items() if k in pdefs}) I think this would look better if you extract the dict as a variable. > > def _ReadAliasFile(fname): > """Read in the U-Boot git alias file if it exists.