Bug 1899157 - python-pure-protobuf fails to build with Python 3.10
Summary: python-pure-protobuf fails to build with Python 3.10
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: python-pure-protobuf
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Artem
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.10
TreeView+ depends on / blocked
 
Reported: 2020-11-18 16:02 UTC by Tomáš Hrnčiar
Modified: 2021-02-09 16:18 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug


Attachments (Terms of Use)

Description Tomáš Hrnčiar 2020-11-18 16:02:20 UTC
python-pure-protobuf fails to build with Python 3.10.0a2.

This report is automated and not very verbose, there are many failing tests, see the build logs for more info.

https://copr-be.cloud.fedoraproject.org/results/@python/python3.10/fedora-rawhide-x86_64/01773329-python-pure-protobuf/

For all our attempts to build python-pure-protobuf with Python 3.10, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/package/python-pure-protobuf/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.10:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/

Let us know here if you have any questions.

Python 3.10 will be included in Fedora 35. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.10.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Miro Hrončok 2020-11-18 16:10:48 UTC
________________________ ERROR at setup of test_class_3 ________________________

number = 3, name = 'c', type_ = <function class_1 at 0x7f6e1c07bca0>

    def make_field(number: int, name: str, type_: Any) -> Tuple[int, Field]:
        """
        Figure out how to serialize and de-serialize the field.
        Returns the field number and a corresponding ``Field`` instance.
        """
        is_optional, type_ = get_optional(type_)
        is_repeated, type_ = get_repeated(type_)
    
        if isinstance(type_, type) and issubclass(type_, Message):
            # Embedded message.
            serializer = PackingSerializer(type_.serializer)
        elif isinstance(type_, type) and issubclass(type_, IntEnum):
            # Enumeration.
            # See also: https://developers.google.com/protocol-buffers/docs/proto3#enum
            serializer = IntEnumSerializer(type_)
        else:
            # Predefined type.
            try:
>               serializer = SERIALIZERS[type_]
E               KeyError: <function class_1 at 0x7f6e1c07bca0>

pure_protobuf/dataclasses_.py:150: KeyError

During handling of the above exception, another exception occurred:

cls = <class 'tests.test_serializers.class_3.<locals>.Test3'>

    def message(cls: Type[T]) -> Type[T]:
        """
        Returns the same class as was passed in, with additional dunder attributes needed for
        serialization and deserialization.
        """
    
        type_hints = get_type_hints(cls)
    
        try:
            # Used to list all fields and locate fields by field number.
>           cls.__protobuf_fields__: Dict[int, Field] = dict(
                make_field(field_.metadata['number'], field_.name, type_hints[field_.name])
                for field_ in dataclasses.fields(cls)
            )

pure_protobuf/dataclasses_.py:110: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

.0 = <tuple_iterator object at 0x7f6e1c40a220>

    cls.__protobuf_fields__: Dict[int, Field] = dict(
>       make_field(field_.metadata['number'], field_.name, type_hints[field_.name])
        for field_ in dataclasses.fields(cls)
    )

pure_protobuf/dataclasses_.py:111: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

number = 3, name = 'c', type_ = <function class_1 at 0x7f6e1c07bca0>

    def make_field(number: int, name: str, type_: Any) -> Tuple[int, Field]:
        """
        Figure out how to serialize and de-serialize the field.
        Returns the field number and a corresponding ``Field`` instance.
        """
        is_optional, type_ = get_optional(type_)
        is_repeated, type_ = get_repeated(type_)
    
        if isinstance(type_, type) and issubclass(type_, Message):
            # Embedded message.
            serializer = PackingSerializer(type_.serializer)
        elif isinstance(type_, type) and issubclass(type_, IntEnum):
            # Enumeration.
            # See also: https://developers.google.com/protocol-buffers/docs/proto3#enum
            serializer = IntEnumSerializer(type_)
        else:
            # Predefined type.
            try:
                serializer = SERIALIZERS[type_]
            except KeyError:
                import pure_protobuf.serializers.google  # `dataclasses_` has to already be imported beforehand
>               serializer = pure_protobuf.serializers.google.SERIALIZERS[type_]
E               KeyError: <function class_1 at 0x7f6e1c07bca0>

