From patchwork Wed Jun 19 13:35:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Juraj_Linke=C5=A1?= X-Patchwork-Id: 141390 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5E473454A8; Wed, 19 Jun 2024 15:37:16 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 013E541149; Wed, 19 Jun 2024 15:37:05 +0200 (CEST) Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) by mails.dpdk.org (Postfix) with ESMTP id 0E05E4021D for ; Wed, 19 Jun 2024 15:35:32 +0200 (CEST) Received: by mail-ej1-f49.google.com with SMTP id a640c23a62f3a-a6f04afcce1so861044666b.2 for ; Wed, 19 Jun 2024 06:35:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pantheon.tech; s=google; t=1718804131; x=1719408931; darn=dpdk.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=B4za1AWsBUJILJk9ptv+C01mPajRv4RpwyF+Z9+5c1o=; b=v0OM0uiN3arZKe+qMW/kJN6m12YnRhEPMkAe0YQNXLWEArFmA3tmdOTtooU5N4A/eB BvTtRXs/FOOmmNHM2rHvDuqHnsaZR8f1u1qkUC6V/lF2SioE23cJ1kGpQnbGIguDvjvQ SWQG12ahEorv1m/kqREGlZYwyeCGxw/d7wr6+TUqodslmPfly0n/lsedWVM/QA2HqleV MfZqeDqwWCL1MPuinL85RVKUMrdgONkGROT6wW5vrmyPdDDN5V0Km8QI9x7mNrYO5+4Q G0pb4OlLsBCLTGrrsixh8BAbakCj1u7DmMwdGgSl0SOY6I3RFv39vV2E5QJeLqMLD0GW w4uA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718804131; x=1719408931; 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=B4za1AWsBUJILJk9ptv+C01mPajRv4RpwyF+Z9+5c1o=; b=LAeRD046OxMByTQzVZurZGIvuBpEZocpPcscv/IrESZzk4YHoD31n0GjRTI41zkUUS wFGU1fXRLQaaZ752rns4S/7N8UjEaX0uTsHoD9i8ay8T1N46FrT1hAZpSjzUFw+mXtol zWCaGXF88iNOfOnH7M5FIYAifmZMRVyMNp4ywIiGdQNTee7iI3fB40MBcmz9ofj0aE+T 8GKDMfWELWOyjhn+JtCIT8R9RGfDlrCtXAgF8nXQc7m9nQT4/P/3ciakvPXAutgweB6l YOkIXDIgn0V2L33m3E6wtjGx9t5uudr6mbQrH9gAyxxjlphATIiW5xp0HY/58R6ljtsa sEzg== X-Gm-Message-State: AOJu0Yxss2Y6Jg5BcK4VfeQ2CpsPCSZRRbyPpkR8muFTPmmJIfdiHe4Y 3hKKZmjTMCwzrnQy7C3zktwWlBaliU3Us+OZMXZNARX+r5VcsguJnRVBaasSjfQ= X-Google-Smtp-Source: AGHT+IE+szJE/5cEY37Nrg84/BFDZWxfPEg8wI4jdjz3stT5BKAO4ioL+9IAt9GPM3hJxJ093F0E9Q== X-Received: by 2002:a17:907:765c:b0:a6f:a54:1598 with SMTP id a640c23a62f3a-a6fab779292mr142312666b.49.1718804131690; Wed, 19 Jun 2024 06:35:31 -0700 (PDT) Received: from localhost.localdomain ([84.245.121.236]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6f56da3fe5sm676723566b.18.2024.06.19.06.35.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jun 2024 06:35:31 -0700 (PDT) From: =?utf-8?q?Juraj_Linke=C5=A1?= To: thomas@monjalon.net, Honnappa.Nagarahalli@arm.com, jspewock@iol.unh.edu, probb@iol.unh.edu, paul.szczepanek@arm.com, Luca.Vizzarro@arm.com, npratte@iol.unh.edu Cc: dev@dpdk.org, =?utf-8?q?Juraj_Linke=C5=A1?= , Luca Vizzarro Subject: [PATCH v2 2/5] dts: unify class inheritance from object Date: Wed, 19 Jun 2024 15:35:23 +0200 Message-Id: <20240619133526.28614-3-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240619133526.28614-1-juraj.linkes@pantheon.tech> References: <20240423091252.62924-1-juraj.linkes@pantheon.tech> <20240619133526.28614-1-juraj.linkes@pantheon.tech> MIME-Version: 1.0 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 There are two ways we specify that a class inherits from object - implicitly and explicitly. There's no need to explicitly specify that a class inherits from object and is in fact mostly a remnant from Python2. Leaving it implicit is the standard in Python3 and offers a small bonus in cases where something would assign something else to the builtin object variable. Signed-off-by: Juraj Linkeš Reviewed-by: Luca Vizzarro Reviewed-by: Patrick Robb Reviewed-by: Jeremy Spewock --- dts/framework/remote_session/testpmd_shell.py | 2 +- dts/framework/test_result.py | 4 ++-- dts/framework/test_suite.py | 2 +- dts/framework/testbed_model/cpu.py | 4 ++-- dts/framework/testbed_model/sut_node.py | 2 +- dts/framework/testbed_model/virtual_device.py | 2 +- dts/framework/utils.py | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dts/framework/remote_session/testpmd_shell.py b/dts/framework/remote_session/testpmd_shell.py index cb2ab6bd00..9456de941d 100644 --- a/dts/framework/remote_session/testpmd_shell.py +++ b/dts/framework/remote_session/testpmd_shell.py @@ -27,7 +27,7 @@ from .interactive_shell import InteractiveShell -class TestPmdDevice(object): +class TestPmdDevice: """The data of a device that testpmd can recognize. Attributes: diff --git a/dts/framework/test_result.py b/dts/framework/test_result.py index 4693519bbc..5deccb6fd4 100644 --- a/dts/framework/test_result.py +++ b/dts/framework/test_result.py @@ -96,7 +96,7 @@ def __bool__(self) -> bool: return self is self.PASS -class FixtureResult(object): +class FixtureResult: """A record that stores the result of a setup or a teardown. :attr:`~Result.FAIL` is a sensible default since it prevents false positives (which could happen @@ -132,7 +132,7 @@ def __bool__(self) -> bool: return bool(self.result) -class BaseResult(object): +class BaseResult: """Common data and behavior of DTS results. Stores the results of the setup and teardown portions of the corresponding stage. diff --git a/dts/framework/test_suite.py b/dts/framework/test_suite.py index 8768f756a6..b9f8daab1a 100644 --- a/dts/framework/test_suite.py +++ b/dts/framework/test_suite.py @@ -27,7 +27,7 @@ from .utils import get_packet_summaries -class TestSuite(object): +class TestSuite: """The base class with building blocks needed by most test cases. * Test suite setup/cleanup methods to override, diff --git a/dts/framework/testbed_model/cpu.py b/dts/framework/testbed_model/cpu.py index 9e33b2825d..a50cf44c19 100644 --- a/dts/framework/testbed_model/cpu.py +++ b/dts/framework/testbed_model/cpu.py @@ -26,7 +26,7 @@ @dataclass(slots=True, frozen=True) -class LogicalCore(object): +class LogicalCore: """Representation of a logical CPU core. A physical core is represented in OS by multiple logical cores (lcores) @@ -50,7 +50,7 @@ def __int__(self) -> int: return self.lcore -class LogicalCoreList(object): +class LogicalCoreList: r"""A unified way to store :class:`LogicalCore`\s. Create a unified format used across the framework and allow the user to use diff --git a/dts/framework/testbed_model/sut_node.py b/dts/framework/testbed_model/sut_node.py index 97aa26d419..10d56eba8d 100644 --- a/dts/framework/testbed_model/sut_node.py +++ b/dts/framework/testbed_model/sut_node.py @@ -34,7 +34,7 @@ from .virtual_device import VirtualDevice -class EalParameters(object): +class EalParameters: """The environment abstraction layer parameters. The string representation can be created by converting the instance to a string. diff --git a/dts/framework/testbed_model/virtual_device.py b/dts/framework/testbed_model/virtual_device.py index e9b5e9c3be..569d67b007 100644 --- a/dts/framework/testbed_model/virtual_device.py +++ b/dts/framework/testbed_model/virtual_device.py @@ -7,7 +7,7 @@ """ -class VirtualDevice(object): +class VirtualDevice: """Base class for virtual devices used by DPDK. Attributes: diff --git a/dts/framework/utils.py b/dts/framework/utils.py index 862bafb46c..6b5d5a805f 100644 --- a/dts/framework/utils.py +++ b/dts/framework/utils.py @@ -108,7 +108,7 @@ def __str__(self) -> str: return self.name -class MesonArgs(object): +class MesonArgs: """Aggregate the arguments needed to build DPDK.""" _default_library: str @@ -157,7 +157,7 @@ class _TarCompressionFormat(StrEnum): zstd = "zst" -class DPDKGitTarball(object): +class DPDKGitTarball: """Compressed tarball of DPDK from the repository. The class supports the :class:`os.PathLike` protocol,