Message ID | 20230504123749.1417259-1-juraj.linkes@pantheon.tech (mailing list archive) |
---|---|
Headers |
Return-Path: <dev-bounces@dpdk.org> 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 A315042A5D; Thu, 4 May 2023 14:37:55 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 39DF241144; Thu, 4 May 2023 14:37:55 +0200 (CEST) Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) by mails.dpdk.org (Postfix) with ESMTP id 0933A410DC for <dev@dpdk.org>; Thu, 4 May 2023 14:37:53 +0200 (CEST) Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-50bd87539c2so688852a12.0 for <dev@dpdk.org>; Thu, 04 May 2023 05:37:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pantheon-tech.20221208.gappssmtp.com; s=20221208; t=1683203873; x=1685795873; 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=Ei1M4C7oS/P6hXpdV1Fh608SOtzPEffAjZSsqRAcaes=; b=N78f0wL5dwKuPZg8bLl9JQqkBySIR7d32sQyBdVW9qVYo0dUmQBjoIYofzGFLiubkc zTZkF9PYJxTq4cTU9Ab5l1vS71cNCxjAKTVHhYSjJ89cyzbAsbxF8ajNkjTC5cWH4+4o 56XFWaQwBsAHoOP651f1i1j9gWIkX59KlUcVpU8tfc2Qmop3Q3heyVMwE9TsW9SZuIvp 7F6uo+Af0KgISleEXV6Ss1DDHXGoqe727xYfMxkP5hnT2kNZyAkoBJhJutj/dDTIjS7I E8QI/eTP1aaV8zP8UDfJkryrq+EC6ebJQ8sLQAIch2mLMuaeOwiFc3oEgHyudwGDMJ8E EYNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683203873; x=1685795873; 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=Ei1M4C7oS/P6hXpdV1Fh608SOtzPEffAjZSsqRAcaes=; b=Y4pWf5x5l+SvBMkpCbrBl0WNQJwi6DIcQ7yNA9T1eLgRwkWC5K7TYLsmfU7XWL2vWr h3eTOpBnm9NF5/j/DhnsLzBqoRdMjtfrRehGNXv/3Zznf2IIAuZrYvTMyEv4ZfojMgeH MXqbgrspQ4qzqQnUrS59RiO2/djxI5Hll+5T/ZPKwEBBWBLjFkFx4JneuNcL+nMsPOoh b0L867REAY5+FMHhJcUHyZ8KwezYFKGIphn29hkhSSyNfcqRJT0LP8TktojDMsh5ncGg Dax8UW9KFPqFE+HyniWWvropU90/+GI7nGetcKF2dlas+oBGsbWntENkIXd/dsoH1pir YEog== X-Gm-Message-State: AC+VfDzJxWf69AYlN/+VphD96rPSLhGmphhH0bnBVOtRKzf1d0huZVYp eqqh8kYEKO0aCf18Kkg4BkbsLQ== X-Google-Smtp-Source: ACHHUZ5zpwbaOpXCRlLXS0TJRa+8F9JkiPxrr6OSVRkGxmmKyaiIbEt4gWhe83bvZySnnIFw2nCTgA== X-Received: by 2002:a17:907:70a:b0:95e:c549:9ace with SMTP id xb10-20020a170907070a00b0095ec5499acemr6075602ejb.62.1683203873506; Thu, 04 May 2023 05:37:53 -0700 (PDT) Received: from localhost.localdomain (ip-46.34.246.203.o2inet.sk. [46.34.246.203]) by smtp.gmail.com with ESMTPSA id wz13-20020a170906fe4d00b00959c6b9dac8sm13679157ejb.197.2023.05.04.05.37.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 05:37:53 -0700 (PDT) From: =?utf-8?q?Juraj_Linke=C5=A1?= <juraj.linkes@pantheon.tech> To: thomas@monjalon.net, Honnappa.Nagarahalli@arm.com, lijuan.tu@intel.com, bruce.richardson@intel.com, wathsala.vithanage@arm.com, jspewock@iol.unh.edu, probb@iol.unh.edu Cc: dev@dpdk.org, =?utf-8?q?Juraj_Linke=C5=A1?= <juraj.linkes@pantheon.tech> Subject: [RFC PATCH v2 0/4] dts: add dts api docs Date: Thu, 4 May 2023 14:37:45 +0200 Message-Id: <20230504123749.1417259-1-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230323104040.484708-1-juraj.linkes@pantheon.tech> References: <20230323104040.484708-1-juraj.linkes@pantheon.tech> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org |
Series | dts: add dts api docs | |
Message
Juraj Linkeš
May 4, 2023, 12:37 p.m. UTC
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 guide html sphinx configuration is used to preserve the same style. The build requires the same Python version and dependencies as DTS, because Sphinx imports the Python modules. 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 <meson_build_dir> dts/doc There's only one properly documented module that serves as a demonstration of the style - framework.testbed_model.node. [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 doc/api/meson.build | 1 + doc/guides/conf.py | 22 +- doc/guides/meson.build | 1 + doc/guides/tools/dts.rst | 29 + dts/doc/doc-index.rst | 20 + dts/doc/meson.build | 50 ++ dts/framework/config/__init__.py | 11 + .../{testbed_model/hw => config}/cpu.py | 13 + dts/framework/dts.py | 8 +- dts/framework/remote_session/__init__.py | 3 +- dts/framework/remote_session/linux_session.py | 2 +- dts/framework/remote_session/os_session.py | 12 +- .../remote_session/remote/__init__.py | 16 - .../{remote => }/remote_session.py | 0 .../{remote => }/ssh_session.py | 0 dts/framework/settings.py | 55 +- dts/framework/testbed_model/__init__.py | 10 +- dts/framework/testbed_model/hw/__init__.py | 27 - dts/framework/testbed_model/node.py | 164 ++-- dts/framework/testbed_model/sut_node.py | 9 +- .../testbed_model/{hw => }/virtual_device.py | 0 dts/main.py | 3 +- dts/meson.build | 16 + dts/poetry.lock | 770 ++++++++++++++++-- dts/pyproject.toml | 7 + dts/tests/TestSuite_hello_world.py | 6 +- meson.build | 1 + meson_options.txt | 2 + 28 files changed, 1038 insertions(+), 220 deletions(-) create mode 100644 dts/doc/doc-index.rst create mode 100644 dts/doc/meson.build rename dts/framework/{testbed_model/hw => config}/cpu.py (95%) 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%) delete mode 100644 dts/framework/testbed_model/hw/__init__.py rename dts/framework/testbed_model/{hw => }/virtual_device.py (100%) create mode 100644 dts/meson.build
Comments
On Thu, May 04, 2023 at 02:37:45PM +0200, Juraj Linkeš wrote: > 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 guide html sphinx configuration is used to preserve the same style. > > The build requires the same Python version and dependencies as DTS, > because Sphinx imports the Python modules. 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 <meson_build_dir> dts/doc > > There's only one properly documented module that serves as a > demonstration of the style - framework.testbed_model.node. > > [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 > I find the requirement to use poetry to build the docs, and the need to run specific commands in specific directories quite awkward. With this patchset there is no ability to just turn on the build option for the DTS doc and have the docs built on the next rebuild. [Also, with every build I've tried I can't get it to build without warnings about missing "warlock" module.] From what I understand from the patchset, the doc building here using sphinx is primarily concerned with building the API docs. The rest of DPDK uses doxygen for this, and since doxygen supports python can the same tooling be used for the DTS docs? /Bruce
On Fri, May 5, 2023 at 4:07 PM Bruce Richardson <bruce.richardson@intel.com> wrote: > > On Thu, May 04, 2023 at 02:37:45PM +0200, Juraj Linkeš wrote: > > 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 guide html sphinx configuration is used to preserve the same style. > > > > The build requires the same Python version and dependencies as DTS, > > because Sphinx imports the Python modules. 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 <meson_build_dir> dts/doc > > > > There's only one properly documented module that serves as a > > demonstration of the style - framework.testbed_model.node. > > > > [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 > > > > I find the requirement to use poetry to build the docs, and the need to run > specific commands in specific directories quite awkward. With this patchset > there is no ability to just turn on the build option for the DTS doc and > have the docs built on the next rebuild. [Also, with every build I've tried > I can't get it to build without warnings about missing "warlock" module.] > > From what I understand from the patchset, the doc building here using > sphinx is primarily concerned with building the API docs. The rest of DPDK > uses doxygen for this, and since doxygen supports python can the same > tooling be used for the DTS docs? > I don't think any tool for python API docs would be able to do it without the dependencies. The standard way to document python code is in Python docstrings which are accessible during runtime (which is why the dependencies are needed). Doxygen says that as well: For Python there is a standard way of documenting the code using so called documentation strings ("""). Such strings are stored in __doc__ and can be retrieved at runtime. Doxygen will extract such comments and assume they have to be represented in a preformatted way. There may be a tool that doesn't use the __doc__ attribute accessible during runtime (I don't think anyone would implement something like that though), but that would likely be much worse than Sphinx. Juraj > /Bruce
On Fri, May 5, 2023 at 4:07 PM Bruce Richardson <bruce.richardson@intel.com> wrote: > > On Thu, May 04, 2023 at 02:37:45PM +0200, Juraj Linkeš wrote: > > 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 guide html sphinx configuration is used to preserve the same style. > > > > The build requires the same Python version and dependencies as DTS, > > because Sphinx imports the Python modules. 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 <meson_build_dir> dts/doc > > > > There's only one properly documented module that serves as a > > demonstration of the style - framework.testbed_model.node. > > > > [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 > > > > I find the requirement to use poetry to build the docs, and the need to run > specific commands in specific directories quite awkward. With this patchset > there is no ability to just turn on the build option for the DTS doc and > have the docs built on the next rebuild. [Also, with every build I've tried > I can't get it to build without warnings about missing "warlock" module.] > I want to ask about the warnings. This suggests a problem with dependencies, have you entered the Poetry shell? We may need to add some steps to docs, which are currently: poetry install --with docs poetry shell And then: ninja -C build dts/doc Maybe the problem is with Poetry version (1.4.2 and higher should work), which is not specified in the docs yet. I need to update http://patches.dpdk.org/project/dpdk/patch/20230331091355.1224059-1-juraj.linkes@pantheon.tech/ with it. Which are your exact steps for building the docs? Juraj > From what I understand from the patchset, the doc building here using > sphinx is primarily concerned with building the API docs. The rest of DPDK > uses doxygen for this, and since doxygen supports python can the same > tooling be used for the DTS docs? > > /Bruce