pure_protobuf/dataclasses_.py:153: KeyError

The above exception was the direct cause of the following exception:

class_1 = <class 'tests.test_serializers.class_1.<locals>.Test1'>

    @fixture
    def class_3(class_1: Type) -> Type:
        @message
        @dataclass
>       class Test3:

tests/test_serializers.py:59: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'tests.test_serializers.class_3.<locals>.Test3'>

    def message(cls: Type[T]) -> Type[T]:
        """
        Returns the same class as was passed in, with additional dunder attributes needed for
        serialization and deserialization.
        """
    
        type_hints = get_type_hints(cls)
    
        try:
            # Used to list all fields and locate fields by field number.
            cls.__protobuf_fields__: Dict[int, Field] = dict(
                make_field(field_.metadata['number'], field_.name, type_hints[field_.name])
                for field_ in dataclasses.fields(cls)
            )
        except KeyError as e:
            # FIXME: catch `KeyError` in `make_field` and re-raise as `TypeError`.
>           raise TypeError(f'type is not serializable: {e}') from e
E           TypeError: type is not serializable: <function class_1 at 0x7f6e1c07bca0>

pure_protobuf/dataclasses_.py:116: TypeError
=================================== FAILURES ===================================
_______________________ test_message_type_error[type_0] ________________________

type_ = typing.Tuple[int, str]

    @mark.parametrize('type_', [
        Tuple[int, str],
    ])
    def test_message_type_error(type_: Any):
        @dataclass
        class Test:
            foo: type_
    
        with raises(TypeError):
>           message(Test)

tests/test_dataclasses.py:59: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pure_protobuf/dataclasses_.py:106: in message
    type_hints = get_type_hints(cls)
/usr/lib64/python3.10/typing.py:1406: in get_type_hints
    value = _eval_type(value, base_globals, localns)
/usr/lib64/python3.10/typing.py:258: in _eval_type
    return t._evaluate(globalns, localns, recursive_guard)
/usr/lib64/python3.10/typing.py:519: in _evaluate
    eval(self.__forward_code__, globalns, localns),
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   NameError: name 'type_' is not defined

<string>:1: NameError
_ test_code_block[\nfrom dataclasses import dataclass\n\nfrom pure_protobuf.dataclasses_ import field, message\nfrom pure_protobuf.types import int32\n\n\n@message\n@dataclass\nclass SearchRequest:\n    query: str = field(1, default='')\n    page_number: int32 = field(2, default=int32(0))\n    result_per_page: int32 = field(3, default=int32(0))\n   \n\nassert SearchRequest(\n    query='hello',\n    page_number=int32(1),\n    result_per_page=int32(10),\n).dumps() == b'\\x0A\\x05hello\\x10\\x01\\x18\\x0A'\n] _

code = "\nfrom dataclasses import dataclass\n\nfrom pure_protobuf.dataclasses_ import field, message\nfrom pure_protobuf.type...lo',\n    page_number=int32(1),\n    result_per_page=int32(10),\n).dumps() == b'\\x0A\\x05hello\\x10\\x01\\x18\\x0A'\n"

    @mark.parametrize('code', code_block_re.findall(readme))
    def test_code_block(code):
>       exec(code, {})  # skipcq: PYL-W0122

tests/test_readme.py:20: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
<string>:10: in <module>
    ???
pure_protobuf/dataclasses_.py:106: in message
    type_hints = get_type_hints(cls)
/usr/lib64/python3.10/typing.py:1406: in get_type_hints
    value = _eval_type(value, base_globals, localns)
/usr/lib64/python3.10/typing.py:258: in _eval_type
    return t._evaluate(globalns, localns, recursive_guard)
/usr/lib64/python3.10/typing.py:519: in _evaluate
    eval(self.__forward_code__, globalns, localns),
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   NameError: name 'int32' is not defined

<string>:1: NameError
_ test_code_block[\nfrom dataclasses import dataclass\nfrom typing import List\n\nfrom pure_protobuf.dataclasses_ import field, message\nfrom pure_protobuf.types import int32\n\n\n@message\n@dataclass\nclass Message:\n    foo: List[int32] = field(1, default_factory=list)\n] _

