Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1936945 - python-dbus-next fails to build with Python 3.10: E dbus_next.errors.InvalidSignatureError: got unexpected token: "'"
Summary: python-dbus-next fails to build with Python 3.10: E dbus_next.errors.InvalidS...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: python-dbus-next
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Aleksei Bavshin
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.10
TreeView+ depends on / blocked
 
Reported: 2021-03-09 14:12 UTC by Tomáš Hrnčiar
Modified: 2021-06-04 20:24 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-06-04 20:24:46 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github altdesktop python-dbus-next issues 3 0 None closed Python 4.0 annotation compatibility for high level service 2021-06-04 20:24:45 UTC

Description Tomáš Hrnčiar 2021-03-09 14:12:11 UTC
python-dbus-next fails to build with Python 3.10.0a6.

==================================== ERRORS ====================================
__________________ ERROR collecting test/test_big_message.py ___________________
test/test_big_message.py:10: in <module>
    class ExampleInterface(ServiceInterface):
test/test_big_message.py:15: in ExampleInterface
    def echo_bytes(self, what: 'ay') -> 'ay':
/usr/lib64/python3.10/typing.py:1751: in wrapped_decorator
    func = decorator(*args, **kwds)
dbus_next/service.py:102: in decorator
    wrapped.__dict__['__DBUS_METHOD'] = _Method(fn, fn_name, disabled=disabled)
dbus_next/service.py:38: in __init__
    in_args.append(intr.Arg(param.annotation, intr.ArgDirection.IN, param.name))
dbus_next/introspection.py:43: in __init__
    tree = SignatureTree._get(signature)
dbus_next/signature.py:320: in _get
    SignatureTree._cache[signature] = SignatureTree(signature)
dbus_next/signature.py:332: in __init__
    (type_, signature) = SignatureType._parse_next(signature)
dbus_next/signature.py:65: in _parse_next
    raise InvalidSignatureError(f'got unexpected token: "{token}"')
E   dbus_next.errors.InvalidSignatureError: got unexpected token: "'"
___________________ ERROR collecting test/test_fd_passing.py ___________________
test/test_fd_passing.py:15: in <module>
    class ExampleInterface(ServiceInterface):
test/test_fd_passing.py:21: in ExampleInterface
    def ReturnsFd(self) -> 'h':
/usr/lib64/python3.10/typing.py:1751: in wrapped_decorator
    func = decorator(*args, **kwds)
dbus_next/service.py:102: in decorator
    wrapped.__dict__['__DBUS_METHOD'] = _Method(fn, fn_name, disabled=disabled)
dbus_next/service.py:44: in __init__
    for type_ in SignatureTree._get(inspection.return_annotation).types:
dbus_next/signature.py:320: in _get
    SignatureTree._cache[signature] = SignatureTree(signature)
dbus_next/signature.py:332: in __init__
    (type_, signature) = SignatureType._parse_next(signature)
dbus_next/signature.py:65: in _parse_next
    raise InvalidSignatureError(f'got unexpected token: "{token}"')
E   dbus_next.errors.InvalidSignatureError: got unexpected token: "'"
_________________ ERROR collecting test/client/test_methods.py _________________
test/client/test_methods.py:12: in <module>
    class ExampleInterface(ServiceInterface):
test/client/test_methods.py:21: in ExampleInterface
    def EchoInt64(self, what: 'x') -> 'x':
/usr/lib64/python3.10/typing.py:1751: in wrapped_decorator
    func = decorator(*args, **kwds)
dbus_next/service.py:102: in decorator
    wrapped.__dict__['__DBUS_METHOD'] = _Method(fn, fn_name, disabled=disabled)
dbus_next/service.py:38: in __init__
    in_args.append(intr.Arg(param.annotation, intr.ArgDirection.IN, param.name))
dbus_next/introspection.py:43: in __init__
    tree = SignatureTree._get(signature)
dbus_next/signature.py:320: in _get
    SignatureTree._cache[signature] = SignatureTree(signature)
dbus_next/signature.py:332: in __init__
    (type_, signature) = SignatureType._parse_next(signature)
dbus_next/signature.py:65: in _parse_next
    raise InvalidSignatureError(f'got unexpected token: "{token}"')
E   dbus_next.errors.InvalidSignatureError: got unexpected token: "'"
_______________ ERROR collecting test/client/test_properties.py ________________
test/client/test_properties.py:10: in <module>
    class ExampleInterface(ServiceInterface):
test/client/test_properties.py:19: in ExampleInterface
    def SomeProperty(self) -> 's':
/usr/lib64/python3.10/typing.py:1751: in wrapped_decorator
    func = decorator(*args, **kwds)
dbus_next/service.py:300: in decorator
    return _Property(fn, options=options)
dbus_next/service.py:226: in __init__
    tree = SignatureTree._get(sig.return_annotation)
