From: John Snow <jsnow@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Thomas Huth" <thuth@redhat.com>,
"Eduardo Habkost" <ehabkost@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
"Willian Rampazzo" <willianr@redhat.com>,
"Cleber Rosa" <crosa@redhat.com>, "John Snow" <jsnow@redhat.com>
Subject: [PATCH v3 15/15] python: Fix broken ReST docstrings
Date: Tue, 29 Jun 2021 17:43:23 -0400 [thread overview]
Message-ID: <20210629214323.1329806-16-jsnow@redhat.com> (raw)
In-Reply-To: <20210629214323.1329806-1-jsnow@redhat.com>
This patch *doesn't* update all of the docstring standards across the
QEMU package directory to make our docstring usage consistent. It
*doesn't* fix the formatting to make it look pretty or reasonable in
generated output. It *does* fix a few small instances where Sphinx would
emit a build warning because of malformed ReST -- If we built our Python
docs with Sphinx.
Signed-off-by: John Snow <jsnow@redhat.com>
---
You'll have to take my word for it for now, or, to test that (ugly
though it may be) a theoretical Sphinx build would produce no build
errors:
> cd ~/src/qemu/python
> sphinx-apidoc --separate --private --no-toc --module-first \
--implicit-namespaces --full --ext-intersphinx --ext-coverage \
--ext-viewcode qemu/ -o docs/
> sed -i '1s|^|import os; import sys; sys.path.insert(0, os.path.abspath("../"))\n|' docs/conf.py
> make -C docs html
> rm -rf docs/
I am preparing to add Sphinx, but need to fix these annoyances first so
that regressions are easy to spot as fixes are applied across the
tree. I plan to use my forthcoming Asynchronous QMP series as a test
pilot for documenting our docstring standards. Assuming it goes well, I
will update the docstrings elsewhere in this package at that time.
Signed-off-by: John Snow <jsnow@redhat.com>
---
python/qemu/machine/__init__.py | 6 +++---
python/qemu/machine/machine.py | 3 ++-
python/qemu/qmp/__init__.py | 1 +
python/qemu/qmp/qom_common.py | 2 +-
python/qemu/utils/accel.py | 2 +-
5 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/python/qemu/machine/__init__.py b/python/qemu/machine/__init__.py
index 728f27adbe..9ccd58ef14 100644
--- a/python/qemu/machine/__init__.py
+++ b/python/qemu/machine/__init__.py
@@ -4,10 +4,10 @@
This library provides a few high-level classes for driving QEMU from a
test suite, not intended for production use.
-- QEMUMachine: Configure and Boot a QEMU VM
- - QEMUQtestMachine: VM class, with a qtest socket.
+ | QEMUQtestProtocol: send/receive qtest messages.
+ | QEMUMachine: Configure and Boot a QEMU VM
+ | +-- QEMUQtestMachine: VM class, with a qtest socket.
-- QEMUQtestProtocol: Connect to, send/receive qtest messages.
"""
# Copyright (C) 2020-2021 John Snow for Red Hat Inc.
diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py
index e3345dfa1b..d47ab3d896 100644
--- a/python/qemu/machine/machine.py
+++ b/python/qemu/machine/machine.py
@@ -545,7 +545,8 @@ def set_qmp_monitor(self, enabled: bool = True) -> None:
@param enabled: if False, qmp monitor options will be removed from
the base arguments of the resulting QEMU command
line. Default is True.
- @note: call this function before launch().
+
+ .. note:: Call this function before launch().
"""
self._qmp_set = enabled
diff --git a/python/qemu/qmp/__init__.py b/python/qemu/qmp/__init__.py
index 376954cb6d..269516a79b 100644
--- a/python/qemu/qmp/__init__.py
+++ b/python/qemu/qmp/__init__.py
@@ -279,6 +279,7 @@ def accept(self, timeout: Optional[float] = 15.0) -> QMPMessage:
None). The value passed will set the behavior of the
underneath QMP socket as described in [1].
Default value is set to 15.0.
+
@return QMP greeting dict
@raise OSError on socket connection errors
@raise QMPConnectError if the greeting is not received
diff --git a/python/qemu/qmp/qom_common.py b/python/qemu/qmp/qom_common.py
index f82b16772d..a59ae1a2a1 100644
--- a/python/qemu/qmp/qom_common.py
+++ b/python/qemu/qmp/qom_common.py
@@ -156,7 +156,7 @@ def command_runner(
"""
Run a fully-parsed subcommand, with error-handling for the CLI.
- :return: The return code from `.run()`.
+ :return: The return code from `run()`.
"""
try:
cmd = cls(args)
diff --git a/python/qemu/utils/accel.py b/python/qemu/utils/accel.py
index 297933df2a..386ff640ca 100644
--- a/python/qemu/utils/accel.py
+++ b/python/qemu/utils/accel.py
@@ -36,7 +36,7 @@ def list_accel(qemu_bin: str) -> List[str]:
List accelerators enabled in the QEMU binary.
@param qemu_bin (str): path to the QEMU binary.
- @raise Exception: if failed to run `qemu -accel help`
+ @raise Exception: if failed to run ``qemu -accel help``
@return a list of accelerator names.
"""
if not qemu_bin:
--
2.31.1
next prev parent reply other threads:[~2021-06-29 21:54 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-29 21:43 [PATCH v3 00/15] Python: packaging cleanups John Snow
2021-06-29 21:43 ` [PATCH v3 01/15] python/qom: Do not use 'err' name at module scope John Snow
2021-06-30 14:35 ` Wainer dos Santos Moschetta
2021-06-30 14:35 ` Willian Rampazzo
2021-06-29 21:43 ` [PATCH v3 02/15] python: expose typing information via PEP 561 John Snow
2021-06-29 21:43 ` [PATCH v3 03/15] python: Remove global pylint suppressions John Snow
2021-06-29 21:43 ` [PATCH v3 04/15] python: Re-lock pipenv at *oldest* supported versions John Snow
2021-06-29 21:43 ` [PATCH v3 05/15] python: README.rst touchups John Snow
2021-06-29 21:43 ` [PATCH v3 06/15] python: Add no-install usage instructions John Snow
2021-06-29 21:43 ` [PATCH v3 07/15] python: rename 'venv-check' target to 'check-pipenv' John Snow
2021-06-29 21:43 ` [PATCH v3 08/15] python: update help text for check-tox John Snow
2021-06-29 21:43 ` [PATCH v3 09/15] python: Fix .PHONY Make specifiers John Snow
2021-06-29 21:43 ` [PATCH v3 10/15] python: only check qemu/ subdir with flake8 John Snow
2021-06-30 14:36 ` Willian Rampazzo
2021-06-30 14:54 ` Wainer dos Santos Moschetta
2021-06-29 21:43 ` [PATCH v3 11/15] python: add 'make check-dev' invocation John Snow
2021-06-30 14:40 ` Willian Rampazzo
2021-06-30 14:58 ` John Snow
2021-06-30 15:02 ` Wainer dos Santos Moschetta
2021-06-30 15:32 ` Willian Rampazzo
2021-06-30 14:57 ` Wainer dos Santos Moschetta
2021-06-29 21:43 ` [PATCH v3 12/15] python: Update help text on 'make check', 'make develop' John Snow
2021-06-29 21:43 ` [PATCH v3 13/15] python: Update help text on 'make clean', 'make distclean' John Snow
2021-06-29 21:43 ` [PATCH v3 14/15] python: remove auto-generated pyproject.toml file John Snow
2021-06-29 21:43 ` John Snow [this message]
2021-06-30 14:43 ` [PATCH v3 15/15] python: Fix broken ReST docstrings Willian Rampazzo
2021-06-30 15:03 ` Wainer dos Santos Moschetta
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210629214323.1329806-16-jsnow@redhat.com \
--to=jsnow@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=crosa@redhat.com \
--cc=ehabkost@redhat.com \
--cc=f4bug@amsat.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
--cc=wainersm@redhat.com \
--cc=willianr@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).