From patchwork Tue Aug 6 06:13:57 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: 142912 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 9710A45748; Tue, 6 Aug 2024 08:14:14 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5795F409FA; Tue, 6 Aug 2024 08:14:08 +0200 (CEST) Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) by mails.dpdk.org (Postfix) with ESMTP id EA5934068E for ; Tue, 6 Aug 2024 08:14:05 +0200 (CEST) Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-5b01af9b0c9so182484a12.3 for ; Mon, 05 Aug 2024 23:14:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pantheon.tech; s=google; t=1722924845; x=1723529645; 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=NO2UZ+LLMKW3UrDhN9eC/Bfrt3jHMMG2THTaBf2mSkQ=; b=RlMoE5NB+3EHjNdxS/OEiZpFm3uv7RHcnEiN8f7v3tHdo7FOtCVKuJ5e7zIIAXGdcl T1pwSrO0hZNj2ovsgxGCsWkxCnnGlNyrJYGhGdte+WceFA/eCmzgfWimNeS72kzLy3wN nfMz2rfC5RTzFwtr74JxUewaxB79DRzbri+H4E0GTt9GV4SF/Y5QL6XyiKdShteqUvFj kreSoHMLzNfBIww3wVUPJBFyTdvqMFeGkfttpFIIkzyzv8wAA9vEt7/2gOTEyCRgVguZ 3UuSM+wRmBqtnOvD+4zETzTYxw7XmaNZtxePFbBaA3lD6sE/5P/fW6GUqAE9ymSdAo9E bwmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722924845; x=1723529645; 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=NO2UZ+LLMKW3UrDhN9eC/Bfrt3jHMMG2THTaBf2mSkQ=; b=NL5uLOsFupiwkfKJCREGqA2dSiY2nc1JViZ3okdjMIBSxqKYjcLWbuGhBUYLLJtjk2 l60oUgE8g8wwoE2xxiNaLB5CXDSyXXYJdjhNt0K0Xf70cpq8P0Fx9vuFVeBxbarf9r7o 6f0qsykhiWKL9C3jeIMVZ3aTDMQYbImgJStItD+HaET7X1mqexImgIUIFptnhq0F0kX4 C+z4PzwAJ6MlacKeSt+dCHVi1FFOn47lIii22zUvCzk/5yR22b7GfBizovbt9yKrXbmz 6mbKGbYLMq/hSgu9eyXs/tvPaI4swfXe3Li6RUfopfFAWDahhpSN7Cw7EH54j1pkmCw/ Dwng== X-Gm-Message-State: AOJu0Yw7FACDxxX/qxINivOQQdvpTYXzyRpAmM+rPxyZblLb7KLx479f +gIFTkZAKjhuYXjT9eRls6Nf+2CqUB7V/K/j6OxJtrNHGoDSdVm8vy8ZcBKbxk4= X-Google-Smtp-Source: AGHT+IESFAHNe2TDC33ZuwJ4+5HE271OW4t9non8sCd3FkjrLVEfX+bffiaW9fZaCX6fT+4wUqk7Ug== X-Received: by 2002:a17:907:9452:b0:a6f:4804:d41a with SMTP id a640c23a62f3a-a7dc519065dmr935901766b.55.1722924845304; Mon, 05 Aug 2024 23:14:05 -0700 (PDT) Received: from localhost.localdomain ([84.245.121.236]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7dc9d515fesm514951466b.107.2024.08.05.23.14.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Aug 2024 23:14:04 -0700 (PDT) From: =?utf-8?q?Juraj_Linke=C5=A1?= To: thomas@monjalon.net, Honnappa.Nagarahalli@arm.com, bruce.richardson@intel.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@arm.com Subject: [PATCH v12 1/5] dts: update params and parser docstrings Date: Tue, 6 Aug 2024 08:13:57 +0200 Message-Id: <20240806061401.222164-2-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240806061401.222164-1-juraj.linkes@pantheon.tech> References: <20231115133606.42081-1-juraj.linkes@pantheon.tech> <20240806061401.222164-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 Address a few errors reported by Sphinx when generating documentation: framework/params/__init__.py:docstring of framework.params.modify_str:3: WARNING: Inline interpreted text or phrase reference start-string without end-string. framework/params/eal.py:docstring of framework.params.eal.EalParams:35: WARNING: Definition list ends without a blank line; unexpected unindent. framework/params/types.py:docstring of framework.params.types:8: WARNING: Inline strong start-string without end-string. framework/params/types.py:docstring of framework.params.types:9: WARNING: Inline strong start-string without end-string. framework/parser.py:docstring of framework.parser.TextParser:33: ERROR: Unexpected indentation. framework/parser.py:docstring of framework.parser.TextParser:43: ERROR: Unexpected indentation. framework/parser.py:docstring of framework.parser.TextParser:49: ERROR: Unexpected indentation. framework/parser.py:docstring of framework.parser.TextParser.wrap:8: ERROR: Unexpected indentation. framework/parser.py:docstring of framework.parser.TextParser.wrap:9: WARNING: Block quote ends without a blank line; unexpected unindent. Fixes: 87ba4cdc0dbb ("dts: use Unpack for type checking and hinting") Fixes: d70159cb62f5 ("dts: add params manipulation module") Fixes: 967fc62b0a43 ("dts: refactor EAL parameters class") Fixes: 818fe14e3422 ("dts: add parsing utility module") Cc: luca.vizzarro@arm.com Signed-off-by: Juraj Linkeš Reviewed-by: Luca Vizzarro --- dts/framework/params/__init__.py | 4 ++-- dts/framework/params/eal.py | 7 +++++-- dts/framework/params/types.py | 3 ++- dts/framework/parser.py | 4 ++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/dts/framework/params/__init__.py b/dts/framework/params/__init__.py index 5a6fd93053..1ae227d7b4 100644 --- a/dts/framework/params/__init__.py +++ b/dts/framework/params/__init__.py @@ -53,9 +53,9 @@ def reduced_fn(value): def modify_str(*funcs: FnPtr) -> Callable[[T], T]: - """Class decorator modifying the ``__str__`` method with a function created from its arguments. + r"""Class decorator modifying the ``__str__`` method with a function created from its arguments. - The :attr:`FnPtr`s fed to the decorator are executed from left to right in the arguments list + The :attr:`FnPtr`\s fed to the decorator are executed from left to right in the arguments list order. Args: diff --git a/dts/framework/params/eal.py b/dts/framework/params/eal.py index 8d7766fefc..cf1594353a 100644 --- a/dts/framework/params/eal.py +++ b/dts/framework/params/eal.py @@ -26,13 +26,16 @@ class EalParams(Params): prefix: Set the file prefix string with which to start DPDK, e.g.: ``prefix="vf"``. no_pci: Switch to disable PCI bus, e.g.: ``no_pci=True``. vdevs: Virtual devices, e.g.:: + vdevs=[ VirtualDevice('net_ring0'), VirtualDevice('net_ring1') ] + ports: The list of ports to allow. - other_eal_param: user defined DPDK EAL parameters, e.g.: - ``other_eal_param='--single-file-segments'`` + other_eal_param: user defined DPDK EAL parameters, e.g.:: + + ``other_eal_param='--single-file-segments'`` """ lcore_list: LogicalCoreList | None = field(default=None, metadata=Params.short("l")) diff --git a/dts/framework/params/types.py b/dts/framework/params/types.py index e668f658d8..d77c4625fb 100644 --- a/dts/framework/params/types.py +++ b/dts/framework/params/types.py @@ -6,7 +6,8 @@ TypedDicts can be used in conjunction with Unpack and kwargs for type hinting on function calls. Example: - ..code:: python + .. code:: python + def create_testpmd(**kwargs: Unpack[TestPmdParamsDict]): params = TestPmdParams(**kwargs) """ diff --git a/dts/framework/parser.py b/dts/framework/parser.py index 741dfff821..7254c75b71 100644 --- a/dts/framework/parser.py +++ b/dts/framework/parser.py @@ -46,7 +46,7 @@ class TextParser(ABC): Example: The following example makes use of and demonstrates every parser function available: - ..code:: python + .. code:: python from dataclasses import dataclass, field from enum import Enum @@ -90,7 +90,7 @@ def wrap(parser_fn: ParserFn, wrapper_fn: Callable) -> ParserFn: """Makes a wrapped parser function. `parser_fn` is called and if a non-None value is returned, `wrapper_function` is called with - it. Otherwise the function returns early with None. In pseudo-code: + it. Otherwise the function returns early with None. In pseudo-code:: intermediate_value := parser_fn(input) if intermediary_value is None then