dbus_next/signature.py:320: in _get
    SignatureTree._cache[signature] = SignatureTree(signature)
dbus_next/signature.py:332: in __init__
    (type_, signature) = SignatureType._parse_next(signature)
dbus_next/signature.py:65: in _parse_next
    raise InvalidSignatureError(f'got unexpected token: "{token}"')
E   dbus_next.errors.InvalidSignatureError: got unexpected token: "'"
_________________ ERROR collecting test/client/test_signals.py _________________
test/client/test_signals.py:10: in <module>
    class ExampleInterface(ServiceInterface):
test/client/test_signals.py:15: in ExampleInterface
    def SomeSignal(self) -> 's':
/usr/lib64/python3.10/typing.py:1751: in wrapped_decorator
    func = decorator(*args, **kwds)
dbus_next/service.py:171: in decorator
    signal = _Signal(fn, fn_name, disabled)
dbus_next/service.py:119: in __init__
    signature_tree = SignatureTree._get(signature)
dbus_next/signature.py:320: in _get
    SignatureTree._cache[signature] = SignatureTree(signature)
dbus_next/signature.py:332: in __init__
    (type_, signature) = SignatureType._parse_next(signature)
dbus_next/signature.py:65: in _parse_next
    raise InvalidSignatureError(f'got unexpected token: "{token}"')
E   dbus_next.errors.InvalidSignatureError: got unexpected token: "'"
_______________ ERROR collecting test/service/test_decorators.py _______________
test/service/test_decorators.py:5: in <module>
    class ExampleInterface(ServiceInterface):
test/service/test_decorators.py:13: in ExampleInterface
    def some_method(self, one: 's', two: 's') -> 's':
/usr/lib64/python3.10/typing.py:1751: in wrapped_decorator
    func = decorator(*args, **kwds)
dbus_next/service.py:102: in decorator
    wrapped.__dict__['__DBUS_METHOD'] = _Method(fn, fn_name, disabled=disabled)
dbus_next/service.py:38: in __init__
    in_args.append(intr.Arg(param.annotation, intr.ArgDirection.IN, param.name))
dbus_next/introspection.py:43: in __init__
    tree = SignatureTree._get(signature)
dbus_next/signature.py:320: in _get
    SignatureTree._cache[signature] = SignatureTree(signature)
dbus_next/signature.py:332: in __init__
    (type_, signature) = SignatureType._parse_next(signature)
dbus_next/signature.py:65: in _parse_next
    raise InvalidSignatureError(f'got unexpected token: "{token}"')
E   dbus_next.errors.InvalidSignatureError: got unexpected token: "'"
________________ ERROR collecting test/service/test_methods.py _________________
test/service/test_methods.py:8: in <module>
    class ExampleInterface(ServiceInterface):
test/service/test_methods.py:13: in ExampleInterface
    def echo(self, what: 's') -> 's':
/usr/lib64/python3.10/typing.py:1751: in wrapped_decorator
    func = decorator(*args, **kwds)
dbus_next/service.py:102: in decorator
    wrapped.__dict__['__DBUS_METHOD'] = _Method(fn, fn_name, disabled=disabled)
dbus_next/service.py:38: in __init__
    in_args.append(intr.Arg(param.annotation, intr.ArgDirection.IN, param.name))
dbus_next/introspection.py:43: in __init__
    tree = SignatureTree._get(signature)
dbus_next/signature.py:320: in _get
    SignatureTree._cache[signature] = SignatureTree(signature)
dbus_next/signature.py:332: in __init__
    (type_, signature) = SignatureType._parse_next(signature)
dbus_next/signature.py:65: in _parse_next
    raise InvalidSignatureError(f'got unexpected token: "{token}"')
E   dbus_next.errors.InvalidSignatureError: got unexpected token: "'"
_______________ ERROR collecting test/service/test_properties.py _______________
test/service/test_properties.py:9: in <module>
    class ExampleInterface(ServiceInterface):
test/service/test_properties.py:19: in ExampleInterface
    def string_prop(self) -> 's':
/usr/lib64/python3.10/typing.py:1751: in wrapped_decorator
    func = decorator(*args, **kwds)
dbus_next/service.py:300: in decorator
    return _Property(fn, options=options)
dbus_next/service.py:226: in __init__
    tree = SignatureTree._get(sig.return_annotation)
dbus_next/signature.py:320: in _get
    SignatureTree._cache[signature] = SignatureTree(signature)
dbus_next/signature.py:332: in __init__
    (type_, signature) = SignatureType._parse_next(signature)
dbus_next/signature.py:65: in _parse_next
    raise InvalidSignatureError(f'got unexpected token: "{token}"')
E   dbus_next.errors.InvalidSignatureError: got unexpected token: "'"
________________ ERROR collecting test/service/test_signals.py _________________
test/service/test_signals.py:11: in <module>
    class ExampleInterface(ServiceInterface):
