Skip to content

qapi: static typing conversion, pt2

John Snow qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest16 patches 53 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/16qapi/expr.py: Remove 'info' argument from nested check_if_strscripts/qapi/expr.py+3 -32 replies
2/16qapi/expr.py: Check for dict instead of OrderedDictscripts/qapi/expr.py+3 -32 replies
3/16qapi/expr.py: constrain incoming expression typesscripts/qapi/expr.py+22 -35 replies
4/16qapi/expr.py: Add assertion for union type 'check_dict'scripts/qapi/expr.py+3 -15 replies
5/16qapi/expr.py: move string check upwards in check_typescripts/qapi/expr.py+4 -42 replies
6/16qapi/expr.py: Check type of 'data' memberscripts/qapi/expr.py+7 -04 replies
7/16qapi/expr.py: Add casts in a few select casesscripts/qapi/expr.py+8 -42 replies
8/16qapi/expr.py: add type hint annotationsscripts/qapi/expr.py scripts/qapi/mypy.ini+41 -292 replies
9/16qapi/expr.py: rewrite check_ifscripts/qapi/expr.py+9 -92 replies
10/16qapi/expr.py: Remove single-letter variablescripts/qapi/expr.py+7 -72 replies
11/16qapi/expr.py: enable pylint checksscripts/qapi/pylintrc+0 -12 replies
12/16qapi/expr.py: Add docstringsscripts/qapi/expr.py+155 -24 replies
13/16qapi/expr.py: Modify check_keys to accept any Iterablescripts/qapi/expr.py+3 -32 replies
14/16qapi/expr.py: Use tuples instead of lists for static datascripts/qapi/expr.py+2 -23 replies
15/16qapi/expr.py: move related checks inside check_xxx functionsscripts/qapi/expr.py+33 -223 replies
16/16qapi/expr.py: Use an expression checker dispatch tablescripts/qapi/expr.py+35 -3410 replies

Reviews trailers per patch

All 16 patches have a Reviewed-by or Acked-by.

PatchEduardo HabkostCleber Rosa
1/16R-b R-b
2/16R-b R-b
3/16R-b R-b
4/16R-b R-b
5/16R-b R-b
6/16R-b
7/16R-b R-b
8/16R-b R-b
9/16R-b R-b T-b
10/16R-b R-b
11/16T-b R-b R-b T-b
12/16R-b
13/16R-b R-b
14/16R-b R-b
15/16R-b
16/16R-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/16] qapi: static typing conversion, pt2

based-on: <[email protected]>
[PATCH v2 00/38] qapi: static typing conversion, pt1

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

Part 2: https://gitlab.com/jsnow/qemu/-/tree/python-qapi-cleanup-pt2
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 expr.py.

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 (16):
qapi/expr.py: Remove 'info' argument from nested check_if_str qapi/expr.py: Check for dict instead of OrderedDict qapi/expr.py: constrain incoming expression types qapi/expr.py: Add assertion for union type 'check_dict' qapi/expr.py: move string check upwards in check_type qapi/expr.py: Check type of 'data' member qapi/expr.py: Add casts in a few select cases qapi/expr.py: add type hint annotations qapi/expr.py: rewrite check_if
qapi/expr.py: Remove single-letter variable qapi/expr.py: enable pylint checks
qapi/expr.py: Add docstrings
qapi/expr.py: Modify check_keys to accept any Iterable qapi/expr.py: Use tuples instead of lists for static data qapi/expr.py: move related checks inside check_xxx functions qapi/expr.py: Use an expression checker dispatch table

 scripts/qapi/expr.py  | 440 +++++++++++++++++++++++++++++++-----------
 scripts/qapi/mypy.ini |   5 -
 scripts/qapi/pylintrc |   1 -
 3 files changed, 327 insertions(+), 119 deletions(-)
Signature · 1 line
2.26.2