r checking in action. The next commit drops the erroneous
fields.
Signed-off-by: John Snow
---
docs/conf.py | 12
docs/qapi/index.rst| 27 +
docs/sphinx/qapi-domain.py | 59 ++
3 files changed, 98 insertions(+)
diff
t what you want.
Signed-off-by: John Snow
---
docs/qapi/index.rst| 15 +++
docs/sphinx/qapi-domain.py | 14 --
2 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/docs/qapi/index.rst b/docs/qapi/index.rst
index 33b9349a3ee..197587bbc81 100644
--- a
Just to have a bit more to look at in the generated doc, here's a fairly
complex command with a lot of bells and whistles.
Signed-off-by: John Snow
---
docs/qapi/index.rst | 67 +
1 file changed, 67 insertions(+)
diff --git a/docs/qapi/index.rst b
is adapted directly from sphinx.domains.python;
it is unclear to me if there ever would be a collision on merge, hence
the assertion. I haven't been able to trigger it or find better code to
use as a template, so probably I'll just leave the assertion in there.
Signed-off-by: John Snow
---
docs
Hope you like it!
--js
Harmonie Snow (1):
docs/qapi-domain: add CSS styling
John Snow (26):
docs/sphinx: create QAPI domain extension stub
docs/qapi-domain: add qapi:module directive
docs/qapi-module: add QAPI domain object registry
docs/qapi-domain: add QAPI index
docs/qapi-domain: add re
in this series.)
Once again, this code is based very heavily on sphinx.domains.python.
Signed-off-by: John Snow
---
docs/qapi/index.rst| 7 +++
docs/sphinx/qapi-domain.py | 95 +-
2 files changed, 101 insertions(+), 1 deletion(-)
diff --git a/docs/qapi
both the imperative and
indicative forms (:return: and :returns:) to allow doc writers to use
whichever mood "feels right" in the source document. The rendered output
will always use the "Returns:" label, however.
I'm sure you'll let me know how you feel about that. O:-)
Signed-off-b
>
> The command name violates QAPI naming rules: it should be
> query-migration-threads. Too late to fix.
>
> Reported-by: John Snow
> Fixes: 671326201dac (migration: Introduce interface query-migrationthreads)
> Signed-off-by: Markus Armbruster
>
Reviewed-by: John Snow
-
On Fri, Mar 22, 2024, 10:09 AM Markus Armbruster wrote:
> Reported-by: John Snow
> Fixes: 119ebac1feb2 (qapi-schema: use generated marshaller for
> 'qmp_capabilities')
> Signed-off-by: Markus Armbruster
>
Reviewed-by: John Snow
---
> qapi/control.json | 2 --
> 1 file
On Tue, Mar 19, 2024, 12:02 PM Markus Armbruster wrote:
> John Snow writes:
>
> > On Fri, Mar 15, 2024, 11:23 AM Markus Armbruster
> wrote:
> >
> >> Entities with names starting with q_obj_ are implicit object types.
> >> Therefore, QAPISchema._make_
urn typ
> +typ = self.lookup_entity(name)
> +if isinstance(typ, QAPISchemaType):
> +return typ
> + return None
>
> def resolve_type(
> self,
> --
> 2.44.0
>
Sure, dealer's choice.
with your commit message fixup:
Reviewed-by: John Snow
>
Seems obviously fine, though I don't suppose this narrowing will be
"remembered" by the type system. Do we care?
Reviewed-by: John Snow
>
pe to work queue if new
> if typ not in self._used_types:
> self._used_types.append(typ)
> --
> 2.44.0
>
Yeah, if you like this more, go ahead. I know it works because I did it
this way at one point!
Matter of taste and preference etc.
Reviewed-by: John Snow
>
On Fri, Mar 15, 2024, 10:03 AM Markus Armbruster wrote:
> John Snow writes:
>
> > This patch only adds type hints, which aren't utilized at runtime and
> > don't change the behavior of this module in any way.
> >
> > In a scant few locations, type hints are removed
On Thu, Mar 14, 2024, 10:43 AM Markus Armbruster wrote:
> John Snow writes:
>
> > This is *v4*, for some definitions of "version" and "four".
>
> Series
> Reviewed-by: Markus Armbruster
>
> I'll replace PATCH 12, not because it's wrong, just bec
On Thu, Mar 14, 2024, 10:04 AM Markus Armbruster wrote:
> John Snow writes:
>
> > On Thu, Mar 14, 2024, 5:12 AM Markus Armbruster
> wrote:
> >
> >> John Snow writes:
> >>
> >> > Include entities don't have names, but we generally expec
On Thu, Mar 14, 2024, 9:58 AM Markus Armbruster wrote:
> John Snow writes:
>
> > On Thu, Mar 14, 2024, 9:01 AM Markus Armbruster
> wrote:
> >
> >> John Snow writes:
> >>
> >> > Declare, but don't initialize the "members
On Thu, Mar 14, 2024, 9:01 AM Markus Armbruster wrote:
> John Snow writes:
>
> > Declare, but don't initialize the "members" field with type
> > List[QAPISchemaObjectTypeMember].
> >
> > This simplifies the typing from what would otherwise b
On Thu, Mar 14, 2024, 5:12 AM Markus Armbruster wrote:
> John Snow writes:
>
> > Include entities don't have names, but we generally expect "entities" to
> > have names. Reclassify all entities with names as *definitions*, leaving
> > the nameless include enti
On Wed, Mar 13, 2024, 2:57 AM Markus Armbruster wrote:
> John Snow writes:
>
> > On Tue, Feb 20, 2024 at 10:03 AM Markus Armbruster
> wrote:
> >>
> >> John Snow writes:
> >>
> >> > Declare, but don't initialize the "memb
ers expect for properties of an "entity".
Suggested-by: Markus Armbruster
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 144 +++--
1 file changed, 82 insertions(+), 62 deletions(-)
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.
"Optional[QAPISchemaObjectType]") [assignment]
qapi/schema.py:893: error: Incompatible types in assignment (expression
has type "QAPISchemaType", variable has type
"Optional[QAPISchemaObjectType]") [assignment]
A simple change to use a temporary variable helps the med
need string quotes are
changed.
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 568 -
1 file changed, 396 insertions(+), 172 deletions(-)
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index 3b8c2ebbb5f..d2faaea6eac 100644
--- a/scripts
SchemaType = ret
which can be replaced with the simpler:
typ = resolve_type("foo")
Signed-off-by: John Snow
---
scripts/qapi/introspect.py | 4 ++--
scripts/qapi/schema.py | 5 ++---
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/scripts/qapi/introspect.py b/script
l to check()) in order to simplify the static typing
of that field; avoiding the need of assertions littered at many
callsites to eliminate the possibility of the None value.
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 8 +---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/sc
Suggested-by: Markus Armbruster
Signed-off-by: John Snow
---
scripts/qapi/pylintrc | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/scripts/qapi/pylintrc b/scripts/qapi/pylintrc
index 90546df5345..1342412c3cf 100644
--- a/scripts/qapi/pylintrc
+++ b/scripts/qapi
-by: John Snow
---
scripts/qapi/schema.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index 8440a7243d8..c549a4e3bd0 100644
--- a/scripts/qapi/schema.py
+++ b/scripts/qapi/schema.py
@@ -381,7 +381,7 @@ def __init__(self, name
This patch can be rolled in with the previous one once the series is
ready for merge, but for work-in-progress' sake, it's separate here.
Signed-off-by: John Snow
---
scripts/qapi/mypy.ini | 5 -
1 file changed, 5 deletions(-)
diff --git a/scripts/qapi/mypy.ini b/scripts/qapi/mypy.ini
the hump, to enable adding type
hints in a forthcoming commit.
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index 22e065fc13d..d514b3c28f6 100644
--- a/scripts/qapi/schema.py
+++ b/scripts
Optional[str]. mypy does not know that 'info', when it is a
QAPISourceInfo object, cannot ever be false.)
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index 58ec3a7c41c
s enforced at runtime
in QAPISchemaVariants.check(). This relationship is not embedded in the
type system though, so QAPISchemaVariants.check_clash() needs to
re-assert this property in order to call
QAPISchemaVariant.type.check_clash().
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 5 +++
Shhh!
Signed-off-by: John Snow
---
scripts/qapi/parser.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
index fed88e9074d..ec4ebef4e33 100644
--- a/scripts/qapi/parser.py
+++ b/scripts/qapi/parser.py
@@ -607,6 +607,7 @@ class QAPIDoc
With strict typing enabled, these runtime statements aren't necessary
anymore; we can prove them statically.
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 25 -
1 file changed, 25 deletions(-)
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index
This function is a bit hard to type as-is; mypy needs some assertions to
assist with the type narrowing.
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index eeecdda1b58
These methods should always return a str, it's only the default abstract
implementation that doesn't. They can be marked "abstract", which
requires subclasses to override the method with the proper return type.
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 5 -
1 file
strictness
improvements later.
Signed-off-by: John Snow
---
scripts/qapi/parser.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
index ec4ebef4e33..2f3c704fa24 100644
--- a/scripts/qapi/parser.py
+++ b/scripts/qapi/parser.py
@@ -
pty object as an example. For this reason, we cannot use the empty
list as a replacement test for full initialization and instead rely on
the _checked/_check_complete fields.)
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 12 +++-
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git
the typing in quite a few places and avoids
needing to assert that the "tag_member is not None" at a dozen
callsites, which can be confusing and suggest the wrong thing to a
drive-by contributor.
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 22 +++-
api/parser: demote QAPIExpression to Dict[str, Any]'
017/19:[0042] [FC] 'qapi/schema: add type hints'
Mostly contextual changes.
018/19:[] [--] 'qapi/schema: turn on mypy strictness'
019/19:[0006] [FC] 'qapi/schema: remove unnecessary asserts'
Zapped a few more.
John Snow (23):
qapi/
Signed-off-by: John Snow
---
scripts/qapi/parser.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
index 2f3c704fa24..7b13a583ac1 100644
--- a/scripts/qapi/parser.py
+++ b/scripts/qapi/parser.py
@@ -707,6 +707,7 @@ def append_line(self, line
tually use a None value in practice, currently.
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index b157a3b2bd8..f5c7789d98f 100644
--- a/scripts/qapi/schema.py
+++ b/scripts/qapi/schema.py
@@ -99
Small copy-pasto. The correct info field to use in this conditional
block is self.errors.info.
Fixes: 3a025d3d1ffa
Signed-off-by: John Snow
---
scripts/qapi/parser.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
index
/schema.py:657: error: "None" has no attribute "alternate_qtype"
[attr-defined]
qapi/schema.py:662: error: "None" has no attribute "describe" [attr-defined]
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-
With this patch, pylint is happy with the file, so enable it in the
configuration.
Signed-off-by: John Snow
Reviewed-by: Markus Armbruster
---
scripts/qapi/pylintrc | 5 -
scripts/qapi/schema.py | 5 +
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/scripts/qapi
On Tue, Feb 20, 2024 at 10:03 AM Markus Armbruster wrote:
>
> John Snow writes:
>
> > Declare, but don't initialize the "members" field with type
> > List[QAPISchemaObjectTypeMember].
> >
> > This simplifies the typing from what would otherwis
On Tue, Feb 20, 2024 at 10:03 AM Markus Armbruster wrote:
>
> John Snow writes:
>
> > Declare, but don't initialize the "members" field with type
> > List[QAPISchemaObjectTypeMember].
> >
> > This simplifies the typing from what would otherwis
On Tue, Feb 20, 2024 at 8:29 AM Markus Armbruster wrote:
>
> John Snow writes:
>
> > Instead of using the None value for the members field, use a dedicated
> > "checking" value to detect recursive misconfigurations.
> >
> > This is intended to ass
On Tue, Feb 20, 2024 at 10:18 AM Markus Armbruster wrote:
>
> John Snow writes:
>
> > the function lookup_type() is capable of returning None, but some
> > callers aren't prepared for that and assume it will always succeed. For
> > static type analysis purposes, thi
On Tue, Feb 20, 2024 at 5:48 AM Markus Armbruster wrote:
>
> John Snow writes:
>
> > resolve_type() is generally used to resolve configuration-provided type
> > names into type objects, and generally requires valid 'info' and 'what'
> > parame
On Mon, Mar 11, 2024 at 2:14 PM John Snow wrote:
>
> On Tue, Feb 20, 2024 at 5:39 AM Markus Armbruster wrote:
> >
> > John Snow writes:
> >
> > > This function is a bit hard to type as-is; mypy needs some assertions to
> > > assist with the type narro
On Tue, Feb 20, 2024 at 5:39 AM Markus Armbruster wrote:
>
> John Snow writes:
>
> > This function is a bit hard to type as-is; mypy needs some assertions to
> > assist with the type narrowing.
> >
> > Signed-off-by: John Snow
> > ---
> > scripts/q
"Optional[QAPISchemaObjectType]") [assignment]
qapi/schema.py:893: error: Incompatible types in assignment (expression
has type "QAPISchemaType", variable has type
"Optional[QAPISchemaObjectType]") [assignment]
A simple change to use a temporary variable helps the med
pty object as an example. For this reason, we cannot use the empty
list as a replacement test for full initialization and instead rely on
the _checked/_checking fields.)
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 13 +++--
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/sc
These methods should always return a str, it's only the default abstract
implementation that doesn't. They can be marked "abstract", which
requires subclasses to override the method with the proper return type.
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 5 -
1 file
the hump, to enable adding type
hints in a forthcoming commit.
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index ae350f64a8f..d4d3c3bbcee 100644
--- a/scripts/qapi/schema.py
+++ b/scripts
With this patch, pylint is happy with the file, so enable it in the
configuration.
Signed-off-by: John Snow
Reviewed-by: Markus Armbruster
---
scripts/qapi/pylintrc | 5 -
scripts/qapi/schema.py | 5 +
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/scripts/qapi
None value in practice, currently.
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index e617abb03af..573be7275a6 100644
--- a/scripts/qapi/schema.py
+++ b/scripts/qapi/schema.py
@@ -1004,6 +100
This patch can be rolled in with the previous one once the series is
ready for merge, but for work-in-progress' sake, it's separate here.
Signed-off-by: John Snow
---
scripts/qapi/mypy.ini | 5 -
1 file changed, 5 deletions(-)
diff --git a/scripts/qapi/mypy.ini b/scripts/qapi/mypy.ini
/schema.py:657: error: "None" has no attribute "alternate_qtype"
[attr-defined]
qapi/schema.py:662: error: "None" has no attribute "describe" [attr-defined]
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-
the typing in quite a few places and avoids
needing to assert that the "tag_member is not None" at a dozen
callsites, which can be confusing and suggest the wrong thing to a
drive-by contributor.
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 22 +++-
after the final call to check()) in order to simplify static
typing of that field, by avoiding needing assertions littered at many
callsites.
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 13 -
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/scripts/qapi/sche
Suggested-by: Markus Armbruster
Signed-off-by: John Snow
---
scripts/qapi/pylintrc | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/scripts/qapi/pylintrc b/scripts/qapi/pylintrc
index 90546df5345..1342412c3cf 100644
--- a/scripts/qapi/pylintrc
+++ b/scripts/qapi
need string quotes are
changed.
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 572 -
1 file changed, 398 insertions(+), 174 deletions(-)
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index 4d153b216c0..319c8475d21 100644
--- a/scripts
-by: John Snow
---
scripts/qapi/schema.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index 74a32656249..ac34e2781de 100644
--- a/scripts/qapi/schema.py
+++ b/scripts/qapi/schema.py
@@ -389,7 +389,7 @@ def __init__(self, name
With strict typing enabled, these runtime statements aren't necessary
anymore; we can prove them statically.
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 25 -
1 file changed, 25 deletions(-)
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index
ers expect for properties of an "entity".
Suggested-by: Markus Armbruster
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 152 -
1 file changed, 88 insertions(+), 64 deletions(-)
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.
Optional[str]. mypy does not know that 'info', when it is a
QAPISourceInfo object, cannot ever be false.)
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index 074897ee4fb
SchemaType = ret
which can be replaced with the simpler:
typ = resolve_type("foo")
Signed-off-by: John Snow
---
scripts/qapi/introspect.py | 4 ++--
scripts/qapi/schema.py | 5 ++---
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/scripts/qapi/introspect.py b/script
This function is a bit hard to type as-is; mypy needs some assertions to
assist with the type narrowing.
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index 043ee7556e6
s enforced at runtime
in QAPISchemaVariants.check(). This relationship is not embedded in the
type system though, so QAPISchemaVariants.check_clash() needs to
re-assert this property in order to call
QAPISchemaVariant.type.check_clash().
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 5 +++
019/19:[0006] [FC] 'qapi/schema: remove unnecessary asserts'
Zapped a few more.
John Snow (20):
qapi: sort pylint suppressions
qapi/schema: add pylint suppressions
qapi: create QAPISchemaDefinition
qapi/schema: declare type for QAPISchemaObjectTypeMember.type
qapi/schema: declare type for
strictness
improvements later.
Signed-off-by: John Snow
---
scripts/qapi/parser.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
index 48cd55a38cc..422de616a35 100644
--- a/scripts/qapi/parser.py
+++ b/scripts/qapi/parser.py
@@ -
On Thu, Feb 1, 2024 at 4:45 PM John Snow wrote:
>
> On Sat, Jan 20, 2024 at 4:53 AM Markus Armbruster wrote:
> >
> > docs/interop/bitmaps.rst uses references like
> >
> > `qemu-qmp-ref `_
> > `query-block `_
> >
> > to refer to and into
On Sat, Jan 20, 2024 at 4:53 AM Markus Armbruster wrote:
>
> docs/interop/bitmaps.rst uses references like
>
> `qemu-qmp-ref `_
> `query-block `_
>
> to refer to and into docs/interop/qemu-qmp-ref.rst.
>
> Clean up the former: use :doc:`qemu-qmp-ref`.
>
> I don't know how to clean up the
On Wed, Jan 17, 2024 at 5:53 AM Markus Armbruster wrote:
>
> Still more...
>
Would you hate me if I suggested that we punt this to after type
checking is applied? i.e. let's do the stupid @property thing for now,
and we'll rebase this proposal and put it in right afterwards.
(Admittedly, it's
On Wed, Jan 17, 2024 at 9:03 AM Philippe Mathieu-Daudé
wrote:
>
> On 17/1/24 13:10, Thomas Huth wrote:
> > On 17/01/2024 12.24, Philippe Mathieu-Daudé wrote:
> >> Per commits a9dbde71da ("mkvenv: add better error message for
> >> broken or missing ensurepip") and 1dee66c693 ("tests/vm: add
> >>
On Thu, Feb 1, 2024 at 2:41 PM John Snow wrote:
>
> On Tue, Jan 16, 2024 at 9:58 AM Markus Armbruster wrote:
> >
> > John Snow writes:
> >
> > > differentiate between "actively in the process of checking" and
> > > "checking has
On Tue, Jan 16, 2024 at 9:58 AM Markus Armbruster wrote:
>
> John Snow writes:
>
> > differentiate between "actively in the process of checking" and
> > "checking has completed". This allows us to clean up the types of some
> > internal fields suc
On Mon, Jan 22, 2024 at 8:12 AM Markus Armbruster wrote:
>
> John Snow writes:
>
> > On Tue, Jan 16, 2024 at 6:09 AM Markus Armbruster wrote:
> >>
> >> John Snow writes:
> >>
> >> > allow resolve_type to be used for both built-in an
On Mon, Jan 22, 2024 at 8:12 AM Markus Armbruster wrote:
>
> John Snow writes:
>
> > On Tue, Jan 16, 2024 at 6:09 AM Markus Armbruster wrote:
> >>
> >> John Snow writes:
> >>
> >> > allow resolve_type to be used for both built-in an
On Thu, Jan 25, 2024 at 11:09 AM Nicholas Piggin wrote:
>
> The v12 format support for replay-dump has a few issues still. This
> fixes async decoding; adds event, shutdown, and end decoding; fixes
> audio in / out events, fixes checkpoint checking of following async
> events.
>
> Signed-off-by:
On Tue, Jan 16, 2024 at 7:17 AM Markus Armbruster wrote:
>
> John Snow writes:
>
> > Adjust the expression at the callsite to eliminate weak type
> > introspection that believes this value can resolve to QAPISourceInfo; it
> > cannot.
>
> What do you mean by
On Tue, Jan 16, 2024 at 6:09 AM Markus Armbruster wrote:
>
> John Snow writes:
>
> > allow resolve_type to be used for both built-in and user-specified
> > type definitions. In the event that the type cannot be resolved, assert
> > that 'info' and 'what' were both
On Mon, Jan 15, 2024 at 9:03 AM Markus Armbruster wrote:
>
> John Snow writes:
>
> > These methods should always return a str, it's only the default abstract
> > implementation that doesn't. They can be marked "abstract", which
> > requires subclasses t
On Mon, Jan 15, 2024 at 8:59 AM Markus Armbruster wrote:
>
> John Snow writes:
>
> > This field should always be present and defined after check() is
> > called. Declare the property but allow its initialization to be delayed
> > until check() so that it can be typed w
On Mon, Jan 15, 2024 at 8:53 AM Markus Armbruster wrote:
>
> John Snow writes:
>
> > declare, but don't initialize the type of "type" to be QAPISchemaType -
>
> Declare
>
> > and allow the value to be initialized during check(). This crea
On Tue, Jan 16, 2024 at 2:22 AM Markus Armbruster wrote:
>
> John Snow writes:
>
> > On Mon, Jan 15, 2024 at 8:16 AM Markus Armbruster wrote:
> >>
> >> John Snow writes:
> >>
> >> > Include entities don't have names, but we generally
On Mon, Jan 15, 2024 at 8:16 AM Markus Armbruster wrote:
>
> John Snow writes:
>
> > Include entities don't have names, but we generally expect "entities" to
> > have names. Reclassify all entities with names as *definitions*, leaving
> > the nameless
On Mon, Jan 15, 2024 at 7:18 AM Markus Armbruster wrote:
>
> John Snow writes:
>
> > Suggested-by: Markus Armbruster
> > Signed-off-by: John Snow
> > ---
> > scripts/qapi/pylintrc | 6 +++---
> > 1 file changed, 3 insertions(+), 3 deletions(-)
>
this field is accessed
before it is initialized in check(), you'll be treated to an
AttributeError exception.
Fixes stuff like this:
qapi/schema.py:657: error: "None" has no attribute "alternate_qtype"
[attr-defined]
qapi/schema.py:662: error: "None" has no attribute "
strictness
improvements later.
Signed-off-by: John Snow
---
scripts/qapi/parser.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
index bf31018aef0..b7f08cf36f2 100644
--- a/scripts/qapi/parser.py
+++ b/scripts/qapi/parser.py
@@ -
ional".
Signed-off-by: John Snow
Reviewed-by: Philippe Mathieu-Daudé
---
scripts/qapi/schema.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index 43af756ed47..eefa58a798b 100644
--- a/scripts/qapi/schema.py
+++ b/scripts/qapi/schema.py
With strict typing enabled, these runtime statements aren't necessary
anymore; we can prove them statically.
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 27 ---
1 file changed, 27 deletions(-)
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index
rn on mypy strictness'
019/19:[0006] [FC] 'qapi/schema: remove unnecessary asserts'
Zapped a few more.
John Snow (19):
qapi: sort pylint suppressions
qapi/schema: add pylint suppressions
qapi: create QAPISchemaDefinition
qapi/schema: declare type for QAPISchemaObjectTyp
at multiple callsites; the overwhelming majority of uses assume
a fully-initialized object.
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index 48a51dcd188..e45d9545eda 100644
the typing in quite a few places and avoids
needing to assert that the "tag_member is not None" at a dozen
callsites, which can be confusing and suggest the wrong thing to a
drive-by contributor.
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 22 +++-
lookup_type() is capable of returning None, but some callers aren't
prepared for that and assume it will always succeed.
Use the must-not-fail variant resolve_type() instead, which guarantees
that the return type will not be None.
Signed-off-by: John Snow
---
scripts/qapi/introspect.py | 4
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index 66a78f28fd4..a77b51d1b96 100644
--- a/scripts/qapi/schema.py
+++ b/scripts/qapi/schema.py
@@ -1001,9 +1001,10 @@ def lookup
This patch can be rolled in with the previous one once the series is
ready for merge, but for work-in-progress' sake, it's separate here.
Signed-off-by: John Snow
---
scripts/qapi/mypy.ini | 5 -
1 file changed, 5 deletions(-)
diff --git a/scripts/qapi/mypy.ini b/scripts/qapi/mypy.ini
Adjust the expression at the callsite to eliminate weak type
introspection that believes this value can resolve to QAPISourceInfo; it
cannot.
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/qapi/schema.py b/scripts
101 - 200 of 10727 matches
Mail list logo