Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CI errors #532

Merged
merged 1 commit into from
Oct 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions aas_core_codegen/protobuf/common.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"""Provide common functions shared among different ProtoBuf code generation modules."""

import re
from typing import List, cast, Optional
from typing import List, cast

from icontract import ensure, require

from aas_core_codegen import intermediate
from aas_core_codegen.common import Stripped, assert_never
from aas_core_codegen.common import Stripped, assert_never, Identifier
from aas_core_codegen.protobuf import naming as proto_naming


Expand Down Expand Up @@ -147,7 +147,7 @@ def generate_type(type_annotation: intermediate.TypeAnnotationUnion) -> Stripped
# We have to add the suffix ``_choice`` since this field points
# to one of the concrete descendants of the class as well as
# the concrete class itself.
message_name += "_choice"
message_name = Identifier(message_name + "_choice")

return Stripped(message_name)

Expand Down
6 changes: 1 addition & 5 deletions aas_core_codegen/protobuf/structure/_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@
Tuple,
cast,
Union,
Set,
)

from icontract import ensure, require

from aas_core_codegen import intermediate
from aas_core_codegen import specific_implementations
from aas_core_codegen.common import (
Error,
Identifier,
Expand Down Expand Up @@ -403,7 +401,7 @@ def _generate_choice_class(cls: intermediate.ClassUnion) -> Stripped:
# Protocol Buffers do not support inheritance, so we have to work around that
# circumstance.

message_name = proto_naming.class_name(cls.name) + "_choice"
message_name = Identifier(proto_naming.class_name(cls.name) + "_choice")

else:
assert_never(cls)
Expand Down Expand Up @@ -440,8 +438,6 @@ def generate(

errors = [] # type: List[Error]

required_choice_objects = set([]) # type: Set[intermediate.AbstractClass]

for our_type in symbol_table.our_types:
if not isinstance(
our_type,
Expand Down
Loading