All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/37] qapi: static typing conversion, pt1
@ 2020-09-15 22:39 John Snow
  2020-09-15 22:39 ` [PATCH 01/37] python: Require 3.6+ John Snow
                   ` (39 more replies)
  0 siblings, 40 replies; 98+ messages in thread
From: John Snow @ 2020-09-15 22:39 UTC (permalink / raw)
  To: qemu-devel, Markus Armbruster
  Cc: John Snow, Peter Maydell, Alex Bennée, Eduardo Habkost, Cleber Rosa

Hi, this series starts adding static type hints to the QAPI module. As
you can see, the series started getting quite a bit long, so this is
only a partial conversion that focuses on a handful of the easier files.

The tougher files -- schema.py, expr.py, parser.py -- will each receive
their own series as a follow-up to this one.

Notes:

- This requires Python 3.6+. Python 3.5 is EOL, so let's do that.

- Any patch named "add notational type hints" changes ONLY signatures,
  which have no runtime impact whatsoever. These are big patches,
  but fairly straightforward.

- Most other patches are as bite-sized as possible, generally fixing one
  single warning.

- After patch 6, `flake8 qapi/` should pass 100% on this and every
  future commit.

- After patch 7, `pylint --rcfile=qapi/pylintrc qapi/` should pass 100%
  on this and every future commit.

- After patch 16, `mypy --config-file=qapi/mypy.ini qapi/` should pass
  100% on this and every future commit.

Preliminary refactoring and prerequisites:

001/37: 'python: Require 3.6+'
002/37: '[DO-NOT-MERGE] qapi: add debugging tools'
003/37: 'qapi-gen: Separate arg-parsing from generation'
004/37: 'qapi: move generator entrypoint into module'
005/37: 'qapi: Remove wildcard includes'
006/37: 'qapi: delint using flake8'
007/37: 'qapi: add pylintrc'

common.py (and params.py):

008/37: 'qapi/common.py: Remove python compatibility workaround'
009/37: 'qapi/common.py: Add indent manager'
010/37: 'qapi/common.py: delint with pylint'
011/37: 'qapi/common.py: Replace one-letter 'c' variable'
012/37: 'qapi/common.py: check with pylint'
013/37: 'qapi/common.py: add notational type hints'
014/37: 'qapi/common.py: Move comments into docstrings'
015/37: 'qapi/common.py: split build_params into new file'
016/37: 'qapi: establish mypy type-checking baseline'

events.py:

017/37: 'qapi/events.py: add notational type hints'
018/37: 'qapi/events.py: Move comments into docstrings'

commands.py:

019/37: 'qapi/commands.py: Don't re-bind to variable of different type'
020/37: 'qapi/commands.py: add notational type hints'
021/37: 'qapi/commands.py: enable checking with mypy'

source.py:

022/37: 'qapi/source.py: add notational type hints'
023/37: 'qapi/source.py: delint with pylint'

gen.py:

024/37: 'qapi/gen.py: Fix edge-case of _is_user_module'
025/37: 'qapi/gen.py: add notational type hints'
026/37: 'qapi/gen.py: Enable checking with mypy'
027/37: 'qapi/gen.py: Remove unused parameter'
028/37: 'qapi/gen.py: update write() to be more idiomatic'
029/37: 'qapi/gen.py: delint with pylint'

introspect.py:

030/37: 'qapi/introspect.py: Add a typed 'extra' structure'
031/37: 'qapi/introspect.py: add _gen_features helper'
032/37: 'qapi/introspect.py: create a typed 'Node' data structure'
033/37: 'qapi/introspect.py: add notational type hints'

types.py:

034/37: 'qapi/types.py: add notational type hints'
035/37: 'qapi/types.py: remove one-letter variables'

visit.py:

036/37: 'qapi/visit.py: remove unused parameters from gen_visit_object'
037/37: 'qapi/visit.py: add notational type hints'

