From patchwork Thu Feb 15 20:44:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Freihofer X-Patchwork-Id: 39467 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 aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6BABC48BC4 for ; Thu, 15 Feb 2024 20:45:44 +0000 (UTC) Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) by mx.groups.io with SMTP id smtpd.web11.1544.1708029938729874733 for ; Thu, 15 Feb 2024 12:45:39 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=VXNcdeiD; spf=pass (domain: gmail.com, ip: 209.85.167.45, mailfrom: adrian.freihofer@gmail.com) Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-51182f8590bso1691396e87.0 for ; Thu, 15 Feb 2024 12:45:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708029936; x=1708634736; darn=lists.openembedded.org; 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=8NCiPJBnrAMvNK29JR2dnufUJjCsfWjqptDxD74y8Rk=; b=VXNcdeiDgi2s/+qdSWOuRQHk5hataY3C76tUJhYQAf7xMlIQzFJQrhHJ3h9SVq+L3y sIckdxOsfwsF2S5ZTKecFXwlt1bSWxaf9f1U3D9d7S6iUdptZGn7BBQHK8lk2jf8A23v 1sCP4Fp31y/xjAabJc30wll3tTBAjsCDS2jfk5BqvlGOg1h8k0OnIv1o+vIOSejTSHzM KrLPrA+eMTQjuPkgwHaeK3iXjwtY0l/4LeKzWq0vBa7Qu9WEoQcrvbIDIgPgGY0/3rxs 9cDmNJHXbfLoGQ4yhZQaMoFtsfHF7U+YzH3l3He49E49YtZZwSi0l0IGsseaFMjz2vK+ wFDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708029936; x=1708634736; 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=8NCiPJBnrAMvNK29JR2dnufUJjCsfWjqptDxD74y8Rk=; b=bt+h+KA6mES/xGE2kOeu31Vcu2SJwZg2p2pxkOtmKsaa4mc+YjBhyZspbvu8v9y9ow M56aV/6YbYbwhd5XA4D8Jbua1FMvHDplOdhPsrIGfo2bczeTxej1NJ1Soq/LuWFNflJg +qUPpBQkoFnzA/qq6nU7gfROkNtCmVEoPR777Vu7RozB65piHfkYKpBd4PfzKX44px2D CGhzGtQ1GnLt0WF405ioejZJkHxt8Ak9SPPdyWwsPcdDYSz+iSYMz794A/harqHpxx8o qynx8Mc6GfcDWJEM3vgkRDqyCwl6AfdNHmmTKw6otxirX6Z3dwRPieWLiI8X/8IpN+pq wv2w== X-Gm-Message-State: AOJu0Yzahhqhc2JWALTGwGVUF/s6Bv5KhLay39Yo3gNiRdZOtP4JT9UP ZRetC9M9yfczkofVm/be/fKAxMCgnjQTNeBk2NI6DQzllEFQxapnOS3IxHod X-Google-Smtp-Source: AGHT+IFwK0/wWSIDlcoK1j8PLPpylT3ta+VoHb8NHat6XqrljtW1sfIS438DW8D9tP4xz0uvtzHeHw== X-Received: by 2002:a19:e04c:0:b0:511:8691:62d4 with SMTP id g12-20020a19e04c000000b00511869162d4mr2110940lfj.41.1708029936264; Thu, 15 Feb 2024 12:45:36 -0800 (PST) Received: from wsadrian16.fritz.box ([2a02:169:59a6:0:55c4:f628:91f3:4287]) by smtp.gmail.com with ESMTPSA id er17-20020a056402449100b0056058f2603asm883058edb.3.2024.02.15.12.45.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 12:45:35 -0800 (PST) From: Adrian Freihofer X-Google-Original-From: Adrian Freihofer To: bitbake-devel@lists.openembedded.org Cc: Chris Laplante , Richard Purdie Subject: [2.0][kirkstone][PATCH 1/3] codeparser: replace deprecated ast.Str and 's' Date: Thu, 15 Feb 2024 21:44:50 +0100 Message-ID: <20240215204524.320874-2-adrian.freihofer@siemens.com> X-Mailer: git-send-email 2.43.1 In-Reply-To: <20240215204524.320874-1-adrian.freihofer@siemens.com> References: <20240215204524.320874-1-adrian.freihofer@siemens.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 15 Feb 2024 20:45:44 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/15901 From: Chris Laplante These have been deprecated since 3.8 Signed-off-by: Chris Laplante Signed-off-by: Richard Purdie --- lib/bb/codeparser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/bb/codeparser.py b/lib/bb/codeparser.py index 9d66d3ae..bb890ddd 100644 --- a/lib/bb/codeparser.py +++ b/lib/bb/codeparser.py @@ -225,8 +225,8 @@ class PythonParser(): def visit_Call(self, node): name = self.called_node_name(node.func) if name and (name.endswith(self.getvars) or name.endswith(self.getvarflags) or name in self.containsfuncs or name in self.containsanyfuncs): - if isinstance(node.args[0], ast.Str): - varname = node.args[0].s + if isinstance(node.args[0], ast.Constant) and isinstance(node.args[0].value, str): + varname = node.args[0].value if name in self.containsfuncs and isinstance(node.args[1], ast.Str): if varname not in self.contains: self.contains[varname] = set() From patchwork Thu Feb 15 20:44:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Freihofer X-Patchwork-Id: 39468 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 aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB170C48BF0 for ; Thu, 15 Feb 2024 20:45:44 +0000 (UTC) Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) by mx.groups.io with SMTP id smtpd.web11.1545.1708029939191865065 for ; Thu, 15 Feb 2024 12:45:39 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=lvKqHzay; spf=pass (domain: gmail.com, ip: 209.85.208.51, mailfrom: adrian.freihofer@gmail.com) Received: by mail-ed1-f51.google.com with SMTP id 4fb4d7f45d1cf-563d32ee33aso587725a12.2 for ; Thu, 15 Feb 2024 12:45:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708029937; x=1708634737; darn=lists.openembedded.org; 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=xGN+3iVizbVqbr5nfFYQZb6BbBtAbiJWBm6qymvdvzM=; b=lvKqHzayMOSfsIkxRb78kb0Wury5xr4WiqKv/MTq5+gvLu6H/JJA/U2NiAOBHGPxPS VgN9IZN6zYckvm/CNXx1O6pZ7EZ25JpePod90TVLmEQPN0UZ7L/de2AtsXn0GJTSWUxR azRGKOzfBJw/Fy531ZhTPs8Q8Z36NeFxYLLhzA8g85v8wLwWeEFIxHvRLgdIHR5fCRaK YGGHauqNALjqYjnm6VrqIdvjY0lGjQKYabn4hlkm1B17rx647xqDJmXOjAxj0AWfdF1X vN5/UtHLhihC4GxgjMjqazThOnVRnV1/rNo+R2SOEULOkDu0ObWW4AomdBj1YWICBKU8 x3rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708029937; x=1708634737; 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=xGN+3iVizbVqbr5nfFYQZb6BbBtAbiJWBm6qymvdvzM=; b=KwYVYODsDMLJem5ndUPVJAqm/l5Wn+2GtaYBDxiDpCN3mdTzBP9zj7j46gedtWsfI5 yaiYab+RbYpAxNzepjnGK+cD4VyZgfTqRQWQkmWpYtkAoH20i/sjWnJbuif/ll70p26S t9LKt5IVZPUoCjk290xQaL156tEDUmaprqXpB5knZB7v581omZH/N27C9xDZEp0zhUHp N1J8QZd7Vo7WqcSyN4tqu9Yltcpq9OioKOEX1dEwUuOgk5+rPKfwL2aTkNxUomp+thjg H1/H2GgAZUuxKjxpMK78nm85RPWU9vYNl6prLtb/rcnu/oZ0KYoZItNp7OBl9y52UU19 ZT7Q== X-Gm-Message-State: AOJu0YyOplRt83qx5hQYWxzM/Kgx6wfJ72l1f35gwzumFrYgk5aBQ/0l 6Jl1S/YfFN7mTIa+tkU6ab5nd4RrjhZaLtnHkhJtOV/vxHkxVt/wWoMoeVU3eaQ= X-Google-Smtp-Source: AGHT+IGe6TuTUssorpVm1Gi54D/wyZW4kfLUnu0PvkAph/JJgrxuUeaeUfPOAtRjR2yWGNA3noAwqA== X-Received: by 2002:a05:6402:17c4:b0:563:ccd1:26bd with SMTP id s4-20020a05640217c400b00563ccd126bdmr1002781edy.2.1708029936909; Thu, 15 Feb 2024 12:45:36 -0800 (PST) Received: from wsadrian16.fritz.box ([2a02:169:59a6:0:55c4:f628:91f3:4287]) by smtp.gmail.com with ESMTPSA id er17-20020a056402449100b0056058f2603asm883058edb.3.2024.02.15.12.45.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 12:45:36 -0800 (PST) From: Adrian Freihofer X-Google-Original-From: Adrian Freihofer To: bitbake-devel@lists.openembedded.org Cc: Alexander Kanavin , Alexander Kanavin , Richard Purdie Subject: [2.0][kirkstone][PATCH 2/3] bitbake/codeparser.py: address ast module deprecations in py 3.12 Date: Thu, 15 Feb 2024 21:44:51 +0100 Message-ID: <20240215204524.320874-3-adrian.freihofer@siemens.com> X-Mailer: git-send-email 2.43.1 In-Reply-To: <20240215204524.320874-1-adrian.freihofer@siemens.com> References: <20240215204524.320874-1-adrian.freihofer@siemens.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 15 Feb 2024 20:45:44 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/15902 From: Alexander Kanavin Specifically: /srv/work/alex/poky/bitbake/lib/bb/codeparser.py:279: DeprecationWarning: ast.Str is deprecated and will be removed in Python 3.14; use ast.Constant instead if isinstance(node.args[0], ast.Str): /srv/work/alex/poky/bitbake/lib/bb/codeparser.py:280: DeprecationWarning: Attribute s is deprecated and will be removed in Python 3.14; use value instead value = node.args[0].s Signed-off-by: Alexander Kanavin Signed-off-by: Richard Purdie --- lib/bb/codeparser.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/bb/codeparser.py b/lib/bb/codeparser.py index bb890ddd..6ce0c518 100644 --- a/lib/bb/codeparser.py +++ b/lib/bb/codeparser.py @@ -227,17 +227,17 @@ class PythonParser(): if name and (name.endswith(self.getvars) or name.endswith(self.getvarflags) or name in self.containsfuncs or name in self.containsanyfuncs): if isinstance(node.args[0], ast.Constant) and isinstance(node.args[0].value, str): varname = node.args[0].value - if name in self.containsfuncs and isinstance(node.args[1], ast.Str): + if name in self.containsfuncs and isinstance(node.args[1], ast.Constant): if varname not in self.contains: self.contains[varname] = set() - self.contains[varname].add(node.args[1].s) - elif name in self.containsanyfuncs and isinstance(node.args[1], ast.Str): + self.contains[varname].add(node.args[1].value) + elif name in self.containsanyfuncs and isinstance(node.args[1], ast.Constant): if varname not in self.contains: self.contains[varname] = set() - self.contains[varname].update(node.args[1].s.split()) + self.contains[varname].update(node.args[1].value.split()) elif name.endswith(self.getvarflags): - if isinstance(node.args[1], ast.Str): - self.references.add('%s[%s]' % (varname, node.args[1].s)) + if isinstance(node.args[1], ast.Constant): + self.references.add('%s[%s]' % (varname, node.args[1].value)) else: self.warn(node.func, node.args[1]) else: @@ -245,8 +245,8 @@ class PythonParser(): else: self.warn(node.func, node.args[0]) elif name and name.endswith(".expand"): - if isinstance(node.args[0], ast.Str): - value = node.args[0].s + if isinstance(node.args[0], ast.Constant): + value = node.args[0].value d = bb.data.init() parser = d.expandWithRefs(value, self.name) self.references |= parser.references @@ -256,8 +256,8 @@ class PythonParser(): self.contains[varname] = set() self.contains[varname] |= parser.contains[varname] elif name in self.execfuncs: - if isinstance(node.args[0], ast.Str): - self.var_execs.add(node.args[0].s) + if isinstance(node.args[0], ast.Constant): + self.var_execs.add(node.args[0].value) else: self.warn(node.func, node.args[0]) elif name and isinstance(node.func, (ast.Name, ast.Attribute)): From patchwork Thu Feb 15 20:44:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Freihofer X-Patchwork-Id: 39466 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 aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99E34C48BEC for ; Thu, 15 Feb 2024 20:45:44 +0000 (UTC) Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) by mx.groups.io with SMTP id smtpd.web10.1459.1708029939740111000 for ; Thu, 15 Feb 2024 12:45:40 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=WO0KpYOZ; spf=pass (domain: gmail.com, ip: 209.85.208.179, mailfrom: adrian.freihofer@gmail.com) Received: by mail-lj1-f179.google.com with SMTP id 38308e7fff4ca-2d1094b549cso18665031fa.3 for ; Thu, 15 Feb 2024 12:45:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708029937; x=1708634737; darn=lists.openembedded.org; 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=5p4ftYp6xpxvljAVFhFhn1ZvAK1RlHnmjRgP6iwnnX4=; b=WO0KpYOZ7zACtdA8u5+mOul1D862nqy+it0OAaO0K5tFk2fxVkEfh2AWzZ+q7tC11w s+tHbNYT6V1qxmhDUZaBVOQYYadFFhmBixY3Qi1kmhwKApOZ6/bhNCGRtcPU0SSSgKe2 nPEP9F0eHtUhy9EUOsolmOOHd93TxbmZfksXFFjcMIOulp9bUJQCVI52bRb6bopGJhZT W7mE3aBAFvYZ1gvktVhWjgjGXjvDy3ddbKwjP9YxGHxKffJPcR/bd0in9shmaCyqSOzF yOPVopw8h/ZDyvjw/eF1XRmVYNhRRKXTaWFLZN01Fq2b0dMZhzQ3WagSMkAVCg2DcjyR 7zBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708029937; x=1708634737; 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=5p4ftYp6xpxvljAVFhFhn1ZvAK1RlHnmjRgP6iwnnX4=; b=ukgc9RBqd3T+xYd4ts+m5ph+f2OvOgcJh/IAq/+KuGxzAvkbFHEQBUr3vLkjkY77bB PGx7h75GE189nLP768tG8fEziQnqZZVhR5lv+mxdykR9Wium2S7QgUrzeYpu/xgiY04U qx/LnDy7N7RKvmlz7CrGJCx3cUq7gTDQbE1Apfp2X/ukLTITlpblcW4/lPOTUpltTZbU 8H8akGuTl7/HKqrd87SeTz0G+FBa42a+FIddrMO95EILy4pZED5V0crBJpyvZwAEWKSi 5VEKgvX+QXAp3eP8c4hwiPiNS9TaTX28k0zptQxLVYIkGY7s9viTH31BHea1cAK2NKX/ 6diQ== X-Gm-Message-State: AOJu0YyMP9TAOTHSxU8gY5jtXUa8c9u8bDDSydK2U8jPJTLdO+vy53J4 ASg9GItuNPMzumL+Lxc5zOLQgg95IYBUuBHy6Ahlj+7jSQiOF07eGMQfj0QytL0= X-Google-Smtp-Source: AGHT+IETOINXnnbp9Wk2uki1xEgic99st0xfbAXZQoiyUTlIBNBaASDtS7FZOjBE/Zr5GKa3fzfayg== X-Received: by 2002:a05:651c:221b:b0:2d0:e70f:84a7 with SMTP id y27-20020a05651c221b00b002d0e70f84a7mr2783555ljq.19.1708029937523; Thu, 15 Feb 2024 12:45:37 -0800 (PST) Received: from wsadrian16.fritz.box ([2a02:169:59a6:0:55c4:f628:91f3:4287]) by smtp.gmail.com with ESMTPSA id er17-20020a056402449100b0056058f2603asm883058edb.3.2024.02.15.12.45.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 12:45:37 -0800 (PST) From: Adrian Freihofer X-Google-Original-From: Adrian Freihofer To: bitbake-devel@lists.openembedded.org Cc: Adrian Freihofer , Adrian Freihofer , Richard Purdie Subject: [2.0][kirkstone][PATCH 3/3] bitbake/lib/bs4/tests/test_tree.py: python 3.12 regex Date: Thu, 15 Feb 2024 21:44:52 +0100 Message-ID: <20240215204524.320874-4-adrian.freihofer@siemens.com> X-Mailer: git-send-email 2.43.1 In-Reply-To: <20240215204524.320874-1-adrian.freihofer@siemens.com> References: <20240215204524.320874-1-adrian.freihofer@siemens.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 15 Feb 2024 20:45:44 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/15903 From: Adrian Freihofer Python 3 interprets string literals as Unicode strings, and therefore \s is treated as an escaped Unicode character which is not correct. Declaring the RegEx pattern as a raw string instead of unicode is required for Python 3. Signed-off-by: Adrian Freihofer Signed-off-by: Richard Purdie --- lib/bs4/tests/test_tree.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bs4/tests/test_tree.py b/lib/bs4/tests/test_tree.py index 8e5c6642..cf0f1abe 100644 --- a/lib/bs4/tests/test_tree.py +++ b/lib/bs4/tests/test_tree.py @@ -585,7 +585,7 @@ class SiblingTest(TreeTest): ''' # All that whitespace looks good but makes the tests more # difficult. Get rid of it. - markup = re.compile("\n\s*").sub("", markup) + markup = re.compile(r"\n\s*").sub("", markup) self.tree = self.soup(markup)