code = '\nfrom dataclasses import dataclass\nfrom typing import List\n\nfrom pure_protobuf.dataclasses_ import field, message....types import int32\n\n\n@message\n@dataclass\nclass Message:\n    foo: List[int32] = field(1, default_factory=list)\n'

    @mark.parametrize('code', code_block_re.findall(readme))
    def test_code_block(code):
>       exec(code, {})  # skipcq: PYL-W0122

tests/test_readme.py:20: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
<string>:11: in <module>
    ???
pure_protobuf/dataclasses_.py:106: in message
    type_hints = get_type_hints(cls)
/usr/lib64/python3.10/typing.py:1406: in get_type_hints
    value = _eval_type(value, base_globals, localns)
/usr/lib64/python3.10/typing.py:258: in _eval_type
    return t._evaluate(globalns, localns, recursive_guard)
/usr/lib64/python3.10/typing.py:519: in _evaluate
    eval(self.__forward_code__, globalns, localns),
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   NameError: name 'List' is not defined

<string>:1: NameError
_ test_code_block[\nfrom dataclasses import dataclass\nfrom typing import Optional\n\nfrom pure_protobuf.dataclasses_ import field, message\nfrom pure_protobuf.types import int32\n\n\n@message\n@dataclass\nclass Foo:\n    bar: int32 = field(1, default=42)\n    qux: Optional[int32] = field(2, default=None)\n\n\nassert Foo().dumps() == b'\\x08\\x2A'\nassert Foo.loads(b'') == Foo(bar=42)\n] _

code = "\nfrom dataclasses import dataclass\nfrom typing import Optional\n\nfrom pure_protobuf.dataclasses_ import field, mes...nal[int32] = field(2, default=None)\n\n\nassert Foo().dumps() == b'\\x08\\x2A'\nassert Foo.loads(b'') == Foo(bar=42)\n"

    @mark.parametrize('code', code_block_re.findall(readme))
    def test_code_block(code):
>       exec(code, {})  # skipcq: PYL-W0122

tests/test_readme.py:20: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
<string>:11: in <module>
    ???
pure_protobuf/dataclasses_.py:106: in message
    type_hints = get_type_hints(cls)
/usr/lib64/python3.10/typing.py:1406: in get_type_hints
    value = _eval_type(value, base_globals, localns)
/usr/lib64/python3.10/typing.py:258: in _eval_type
    return t._evaluate(globalns, localns, recursive_guard)
/usr/lib64/python3.10/typing.py:519: in _evaluate
    eval(self.__forward_code__, globalns, localns),
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   NameError: name 'int32' is not defined

<string>:1: NameError
_ test_code_block[\nfrom dataclasses import dataclass\nfrom typing import Optional\n\nfrom pure_protobuf.dataclasses_ import optional_field, message\nfrom pure_protobuf.types import int32\n\n\n@message\n@dataclass\nclass Foo:\n    qux: Optional[int32] = optional_field(2)\n\n\nassert Foo().dumps() == b''\nassert Foo.loads(b'') == Foo(qux=None)\n] _

code = "\nfrom dataclasses import dataclass\nfrom typing import Optional\n\nfrom pure_protobuf.dataclasses_ import optional_f...   qux: Optional[int32] = optional_field(2)\n\n\nassert Foo().dumps() == b''\nassert Foo.loads(b'') == Foo(qux=None)\n"

    @mark.parametrize('code', code_block_re.findall(readme))
    def test_code_block(code):
>       exec(code, {})  # skipcq: PYL-W0122

tests/test_readme.py:20: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
<string>:11: in <module>
    ???
pure_protobuf/dataclasses_.py:106: in message
    type_hints = get_type_hints(cls)
/usr/lib64/python3.10/typing.py:1406: in get_type_hints
    value = _eval_type(value, base_globals, localns)
/usr/lib64/python3.10/typing.py:258: in _eval_type
    return t._evaluate(globalns, localns, recursive_guard)
/usr/lib64/python3.10/typing.py:519: in _evaluate
    eval(self.__forward_code__, globalns, localns),
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   NameError: name 'Optional' is not defined

