From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 07C8A45ECB; Tue, 17 Dec 2024 19:12:28 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DC4CD406B6; Tue, 17 Dec 2024 19:12:27 +0100 (CET) Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) by mails.dpdk.org (Postfix) with ESMTP id 4C8F2402B1 for ; Tue, 17 Dec 2024 19:12:27 +0100 (CET) Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-2162c0f6a39so59118705ad.0 for ; Tue, 17 Dec 2024 10:12:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1734459146; x=1735063946; darn=dpdk.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=xHEuwe4sRg8C8kMIDxQAzjZV8JpOdBbWBqVvyUauMwk=; b=PyqkERcoPsWd24bYJPJ4//QiXw6gVvut/f1UM7lOFTxwjO++ThEfhky0xYNzzdCm2G hUL2D/0aNfZ4U6EEa1t6p9pYO126tixccFtgWXzJiPoXo389lsWYnVnAZn/i0Ko0ZSVC 5YXQ00kcZxnU7TXkJcvk0wlH/dJiuYIfMQXzw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734459146; x=1735063946; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=xHEuwe4sRg8C8kMIDxQAzjZV8JpOdBbWBqVvyUauMwk=; b=K85ooNZiFGjQu5b0Nva69NkB3P+sFRPVqBWZ/L7SxOl608z09K019jYfmaHjIAGnv2 U35QtG1IGUXZvAx+JA4BzVenc97uGQZXE41m7mOggdx1UnPY6c6ysi6XpO/D5i5CTzaI L/Nvzlvw0VI+6yyrWy2NE9U8hv/nXoHo36u3riibDGnRmFAEksr0eY+9EUPh6l77DFaP R+Qnw9GHrpkoD7ffMHQGPIVbRmgkoXQ/4VedARaj0yJmH8ax3C4AHS1FhvB+ipZf2RQ/ gqfi5QzAL5oVn/K1tjZ3oiHEjkJ/zFBNIHa50fD/SOxiBKE2016Q9ye8z1BbbmuyJVrt qVxw== X-Gm-Message-State: AOJu0Yy9i7ICsGkswECcAHE5bsuglYTtqdtlwtkV2ZqyE3wYmENWy47d CzP7XzfQxy9make62hbfXpUBvonnwt2Az58PUW/bWtK+vxM0vAOIkgv6XMApgDLkdAwSKl/9kBa 6V1AbQtTp7Dp9pEfnY4KrwnnAP81h9ZoYl81zdQ== X-Gm-Gg: ASbGncs1fni994NFJikSiTpLgsMWzEoP8zC1FQonUtOta8s735peok12HmNIwqswByq 9RT3K1aT4Zi7/+3R0/5XYvxU7ZvV+b+vB0Zt3UAKxl+Ukusocr5NG7TK1LK7eM/UiOBw0iM0= X-Google-Smtp-Source: AGHT+IEmp2RtjtdQoAtP4zgQ4fNGlyA2y4wAjod9Rgg8CXS4Z/uCyM8/s0jSDigrruihPEhtyZab7yEJT2o1pEb1Too= X-Received: by 2002:a17:90b:4b84:b0:2ef:949c:6f6b with SMTP id 98e67ed59e1d1-2f2d886111emr6478483a91.13.1734459146235; Tue, 17 Dec 2024 10:12:26 -0800 (PST) MIME-Version: 1.0 References: <20241214104257.67419-1-otilibil@eurecom.fr> <20241214104257.67419-3-otilibil@eurecom.fr> In-Reply-To: <20241214104257.67419-3-otilibil@eurecom.fr> From: Patrick Robb Date: Tue, 17 Dec 2024 13:10:01 -0500 Message-ID: Subject: Re: [PATCH 2/2] dts: clear out Python syntax warnings To: Ariel Otilibili Cc: dev@dpdk.org, Thomas Monjalon , David Marchand , Robin Jarry , stable@dpdk.org, Paul Szczepanek Content-Type: multipart/alternative; boundary="0000000000004aa61306297b3df6" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org --0000000000004aa61306297b3df6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Reviewed-by: Patrick Robb A question for main branch maintainers - should this series go directly to the main branch? I don't think I should apply this to next-dts due to the 1/2 patch. On Sat, Dec 14, 2024 at 5:43=E2=80=AFAM Ariel Otilibili wrote: > * follow up of a discussion with Robin Jarry > * since 3.12 invalid escape sequences generate SyntaxWarning > * in the future, these invalid sequences will generate SyntaxError > * therefore changed syntax to raw string notation. > > Link: https://inbox.dpdk.org/dev/D6AMQXRSG8E7.33BAORRHRHV9A@redhat.com/ > Link: https://docs.python.org/3/whatsnew/3.12.html#other-language-changes > Fixes: 99740300890 ("dts: use Python shell for Scapy instead of XML-RPC") > Fixes: 409359adce4 ("dts: fix smoke tests driver regex") > > Cc: Paul Szczepanek > Cc: Patrick Robb > Cc: stable@dpdk.org > Suggested-by: Robin Jarry > Signed-off-by: Ariel Otilibili > --- > dts/framework/testbed_model/traffic_generator/scapy.py | 2 +- > dts/tests/TestSuite_smoke_tests.py | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/dts/framework/testbed_model/traffic_generator/scapy.py > b/dts/framework/testbed_model/traffic_generator/scapy.py > index 1251ca65a0..f42f663554 100644 > --- a/dts/framework/testbed_model/traffic_generator/scapy.py > +++ b/dts/framework/testbed_model/traffic_generator/scapy.py > @@ -234,6 +234,6 @@ def _shell_start_and_stop_sniffing(self, duration: > float) -> list[Packet]: > ) > # In the string of bytes "b'XXXX'", we only want the contents > ("XXXX") > list_of_packets_base64 =3D re.findall( > - f"^b'({REGEX_FOR_BASE64_ENCODING})'", packet_strs, > re.MULTILINE > + fr"^b'({REGEX_FOR_BASE64_ENCODING})'", packet_strs, > re.MULTILINE > ) > return [Ether(base64_bytes(pakt)) for pakt in > list_of_packets_base64] > diff --git a/dts/tests/TestSuite_smoke_tests.py > b/dts/tests/TestSuite_smoke_tests.py > index bc3a2a6bf9..a029a564eb 100644 > --- a/dts/tests/TestSuite_smoke_tests.py > +++ b/dts/tests/TestSuite_smoke_tests.py > @@ -136,7 +136,7 @@ def test_device_bound_to_driver(self) -> None: > # with the address for the nic we are on in the loop and the= n > captures the > # name of the driver in a group > devbind_info_for_nic =3D re.search( > - f"{nic.pci}[^\\n]*drv=3D([\\d\\w-]*) [^\\n]*", > + fr"{nic.pci}[^\\n]*drv=3D([\\d\\w-]*) [^\\n]*", > all_nics_in_dpdk_devbind, > ) > self.verify( > -- > 2.47.1 > > --0000000000004aa61306297b3df6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Reviewed-by: Patrick Robb

