Skip to content

qapi: static typing conversion, pt3

John Snow qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest14 patches 14 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/14qapi/doc.py: stash long temporary locals in named localsscripts/qapi/doc.py+4 -61 reply
2/14qapi/doc.py: avoid unnecessary keyword argumentsscripts/qapi/doc.py+3 -21 reply
3/14qapi/doc.py: Add assertion on section.memberscripts/qapi/doc.py+12 -81 reply
4/14qapi/doc.py: assert correct types in member_func callbacksscripts/qapi/doc.py+7 -11 reply
5/14qapi/doc.py: Assert no suffix given for enum membersscripts/qapi/doc.py+1 -01 reply
6/14qapi/doc.py: Add type hint annotationsscripts/qapi/doc.py+87 -321 reply
7/14qapi/doc.py: enable mypy checksscripts/qapi/mypy.ini+0 -51 reply
8/14qapi/doc.py: Add generic texi_member callbackscripts/qapi/doc.py+19 -180 replies
9/14qapi/doc.py: Remove one-letter variablesscripts/qapi/doc.py+11 -111 reply
10/14qapi/gen.py: Add __bool__ dunder method to QAPIGenscripts/qapi/gen.py+3 -01 reply
11/14qapi/doc.py: Don't use private attributes of QAPIGen propertyscripts/qapi/doc.py+2 -21 reply
12/14qapi/doc.py: Assert tag member is Enum typescripts/qapi/doc.py+2 -01 reply
13/14qapi/doc.py: Assert type of object variantscripts/qapi/doc.py+1 -01 reply
14/14qapi/doc.py: enable pylint checksscripts/qapi/pylintrc+1 -21 reply

Reviews trailers per patch

13 of 14 patches have a Reviewed-by or Acked-by.

PatchEduardo Habkost
1/14R-b
2/14R-b
3/14R-b
4/14R-b
5/14R-b
6/14R-b
7/14R-b
8/14
9/14R-b
10/14R-b
11/14R-b
12/14R-b
13/14R-b
14/14T-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/14] qapi: static typing conversion, pt3

based-on: <[email protected]>
[PATCH 00/16] qapi: static typing conversion, pt2

Hi, this series adds static type hints to the QAPI module. This is part three!

Part 3: https://gitlab.com/jsnow/qemu/-/tree/python-qapi-cleanup-pt3
Everything: https://gitlab.com/jsnow/qemu/-/tree/python-qapi-cleanup-pt6

- Requires Python 3.6+
- Requires mypy 0.770 or newer (for type analysis only)
- Requires pylint 2.6.0 or newer (for lint checking only)

This part of the series focuses on just doc.py ... which, err, Peter Maydell is getting rid of soon. Oh well. This is posted for reference; and simply as context and pre-requisite for later patches.

Type hints are added in patches that add *only* type hints and change no other behavior. Any necessary changes to behavior to accommodate typing are split out into their own tiny patches.

Every commit should pass with:
- flake8 qapi/
- pylint --rcfile=qapi/pylintrc qapi/
- mypy --config-file=qapi/mypy.ini qapi/

John Snow (14):
qapi/doc.py: stash long temporary locals in named locals qapi/doc.py: avoid unnecessary keyword arguments qapi/doc.py: Add assertion on section.member qapi/doc.py: assert correct types in member_func callbacks qapi/doc.py: Assert no suffix given for enum members qapi/doc.py: Add type hint annotations
qapi/doc.py: enable mypy checks
qapi/doc.py: Add generic texi_member callback qapi/doc.py: Remove one-letter variables qapi/gen.py: Add __bool__ dunder method to QAPIGen qapi/doc.py: Don't use private attributes of QAPIGen property qapi/doc.py: Assert tag member is Enum type qapi/doc.py: Assert type of object variant qapi/doc.py: enable pylint checks

 scripts/qapi/doc.py   | 189 ++++++++++++++++++++++++++++--------------
 scripts/qapi/gen.py   |   3 +
 scripts/qapi/mypy.ini |   5 --
 scripts/qapi/pylintrc |   3 +-
 4 files changed, 133 insertions(+), 67 deletions(-)
Signature · 1 line
2.26.2