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 269C545ECB for ; Tue, 17 Dec 2024 19:12:29 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1829840BA2; Tue, 17 Dec 2024 19:12:29 +0100 (CET) Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by mails.dpdk.org (Postfix) with ESMTP id 659E0406B6 for ; Tue, 17 Dec 2024 19:12:27 +0100 (CET) Received: by mail-pj1-f46.google.com with SMTP id 98e67ed59e1d1-2ee50ffcf14so5211458a91.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=c1XWM7drc7wBVLmH7boAVZaCfUVqAgzaVxLA22WM1O4Uc2BPq7kqupaT2mnm928D8M aARMArlc9nHvqhe3gQNSdc9IqSRGjgtZRgs1FtRIw7IJhAP3uaNjWcybymj/mhKc1U9x +TOmqzsId8adS8J6koUtFpug9gcZJjGzHQisPzHHFXi/7bDsHTQijpXwFx3ts3StOkxZ oZ7jYvASeXZntbn9Utga38ZH/Ha4yYCNfMTbgdinBXbT3WmtLofyu6c3bgVUXK/PknTE vv46/aYZ1HdrlzXlf56iSzN4fAdq+JuT9Xe8OiWXve4JFcBlf0jTcoBpnyYCNksn+k1N 082A== X-Forwarded-Encrypted: i=1; AJvYcCWJU2ubSYxRtCENWug999Nax2MCGYxh/ZiuZQILOMu1eL9r8LYSeOOz9cWmKDnJVaMX3feXQ28=@dpdk.org X-Gm-Message-State: AOJu0YyVf8C3wNsNnRylS/uC6dpU23quGsUvRB+6GS0bWv0HFyq8gYBz yh8WGzZJiMoMG/rvtYDrCcjazfL37dWwVC4bT5quIpEbRLJJei6JK//UngU5U1VQU1Ss6s9ZTMh SbEpUaBi/zroRXsdBdBNI+hFFHG4eVkziIzGQYA== X-Gm-Gg: ASbGncski83MyKtrIQ4sLmwmkJ2qr2DMeoDBSm17SqAEusvJdDWRLEk1dUcUrdcmz2g lWDPgJrzAfFRiG+cxl0iDP1L73tRk5mZy+Jjg1a29WME5/rKwDA7pbzB1fSwgP8E8T7X8j88= 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: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-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--