John Snow (37):
  python: Require 3.6+
  [DO-NOT-MERGE] qapi: add debugging tools
  qapi-gen: Separate arg-parsing from generation
  qapi: move generator entrypoint into module
  qapi: Remove wildcard includes
  qapi: delint using flake8
  qapi: add pylintrc
  qapi/common.py: Remove python compatibility workaround
  qapi/common.py: Add indent manager
  qapi/common.py: delint with pylint
  qapi/common.py: Replace one-letter 'c' variable
  qapi/common.py: check with pylint
  qapi/common.py: add notational type hints
  qapi/common.py: Move comments into docstrings
  qapi/common.py: split build_params into new file
  qapi: establish mypy type-checking baseline
  qapi/events.py: add notational type hints
  qapi/events.py: Move comments into docstrings
  qapi/commands.py: Don't re-bind to variable of different type
  qapi/commands.py: add notational type hints
  qapi/commands.py: enable checking with mypy
  qapi/source.py: add notational type hints
  qapi/source.py: delint with pylint
  qapi/gen.py: Fix edge-case of _is_user_module
  qapi/gen.py: add notational type hints
  qapi/gen.py: Enable checking with mypy
  qapi/gen.py: Remove unused parameter
  qapi/gen.py: update write() to be more idiomatic
  qapi/gen.py: delint with pylint
  qapi/introspect.py: Add a typed 'extra' structure
  qapi/introspect.py: add _gen_features helper
  qapi/introspect.py: create a typed 'Node' data structure
  qapi/introspect.py: add notational type hints
  qapi/types.py: add notational type hints
  qapi/types.py: remove one-letter variables
  qapi/visit.py: remove unused parameters from gen_visit_object
  qapi/visit.py: add notational type hints

 docs/conf.py                  |   4 +-
 configure                     |   6 +-
 .readthedocs.yml              |   2 +-
 .travis.yml                   |   8 --
 scripts/qapi-gen.py           |  59 ++--------
 scripts/qapi/.flake8          |   2 +
 scripts/qapi/commands.py      |  85 +++++++++++----
 scripts/qapi/common.py        | 161 +++++++++++++++------------
 scripts/qapi/debug.py         |  78 +++++++++++++
 scripts/qapi/doc.py           |   3 +-
 scripts/qapi/events.py        |  61 ++++++++---
 scripts/qapi/expr.py          |   4 +-
 scripts/qapi/gen.py           | 147 +++++++++++++------------
 scripts/qapi/introspect.py    | 200 +++++++++++++++++++++++-----------
 scripts/qapi/mypy.ini         |  30 +++++
 scripts/qapi/params.py        |  40 +++++++
 scripts/qapi/parser.py        |   4 +-
 scripts/qapi/pylintrc         |  71 ++++++++++++
 scripts/qapi/schema.py        |  33 +++---
 scripts/qapi/script.py        |  91 ++++++++++++++++
 scripts/qapi/source.py        |  34 +++---
 scripts/qapi/types.py         | 125 ++++++++++++++-------
 scripts/qapi/visit.py         | 104 +++++++++++++-----
 tests/qemu-iotests/iotests.py |   2 -
 24 files changed, 947 insertions(+), 407 deletions(-)
 create mode 100644 scripts/qapi/.flake8
 create mode 100644 scripts/qapi/debug.py
 create mode 100644 scripts/qapi/mypy.ini
 create mode 100644 scripts/qapi/params.py
 create mode 100644 scripts/qapi/pylintrc
 create mode 100644 scripts/qapi/script.py

-- 
2.26.2




^ permalink raw reply	[flat|nested] 98+ messages in thread

end of thread, other threads:[~2020-09-25 14:12 UTC | newest]

