From: Markus Armbruster <armbru@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, marcandre.lureau@redhat.com,
qemu-rust@nongnu.org, mkletzan@redhat.com
Subject: Re: [PATCH preview 0/3] reviving minimal QAPI generation from 2021
Date: Tue, 17 Jun 2025 09:49:27 +0200 [thread overview]
Message-ID: <875xgu95a0.fsf@pond.sub.org> (raw)
In-Reply-To: <20250605101124.367270-1-pbonzini@redhat.com> (Paolo Bonzini's message of "Thu, 5 Jun 2025 12:11:21 +0200")
pylint isn't happy with the new module:
************* Module qapi.rs_types
scripts/qapi/rs_types.py:286:4: W0237: Parameter 'branches' has been renamed to 'variants' in overriding 'QAPISchemaGenRsTypeVisitor.visit_object_type' method (arguments-renamed)
scripts/qapi/rs_types.py:307:4: W0237: Parameter 'alternatives' has been renamed to 'variants' in overriding 'QAPISchemaGenRsTypeVisitor.visit_alternate_type' method (arguments-renamed)
scripts/qapi/rs_types.py:316:67: W0613: Unused argument 'builtins' (unused-argument)
scripts/qapi/rs_types.py:9:0: W0611: Unused POINTER_SUFFIX imported from common (unused-import)
scripts/qapi/rs_types.py:10:0: W0611: Unused rs_ctype_parse imported from rs (unused-import)
scripts/qapi/rs_types.py:18:0: W0611: Unused QAPISchemaEnumType imported from schema (unused-import)
scripts/qapi/rs_types.py:18:0: W0611: Unused QAPISchemaType imported from schema (unused-import)
Might be too early to bother with the type hints, but here goes anyway:
$ mypy scripts/qapi-gen.py
scripts/qapi/schema.py:70: error: Argument 1 to "rsgen_ifcond" has incompatible type "str | dict[str, object] | None"; expected "str | dict[str, Any]" [arg-type]
scripts/qapi/rs.py:99: error: Incompatible types in assignment (expression has type "str | None", variable has type "dict[str, str]") [assignment]
scripts/qapi/rs.py:103: error: Unsupported left operand type for + ("None") [operator]
scripts/qapi/rs.py:103: note: Left operand is of type "str | None"
scripts/qapi/rs.py:103: error: Incompatible types in assignment (expression has type "str | Any", variable has type "dict[str, str]") [assignment]
scripts/qapi/rs.py:106: error: Incompatible types in assignment (expression has type "str", variable has type "dict[str, str]") [assignment]
scripts/qapi/rs.py:108: error: Incompatible types in assignment (expression has type "str", variable has type "dict[str, str]") [assignment]
scripts/qapi/rs.py:110: error: Incompatible types in assignment (expression has type "str", variable has type "dict[str, str]") [assignment]
scripts/qapi/rs.py:111: error: Incompatible return value type (got "dict[str, str]", expected "str") [return-value]
scripts/qapi/rs_types.py:47: error: Item "None" of "QAPISchemaVariants | None" has no attribute "tag_member" [union-attr]
scripts/qapi/rs_types.py:49: error: Item "None" of "QAPISchemaVariants | None" has no attribute "variants" [union-attr]
scripts/qapi/rs_types.py:84: error: Item "None" of "QAPISchemaVariants | None" has no attribute "variants" [union-attr]
scripts/qapi/rs_types.py:116: error: Incompatible default for argument "exclude" (default has type "None", argument has type "list[str]") [assignment]
scripts/qapi/rs_types.py:116: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
scripts/qapi/rs_types.py:116: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
scripts/qapi/rs_types.py:118: error: Incompatible return value type (got "list[str]", expected "str") [return-value]
scripts/qapi/rs_types.py:251: error: Item "None" of "QAPISchemaVariants | None" has no attribute "variants" [union-attr]
scripts/qapi/rs_types.py:309: error: Argument 2 of "visit_alternate_type" is incompatible with supertype "QAPISchemaVisitor"; supertype defines the argument type as "QAPISourceInfo | None" [override]
scripts/qapi/rs_types.py:309: note: This violates the Liskov substitution principle
scripts/qapi/rs_types.py:309: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
Found 15 errors in 3 files (checked 1 source file)
next prev parent reply other threads:[~2025-06-17 7:49 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-05 10:11 [PATCH preview 0/3] reviving minimal QAPI generation from 2021 Paolo Bonzini
2025-06-05 10:11 ` [PATCH 1/3] rust: make TryFrom macro more resilient Paolo Bonzini
2025-06-10 13:26 ` Marc-André Lureau
2025-06-10 15:52 ` Zhao Liu
2025-06-05 10:11 ` [PATCH 2/3] scripts/qapi: add QAPISchemaIfCond.rsgen() Paolo Bonzini
2025-06-10 13:33 ` Marc-André Lureau
2025-06-05 10:11 ` [PATCH 3/3] scripts/qapi: generate high-level Rust bindings Paolo Bonzini
2025-06-11 8:09 ` Zhao Liu
2025-06-10 13:53 ` [PATCH preview 0/3] reviving minimal QAPI generation from 2021 Marc-André Lureau
2025-06-10 16:10 ` Paolo Bonzini
2025-06-11 8:13 ` Zhao Liu
2025-06-11 8:57 ` Paolo Bonzini
2025-06-12 10:24 ` Paolo Bonzini
2025-06-13 5:57 ` Zhao Liu
2025-06-16 8:55 ` Paolo Bonzini
2025-06-18 14:25 ` Markus Armbruster
2025-06-18 17:36 ` Paolo Bonzini
2025-06-23 12:52 ` Markus Armbruster
2025-07-02 19:09 ` Paolo Bonzini
2025-06-17 7:49 ` Markus Armbruster [this message]
2025-06-18 8:27 ` Paolo Bonzini
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=875xgu95a0.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=mkletzan@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-rust@nongnu.org \
/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 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.