test/service/test_signals.py:20: in ExampleInterface
    def signal_simple(self) -> 's':
/usr/lib64/python3.10/typing.py:1751: in wrapped_decorator
    func = decorator(*args, **kwds)
dbus_next/service.py:171: in decorator
    signal = _Signal(fn, fn_name, disabled)
dbus_next/service.py:119: in __init__
    signature_tree = SignatureTree._get(signature)
dbus_next/signature.py:320: in _get
    SignatureTree._cache[signature] = SignatureTree(signature)
dbus_next/signature.py:332: in __init__
    (type_, signature) = SignatureType._parse_next(signature)
dbus_next/signature.py:65: in _parse_next
    raise InvalidSignatureError(f'got unexpected token: "{token}"')
E   dbus_next.errors.InvalidSignatureError: got unexpected token: "'"
__________ ERROR collecting test/service/test_standard_interfaces.py ___________
test/service/test_standard_interfaces.py:17: in <module>
    class ExampleComplexInterface(ServiceInterface):
test/service/test_standard_interfaces.py:24: in ExampleComplexInterface
    def Foo(self) -> 'y':
/usr/lib64/python3.10/typing.py:1751: in wrapped_decorator
    func = decorator(*args, **kwds)
dbus_next/service.py:300: in decorator
    return _Property(fn, options=options)
dbus_next/service.py:226: in __init__
    tree = SignatureTree._get(sig.return_annotation)
dbus_next/signature.py:320: in _get
    SignatureTree._cache[signature] = SignatureTree(signature)
dbus_next/signature.py:332: in __init__
    (type_, signature) = SignatureType._parse_next(signature)
dbus_next/signature.py:65: in _parse_next
    raise InvalidSignatureError(f'got unexpected token: "{token}"')
E   dbus_next.errors.InvalidSignatureError: got unexpected token: "'"
=========================== short test summary info ============================
ERROR test/test_big_message.py - dbus_next.errors.InvalidSignatureError: got ...
ERROR test/test_fd_passing.py - dbus_next.errors.InvalidSignatureError: got u...
ERROR test/client/test_methods.py - dbus_next.errors.InvalidSignatureError: g...
ERROR test/client/test_properties.py - dbus_next.errors.InvalidSignatureError...
ERROR test/client/test_signals.py - dbus_next.errors.InvalidSignatureError: g...
ERROR test/service/test_decorators.py - dbus_next.errors.InvalidSignatureErro...
ERROR test/service/test_methods.py - dbus_next.errors.InvalidSignatureError: ...
ERROR test/service/test_properties.py - dbus_next.errors.InvalidSignatureErro...
ERROR test/service/test_signals.py - dbus_next.errors.InvalidSignatureError: ...
ERROR test/service/test_standard_interfaces.py - dbus_next.errors.InvalidSign...
!!!!!!!!!!!!!!!!!!! Interrupted: 10 errors during collection !!!!!!!!!!!!!!!!!!!
============================== 10 errors in 2.19s ==============================

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.10/fedora-rawhide-x86_64/02054480-python-dbus-next/

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

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 Aleksei Bavshin 2021-03-09 17:12:10 UTC
Upstream issue: https://github.com/altdesktop/python-dbus-next/issues/3
The issue is a known incompatibility with postponed evaluation of annotations, which has been enabled by default in 3.10: https://bugs.python.org/issue38605

Comment 2 Tony Crisci 2021-03-22 12:25:00 UTC
The issue has been resolved on the development branch and a fix will be included in the next release. Testing for Python 3.10 has been added to the test suite.

https://github.com/altdesktop/python-dbus-next/commit/7f435955ec3412a10199998a003fbbd75e012bd2

Comment 3 Miro Hrončok 2021-03-22 12:49:56 UTC
Thanks, Tony!

Comment 4 Miro Hrončok 2021-06-04 20:13:57 UTC
This is a mass-posted update. Sorry if it is not 100% accurate to this bugzilla.


The Python 3.10 rebuild is in progress in a Koji side tag. If you manage to fix the problem, please commit the fix in the rawhide branch, but don't build the package in regular rawhide.

You can either build the package in the side tag, with:

    $ fedpkg build --target=f35-python

Or you can the build and we will eventually build it for you.

Note that the rebuild is still in progress, so not all (build) dependencies of this package might be available right away.

Thanks.

See also https://fedoraproject.org/wiki/Changes/Python3.10

If you have general questions about the rebuild, please use this mailing list thread: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/G47SGOYIQLRDTWGOSLSWERZSSHXDEDH5/

Comment 5 Aleksei Bavshin 2021-06-04 20:24:46 UTC
Rawhide build is passing. Close look at https://bugs.python.org/issue38605 confirms that the breaking change was reverted and postponed to at least python 3.11.

I'm going to close the bug as it's already fixed upstream and we'll hopefully see a new release before python 3.11 :)


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