[PATCH] qapi/parser: Drop two bad type hints for now

Markus Armbruster posted 1 patch 11 months, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20230517061600.1782455-1-armbru@redhat.com
Maintainers: Markus Armbruster <armbru@redhat.com>, Michael Roth <michael.roth@amd.com>
There is a newer version of this series
scripts/qapi/parser.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH] qapi/parser: Drop two bad type hints for now
Posted by Markus Armbruster 11 months, 2 weeks ago
Two type hints fail centos-stream-8-x86_64 CI.  They are actually
broken.  Changing them to Optional[re.Match[str]] fixes them locally
for me, but then CI fails differently.  Drop them for now.

Fixes: 3e32dca3f0d1 (qapi: Rewrite parsing of doc comment section symbols and tags)
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 scripts/qapi/parser.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
index 4923a59d60..1ff334e6a8 100644
--- a/scripts/qapi/parser.py
+++ b/scripts/qapi/parser.py
@@ -563,11 +563,11 @@ def end_comment(self) -> None:
         self._switch_section(QAPIDoc.NullSection(self._parser))
 
     @staticmethod
-    def _match_at_name_colon(string: str) -> re.Match:
+    def _match_at_name_colon(string: str):
         return re.match(r'@([^:]*): *', string)
 
     @staticmethod
-    def _match_section_tag(string: str) -> re.Match:
+    def _match_section_tag(string: str):
         return re.match(r'(Returns|Since|Notes?|Examples?|TODO): *', string)
 
     def _append_body_line(self, line: str) -> None:
-- 
2.39.2
Re: [PATCH] qapi/parser: Drop two bad type hints for now
Posted by Igor Mammedov 11 months, 2 weeks ago
On Wed, 17 May 2023 08:16:00 +0200
Markus Armbruster <armbru@redhat.com> wrote:

> Two type hints fail centos-stream-8-x86_64 CI.  They are actually
> broken.  Changing them to Optional[re.Match[str]] fixes them locally
> for me, but then CI fails differently.  Drop them for now.
> 
> Fixes: 3e32dca3f0d1 (qapi: Rewrite parsing of doc comment section symbols and tags)
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Fixes build failure for me on RHEL8

Tested-by: Igor Mammedov <imammedo@redhat.com>

> ---
>  scripts/qapi/parser.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
> index 4923a59d60..1ff334e6a8 100644
> --- a/scripts/qapi/parser.py
> +++ b/scripts/qapi/parser.py
> @@ -563,11 +563,11 @@ def end_comment(self) -> None:
>          self._switch_section(QAPIDoc.NullSection(self._parser))
>  
>      @staticmethod
> -    def _match_at_name_colon(string: str) -> re.Match:
> +    def _match_at_name_colon(string: str):
>          return re.match(r'@([^:]*): *', string)
>  
>      @staticmethod
> -    def _match_section_tag(string: str) -> re.Match:
> +    def _match_section_tag(string: str):
>          return re.match(r'(Returns|Since|Notes?|Examples?|TODO): *', string)
>  
>      def _append_body_line(self, line: str) -> None:
Re: [PATCH] qapi/parser: Drop two bad type hints for now
Posted by Richard Henderson 11 months, 2 weeks ago
On 5/16/23 23:16, Markus Armbruster wrote:
> Two type hints fail centos-stream-8-x86_64 CI.  They are actually
> broken.  Changing them to Optional[re.Match[str]] fixes them locally
> for me, but then CI fails differently.  Drop them for now.
> 
> Fixes: 3e32dca3f0d1 (qapi: Rewrite parsing of doc comment section symbols and tags)
> Signed-off-by: Markus Armbruster<armbru@redhat.com>
> ---
>   scripts/qapi/parser.py | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~