From patchwork Thu Aug 31 10:04:03 2023 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: 100 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 C7B4341FDB; Thu, 31 Aug 2023 12:04:10 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C653A40293; Thu, 31 Aug 2023 12:04:10 +0200 (CEST) Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) by mails.dpdk.org (Postfix) with ESMTP id 0442840293 for ; Thu, 31 Aug 2023 12:04:10 +0200 (CEST) Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-98377c5d53eso68544466b.0 for ; Thu, 31 Aug 2023 03:04:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pantheon.tech; s=google; t=1693476249; x=1694081049; 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=o7+E5OHIuW2FE6e33x1a8u1uDIiDBLBA4VfMAcXmnh4=; b=L//moGfYmQiZIPvEhu8j2HVUy/6ZvmpbAAQljiyUnmwuUMOxpjJeJkTHPfCx8vMHfL +dS2QD4xLXGwMmDIvMiA6WmFKyGTO819HneVVmGdF+NeeuYFC50c8AYMjaTedvfKUNzs f7jE8Y9zrbWDdlSCI3jOsDK77NQnLZYfuqrXUzcLm7B1OKrsj69AuE2SmYoQjAsiI0bL Ryrn8LRqy7gAbuo2bJ8tZ3ph4qGAiwBEy8WtOJFk6KzGR9g0xl0RvQwYHCjn7zn2cXLK IB1HqJGsMQxCCRtNMxBHAmeMgr7iSySJvTswwMzmtIQ6a9iQHhoYfJ6riqP0mjTef83H /1ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693476249; x=1694081049; 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=o7+E5OHIuW2FE6e33x1a8u1uDIiDBLBA4VfMAcXmnh4=; b=Y+OajxEAABYkjVx9W8P3lutr1ch8uIUhx1SD5dPSlLjU+Uv2ToTngIy2eBCeOgvv+S IW7CAirba50oF/yYDidZpl3AVo6aAASVH1CRVk5bKfwnkL5C0HVlYbxe4X4ZUJuYgQeb JkZlerSwG4j4Ugdsm+VbMEWROmb+Eo3Gm2IKhEjBF7HgDNn5GrJeNMxoZQKlpgazHqA2 MhaOhTgwccnxTgf1JQg3rvElkkvnCtJ8nZLqEx0IQkX6Sp07PzfetDVTosV4V8HzN2u/ JVyrTitX2K1/l3rqb7ppbnPraMATlDS3uGAvd17AiPdhVkDElgHVQnCImz5K5D6Iov3A wvxw== X-Gm-Message-State: AOJu0YzfpTWzlO209EctalS6HZ2Y43jNsMytz5hIEH2koFkmkyRXEdpZ l3MsePwnf7Ts2diTgPBYjR7DNQ== X-Google-Smtp-Source: AGHT+IFn77gh3d2tQc6Gg0r9Z+5nXWEOtsSD9tVKyeio2n54kU+si2ytVfmhjRVFDOuudsQAf+6L4w== X-Received: by 2002:a17:906:24f:b0:9a2:1b05:24c6 with SMTP id 15-20020a170906024f00b009a21b0524c6mr3706243ejl.22.1693476249643; Thu, 31 Aug 2023 03:04:09 -0700 (PDT) Received: from jlinkes-PT-Latitude-5530.. (ip-46.34.238.3.o2inet.sk. [46.34.238.3]) by smtp.gmail.com with ESMTPSA id l18-20020a1709066b9200b0099bc08862b6sm587513ejr.171.2023.08.31.03.04.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Aug 2023 03:04:09 -0700 (PDT) From: =?utf-8?q?Juraj_Linke=C5=A1?= To: thomas@monjalon.net, Honnappa.Nagarahalli@arm.com, lijuan.tu@intel.com, bruce.richardson@intel.com, jspewock@iol.unh.edu, probb@iol.unh.edu Cc: dev@dpdk.org, =?utf-8?q?Juraj_Linke=C5=A1?= Subject: [RFC PATCH v4 0/4] dts: add dts api docs Date: Thu, 31 Aug 2023 12:04:03 +0200 Message-Id: <20230831100407.59865-1-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230511091408.236638-1-juraj.linkes@pantheon.tech> References: <20230511091408.236638-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 Augment the meson build system with dts api generation. The api docs are generated from Python docstrings in DTS using Sphinx. The format of choice is the Google format [0]. The guides html sphinx configuration is used to preserve the same style, except the sidebar is configured to allow unlimited depth and better collapsing. The build requires the same Python version and dependencies as DTS, because Sphinx imports the Python modules. The modules are imported individually, requiring code refactoring. Dependencies are installed using Poetry from the dts directory: poetry install --with docs After installing, enter the Poetry shell: poetry shell And then run the build: ninja -C dts/doc There's only one properly documented module that serves as a demonstration of the style - framework.testbed_model.node. When we agree on the docstring format, all docstrings will be reformatted. [0] https://google.github.io/styleguide/pyguide.html#s3.8.4-comments-in-classes Juraj Linkeš (4): dts: code adjustments for sphinx dts: add doc generation dependencies dts: add doc generation dts: format docstrigs to google format buildtools/call-sphinx-build.py | 29 +- doc/api/meson.build | 1 + doc/guides/conf.py | 32 +- doc/guides/meson.build | 1 + doc/guides/tools/dts.rst | 29 ++ dts/doc/doc-index.rst | 17 + dts/doc/meson.build | 50 ++ dts/framework/config/__init__.py | 3 - dts/framework/dts.py | 34 +- dts/framework/remote_session/__init__.py | 41 +- .../interactive_remote_session.py | 0 .../{remote => }/interactive_shell.py | 0 .../{remote => }/python_shell.py | 0 .../remote_session/remote/__init__.py | 27 -- .../{remote => }/remote_session.py | 0 .../{remote => }/ssh_session.py | 0 .../{remote => }/testpmd_shell.py | 0 dts/framework/settings.py | 92 ++-- dts/framework/test_suite.py | 3 +- dts/framework/testbed_model/__init__.py | 12 +- dts/framework/testbed_model/common.py | 29 ++ dts/framework/testbed_model/{hw => }/cpu.py | 13 + dts/framework/testbed_model/hw/__init__.py | 27 -- .../linux_session.py | 4 +- dts/framework/testbed_model/node.py | 193 +++++--- .../os_session.py | 14 +- dts/framework/testbed_model/{hw => }/port.py | 0 .../posix_session.py | 2 +- dts/framework/testbed_model/sut_node.py | 8 +- dts/framework/testbed_model/tg_node.py | 30 +- .../traffic_generator/__init__.py | 24 + .../capturing_traffic_generator.py | 2 +- .../{ => traffic_generator}/scapy.py | 17 +- .../traffic_generator.py | 16 +- .../testbed_model/{hw => }/virtual_device.py | 0 dts/framework/utils.py | 53 +-- dts/main.py | 3 +- dts/meson.build | 16 + dts/poetry.lock | 447 +++++++++++++++++- dts/pyproject.toml | 7 + meson.build | 1 + 41 files changed, 961 insertions(+), 316 deletions(-) create mode 100644 dts/doc/doc-index.rst create mode 100644 dts/doc/meson.build rename dts/framework/remote_session/{remote => }/interactive_remote_session.py (100%) rename dts/framework/remote_session/{remote => }/interactive_shell.py (100%) rename dts/framework/remote_session/{remote => }/python_shell.py (100%) delete mode 100644 dts/framework/remote_session/remote/__init__.py rename dts/framework/remote_session/{remote => }/remote_session.py (100%) rename dts/framework/remote_session/{remote => }/ssh_session.py (100%) rename dts/framework/remote_session/{remote => }/testpmd_shell.py (100%) create mode 100644 dts/framework/testbed_model/common.py rename dts/framework/testbed_model/{hw => }/cpu.py (95%) delete mode 100644 dts/framework/testbed_model/hw/__init__.py rename dts/framework/{remote_session => testbed_model}/linux_session.py (98%) rename dts/framework/{remote_session => testbed_model}/os_session.py (97%) rename dts/framework/testbed_model/{hw => }/port.py (100%) rename dts/framework/{remote_session => testbed_model}/posix_session.py (99%) create mode 100644 dts/framework/testbed_model/traffic_generator/__init__.py rename dts/framework/testbed_model/{ => traffic_generator}/capturing_traffic_generator.py (99%) rename dts/framework/testbed_model/{ => traffic_generator}/scapy.py (96%) rename dts/framework/testbed_model/{ => traffic_generator}/traffic_generator.py (80%) rename dts/framework/testbed_model/{hw => }/virtual_device.py (100%) create mode 100644 dts/meson.build