Thread overview: 98+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-15 22:39 [PATCH 00/37] qapi: static typing conversion, pt1 John Snow
2020-09-15 22:39 ` [PATCH 01/37] python: Require 3.6+ John Snow
2020-09-16  8:42   ` Markus Armbruster
2020-09-16  8:51   ` Daniel P. Berrangé
2020-09-15 22:39 ` [PATCH 02/37] [DO-NOT-MERGE] qapi: add debugging tools John Snow
2020-09-15 22:39 ` [PATCH 03/37] qapi-gen: Separate arg-parsing from generation John Snow
2020-09-15 22:39 ` [PATCH 04/37] qapi: move generator entrypoint into module John Snow
2020-09-16 11:54   ` Markus Armbruster
2020-09-16 14:24     ` John Snow
2020-09-17  7:46       ` Markus Armbruster
2020-09-15 22:39 ` [PATCH 05/37] qapi: Remove wildcard includes John Snow
2020-09-15 22:39 ` [PATCH 06/37] qapi: delint using flake8 John Snow
2020-09-16 12:12   ` Markus Armbruster
2020-09-16 14:29     ` John Snow
2020-09-17  7:54       ` Markus Armbruster
2020-09-17 16:57         ` John Snow
2020-09-18 10:33           ` Markus Armbruster
2020-09-18 18:13             ` John Snow
2020-09-21  7:31               ` Markus Armbruster
2020-09-21 14:50                 ` John Snow
2020-09-15 22:39 ` [PATCH 07/37] qapi: add pylintrc John Snow
2020-09-16 12:30   ` Markus Armbruster
2020-09-16 14:37     ` John Snow
2020-09-17  7:58       ` Markus Armbruster
2020-09-17 17:06         ` John Snow
2020-09-15 22:39 ` [PATCH 08/37] qapi/common.py: Remove python compatibility workaround John Snow
2020-09-16 12:34   ` Markus Armbruster
2020-09-16 14:38     ` John Snow
2020-09-15 22:39 ` [PATCH 09/37] qapi/common.py: Add indent manager John Snow
2020-09-16 15:13   ` Markus Armbruster
2020-09-16 22:25     ` John Snow
2020-09-17  8:07       ` Markus Armbruster
2020-09-17 17:18         ` John Snow
2020-09-18 10:55           ` Markus Armbruster
2020-09-18 16:08             ` John Snow
2020-09-21  7:43               ` Markus Armbruster
2020-09-15 22:40 ` [PATCH 10/37] qapi/common.py: delint with pylint John Snow
2020-09-17 14:15   ` Markus Armbruster
2020-09-17 17:48     ` John Snow
2020-09-18 11:03       ` Markus Armbruster
2020-09-15 22:40 ` [PATCH 11/37] qapi/common.py: Replace one-letter 'c' variable John Snow
2020-09-17 14:17   ` Markus Armbruster
2020-09-17 17:51     ` John Snow
2020-09-15 22:40 ` [PATCH 12/37] qapi/common.py: check with pylint John Snow
2020-09-15 22:40 ` [PATCH 13/37] qapi/common.py: add notational type hints John Snow
2020-09-17 14:32   ` Markus Armbruster
2020-09-17 18:18     ` John Snow
2020-09-17 20:06       ` John Snow
2020-09-18 11:14       ` Markus Armbruster
2020-09-18 15:24         ` John Snow
2020-09-15 22:40 ` [PATCH 14/37] qapi/common.py: Move comments into docstrings John Snow
2020-09-17 14:37   ` Markus Armbruster
2020-09-17 18:44     ` John Snow
2020-09-17 19:14       ` Eduardo Habkost
2020-09-17 19:31         ` John Snow
2020-09-24 15:06           ` Markus Armbruster
2020-09-24 16:31             ` John Snow
2020-09-25  7:49               ` Markus Armbruster
2020-09-25 14:07                 ` John Snow
2020-09-15 22:40 ` [PATCH 15/37] qapi/common.py: split build_params into new file John Snow
2020-09-17 14:42   ` Markus Armbruster
2020-09-17 18:53     ` John Snow
2020-09-17 19:40     ` John Snow
2020-09-15 22:40 ` [PATCH 16/37] qapi: establish mypy type-checking baseline John Snow
2020-09-18 11:55   ` Markus Armbruster
2020-09-18 14:27     ` John Snow
2020-09-21  8:05       ` Markus Armbruster
2020-09-21 14:41         ` John Snow
2020-09-25  1:18         ` Eduardo Habkost
2020-09-18 19:03     ` John Snow
2020-09-21  8:05       ` Markus Armbruster
2020-09-21 14:46         ` John Snow
2020-09-15 22:40 ` [PATCH 17/37] qapi/events.py: add notational type hints John Snow
2020-09-15 22:40 ` [PATCH 18/37] qapi/events.py: Move comments into docstrings John Snow
2020-09-15 22:40 ` [PATCH 19/37] qapi/commands.py: Don't re-bind to variable of different type John Snow
2020-09-15 22:40 ` [PATCH 20/37] qapi/commands.py: add notational type hints John Snow
2020-09-15 22:40 ` [PATCH 21/37] qapi/commands.py: enable checking with mypy John Snow
2020-09-15 22:40 ` [PATCH 22/37] qapi/source.py: add notational type hints John Snow
2020-09-15 22:40 ` [PATCH 23/37] qapi/source.py: delint with pylint John Snow
2020-09-15 22:40 ` [PATCH 24/37] qapi/gen.py: Fix edge-case of _is_user_module John Snow
2020-09-15 22:40 ` [PATCH 25/37] qapi/gen.py: add notational type hints John Snow
2020-09-15 22:40 ` [PATCH 26/37] qapi/gen.py: Enable checking with mypy John Snow
2020-09-15 22:40 ` [PATCH 27/37] qapi/gen.py: Remove unused parameter John Snow
2020-09-15 22:40 ` [PATCH 28/37] qapi/gen.py: update write() to be more idiomatic John Snow
2020-09-15 22:40 ` [PATCH 29/37] qapi/gen.py: delint with pylint John Snow
2020-09-15 22:40 ` [PATCH 30/37] qapi/introspect.py: Add a typed 'extra' structure John Snow
2020-09-15 22:40 ` [PATCH 31/37] qapi/introspect.py: add _gen_features helper John Snow
2020-09-15 22:40 ` [PATCH 32/37] qapi/introspect.py: create a typed 'Node' data structure John Snow
2020-09-15 22:40 ` [PATCH 33/37] qapi/introspect.py: add notational type hints John Snow
2020-09-15 22:40 ` [PATCH 34/37] qapi/types.py: " John Snow
2020-09-15 22:40 ` [PATCH 35/37] qapi/types.py: remove one-letter variables John Snow
2020-09-15 22:40 ` [PATCH 36/37] qapi/visit.py: remove unused parameters from gen_visit_object John Snow
2020-09-15 22:40 ` [PATCH 37/37] qapi/visit.py: add notational type hints John Snow
2020-09-16 22:33 ` [PATCH 00/37] qapi: static typing conversion, pt1 John Snow
2020-09-17 20:22 ` John Snow
2020-09-18  7:50   ` Markus Armbruster
2020-09-18 13:07 ` Philippe Mathieu-Daudé
2020-09-18 14:30   ` John Snow

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.