A question fo= r main branch maintainers - should this series go directly to the main bran= ch? I don't think I should apply this to next-dts due to the 1/2 patch.=

On Sat, Dec 14, 2024 at 5:43=E2=80=AFAM Ariel Otilibili <otilibil@eurecom.fr&g= t; wrote:
* foll= ow up of a discussion with Robin Jarry
* since 3.12 invalid escape sequences generate SyntaxWarning
* in the future, these invalid sequences will generate SyntaxError
* therefore changed syntax to raw string notation.

Link: https://inbox.dpdk.org/dev/D6= AMQXRSG8E7.33BAORRHRHV9A@redhat.com/
Link: https://docs.python.org/3/w= hatsnew/3.12.html#other-language-changes
Fixes: 99740300890 ("dts: use Python shell for Scapy instead of XML-RP= C")
Fixes: 409359adce4 ("dts: fix smoke tests driver regex")

Cc: Paul Szczepanek <paul.szczepanek@arm.com>
Cc: Patrick Robb <probb@iol.unh.edu>
Cc: stable@dpdk.org
Suggested-by: Robin Jarry <
rjarry@redhat.com>
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
---
=C2=A0dts/framework/testbed_model/traffic_generator/scapy.py | 2 +-
=C2=A0dts/tests/TestSuite_smoke_tests.py=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| 2 +-
=C2=A02 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dts/framework/testbed_model/traffic_generator/scapy.py b/dts/f= ramework/testbed_model/traffic_generator/scapy.py
index 1251ca65a0..f42f663554 100644
--- a/dts/framework/testbed_model/traffic_generator/scapy.py
+++ b/dts/framework/testbed_model/traffic_generator/scapy.py
@@ -234,6 +234,6 @@ def _shell_start_and_stop_sniffing(self, duration: floa= t) -> list[Packet]:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# In the string of bytes "b'XXXX= '", we only want the contents ("XXXX")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0list_of_packets_base64 =3D re.findall( -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 f"^b'({REGEX_FOR_BASE64= _ENCODING})'", packet_strs, re.MULTILINE
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 fr"^b'({REGEX_FOR_BASE6= 4_ENCODING})'", packet_strs, re.MULTILINE
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return [Ether(base64_bytes(pakt)) for pak= t in list_of_packets_base64]
diff --git a/dts/tests/TestSuite_smoke_tests.py b/dts/tests/TestSuite_smoke= _tests.py
index bc3a2a6bf9..a029a564eb 100644
--- a/dts/tests/TestSuite_smoke_tests.py
+++ b/dts/tests/TestSuite_smoke_tests.py
@@ -136,7 +136,7 @@ def test_device_bound_to_driver(self) -> None:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# with the address for the = nic we are on in the loop and then captures the
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# name of the driver in a g= roup
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0devbind_info_for_nic =3D re= .search(
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 f"{nic.pci}[^= \\n]*drv=3D([\\d\\w-]*) [^\\n]*",
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 fr"{nic.pci}[= ^\\n]*drv=3D([\\d\\w-]*) [^\\n]*",
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0all_nics_in_d= pdk_devbind,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0self.verify(
--
2.47.1

--0000000000004aa61306297b3df6--