<string>:1: NameError
_ test_code_block[\nfrom dataclasses import dataclass\nfrom enum import IntEnum\n\nfrom pure_protobuf.dataclasses_ import field, message\n\n\nclass TestEnum(IntEnum):\n    BAR = 1\n\n\n@message\n@dataclass\nclass Test:\n    foo: TestEnum = field(1)\n\n\nassert Test(foo=TestEnum.BAR).dumps() == b'\\x08\\x01'\nassert Test.loads(b'\\x08\\x01') == Test(foo=TestEnum.BAR)\n] _

code = "\nfrom dataclasses import dataclass\nfrom enum import IntEnum\n\nfrom pure_protobuf.dataclasses_ import field, messag...\nassert Test(foo=TestEnum.BAR).dumps() == b'\\x08\\x01'\nassert Test.loads(b'\\x08\\x01') == Test(foo=TestEnum.BAR)\n"

    @mark.parametrize('code', code_block_re.findall(readme))
    def test_code_block(code):
>       exec(code, {})  # skipcq: PYL-W0122

tests/test_readme.py:20: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
<string>:14: in <module>
    ???
pure_protobuf/dataclasses_.py:106: in message
    type_hints = get_type_hints(cls)
/usr/lib64/python3.10/typing.py:1406: in get_type_hints
    value = _eval_type(value, base_globals, localns)
/usr/lib64/python3.10/typing.py:258: in _eval_type
    return t._evaluate(globalns, localns, recursive_guard)
/usr/lib64/python3.10/typing.py:519: in _evaluate
    eval(self.__forward_code__, globalns, localns),
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   NameError: name 'TestEnum' is not defined

<string>:1: NameError
_ test_code_block[\nfrom dataclasses import dataclass\n\nfrom pure_protobuf.dataclasses_ import field, message\nfrom pure_protobuf.types import int32\n\n\n@message\n@dataclass\nclass Test1:\n    a: int32 = field(1, default=0)\n\n\n@message\n@dataclass\nclass Test3:\n    c: Test1 = field(3, default_factory=Test1)\n\n\nassert Test3(c=Test1(a=int32(150))).dumps() == b'\\x1A\\x03\\x08\\x96\\x01'\n] _

code = "\nfrom dataclasses import dataclass\n\nfrom pure_protobuf.dataclasses_ import field, message\nfrom pure_protobuf.type...1 = field(3, default_factory=Test1)\n\n\nassert Test3(c=Test1(a=int32(150))).dumps() == b'\\x1A\\x03\\x08\\x96\\x01'\n"

    @mark.parametrize('code', code_block_re.findall(readme))
    def test_code_block(code):
>       exec(code, {})  # skipcq: PYL-W0122

tests/test_readme.py:20: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
<string>:10: in <module>
    ???
pure_protobuf/dataclasses_.py:106: in message
    type_hints = get_type_hints(cls)
/usr/lib64/python3.10/typing.py:1406: in get_type_hints
    value = _eval_type(value, base_globals, localns)
/usr/lib64/python3.10/typing.py:258: in _eval_type
    return t._evaluate(globalns, localns, recursive_guard)
/usr/lib64/python3.10/typing.py:519: in _evaluate
    eval(self.__forward_code__, globalns, localns),
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   NameError: name 'int32' is not defined

<string>:1: NameError
_ test_code_block[\nfrom dataclasses import dataclass\nfrom datetime import datetime\nfrom typing import Optional\n\nfrom pure_protobuf.dataclasses_ import field, message\n\n\n@message\n@dataclass\nclass Test:\n    timestamp: Optional[datetime] = field(1, default=None)\n] _

code = '\nfrom dataclasses import dataclass\nfrom datetime import datetime\nfrom typing import Optional\n\nfrom pure_protobuf...rt field, message\n\n\n@message\n@dataclass\nclass Test:\n    timestamp: Optional[datetime] = field(1, default=None)\n'

    @mark.parametrize('code', code_block_re.findall(readme))
    def test_code_block(code):
>       exec(code, {})  # skipcq: PYL-W0122

tests/test_readme.py:20: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
<string>:11: in <module>
    ???
pure_protobuf/dataclasses_.py:106: in message
    type_hints = get_type_hints(cls)
/usr/lib64/python3.10/typing.py:1406: in get_type_hints
    value = _eval_type(value, base_globals, localns)
/usr/lib64/python3.10/typing.py:258: in _eval_type
    return t._evaluate(globalns, localns, recursive_guard)
/usr/lib64/python3.10/typing.py:519: in _evaluate
    eval(self.__forward_code__, globalns, localns),
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   NameError: name 'Optional' is not defined

<string>:1: NameError
_ test_code_block[\nfrom dataclasses import dataclass\nfrom typing import Any, Optional\n\nfrom pure_protobuf.dataclasses_ import field, message\nfrom pure_protobuf.types.google import Timestamp\n\n\n@message\n@dataclass\nclass Message:\n    value: Optional[Any] = field(1)\n\n\n# Here `Timestamp` is used just as an example, in principle any importable user type works.\nmessage = Message(value=Timestamp(seconds=42))\nassert Message.loads(message.dumps()) == message\n] _

code = '\nfrom dataclasses import dataclass\nfrom typing import Any, Optional\n\nfrom pure_protobuf.dataclasses_ import field...e user type works.\nmessage = Message(value=Timestamp(seconds=42))\nassert Message.loads(message.dumps()) == message\n'

    @mark.parametrize('code', code_block_re.findall(readme))
    def test_code_block(code):
>       exec(code, {})  # skipcq: PYL-W0122

tests/test_readme.py:20: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
<string>:11: in <module>
    ???
pure_protobuf/dataclasses_.py:106: in message
    type_hints = get_type_hints(cls)
/usr/lib64/python3.10/typing.py:1406: in get_type_hints
    value = _eval_type(value, base_globals, localns)
/usr/lib64/python3.10/typing.py:258: in _eval_type
    return t._evaluate(globalns, localns, recursive_guard)
/usr/lib64/python3.10/typing.py:519: in _evaluate
    eval(self.__forward_code__, globalns, localns),
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   NameError: name 'Optional' is not defined

<string>:1: NameError
_____________________ test_merge_repeated_embedded_message _____________________

    def test_merge_repeated_embedded_message():
        # For embedded message fields, the parser merges multiple instances of the same field,
        # as if with the `Message::MergeFrom` method.
        # See also: https://developers.google.com/protocol-buffers/docs/encoding#optional
    
        @message
        @dataclass
        class Inner:
            foo: List[uint] = field(1, default_factory=list)
    
        @message
        @dataclass
>       class Outer:

tests/test_serializers.py:221: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pure_protobuf/dataclasses_.py:106: in message
    type_hints = get_type_hints(cls)
/usr/lib64/python3.10/typing.py:1406: in get_type_hints
    value = _eval_type(value, base_globals, localns)
/usr/lib64/python3.10/typing.py:258: in _eval_type
    return t._evaluate(globalns, localns, recursive_guard)
/usr/lib64/python3.10/typing.py:519: in _evaluate
    eval(self.__forward_code__, globalns, localns),
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   NameError: name 'Inner' is not defined

<string>:1: NameError
__________________________________ test_enum ___________________________________

    def test_enum():
        class TestEnum(IntEnum):
            BAR = 1
    
        @message
        @dataclass
>       class Test:

tests/test_serializers.py:248: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pure_protobuf/dataclasses_.py:106: in message
    type_hints = get_type_hints(cls)
/usr/lib64/python3.10/typing.py:1406: in get_type_hints
    value = _eval_type(value, base_globals, localns)
/usr/lib64/python3.10/typing.py:258: in _eval_type
    return t._evaluate(globalns, localns, recursive_guard)
/usr/lib64/python3.10/typing.py:519: in _evaluate
    eval(self.__forward_code__, globalns, localns),
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   NameError: name 'TestEnum' is not defined

<string>:1: NameError

Comment 2 Ben Cotton 2021-02-09 15:25:52 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 34 development cycle.
Changing version to 34.


Note You need to log in before you can comment on or make changes to this bug.