Bug 2026771 - python-jwcrypto fails to build with Python 3.11: ImportError: cannot import name 'formatargspec' from 'inspect'
Summary: python-jwcrypto fails to build with Python 3.11: ImportError: cannot import n...
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Fedora
Classification: Fedora
Component: python-jwcrypto
Version: 36
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Simo Sorce
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 2022393
Blocks: PYTHON3.11
TreeView+ depends on / blocked
 
Reported: 2021-11-25 19:02 UTC by Tomáš Hrnčiar
Modified: 2022-05-03 08:57 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2022-05-03 08:57:06 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker FREEIPA-7371 0 None None None 2021-11-25 19:03:05 UTC

Description Tomáš Hrnčiar 2021-11-25 19:02:41 UTC
python-jwcrypto fails to build with Python 3.11.0a2.

==================================== ERRORS ====================================
_________________ ERROR collecting jwcrypto/tests-cookbook.py __________________
ImportError while importing test module '/builddir/build/BUILD/jwcrypto-0.9.1/jwcrypto/tests-cookbook.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.11/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
jwcrypto/tests-cookbook.py:5: in <module>
    from jwcrypto import jwe
jwcrypto/jwe.py:10: in <module>
    from jwcrypto.jwa import JWA
jwcrypto/jwa.py:29: in <module>
    from jwcrypto.jwk import JWK
jwcrypto/jwk.py:14: in <module>
    from deprecated import deprecated
/usr/lib/python3.11/site-packages/deprecated/__init__.py:15: in <module>
    from deprecated.classic import deprecated
/usr/lib/python3.11/site-packages/deprecated/classic.py:15: in <module>
    import wrapt
/usr/lib64/python3.11/site-packages/wrapt/__init__.py:10: in <module>
    from .decorators import (adapter_factory, AdapterFactory, decorator,
/usr/lib64/python3.11/site-packages/wrapt/decorators.py:34: in <module>
    from inspect import ismethod, isclass, formatargspec
E   ImportError: cannot import name 'formatargspec' from 'inspect' (/usr/lib64/python3.11/inspect.py)
______________________ ERROR collecting jwcrypto/tests.py ______________________
ImportError while importing test module '/builddir/build/BUILD/jwcrypto-0.9.1/jwcrypto/tests.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.11/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
jwcrypto/tests.py:12: in <module>
    from jwcrypto import jwa
jwcrypto/jwa.py:29: in <module>
    from jwcrypto.jwk import JWK
jwcrypto/jwk.py:14: in <module>
    from deprecated import deprecated
/usr/lib/python3.11/site-packages/deprecated/__init__.py:15: in <module>
    from deprecated.classic import deprecated
/usr/lib/python3.11/site-packages/deprecated/classic.py:15: in <module>
    import wrapt
/usr/lib64/python3.11/site-packages/wrapt/__init__.py:10: in <module>
    from .decorators import (adapter_factory, AdapterFactory, decorator,
/usr/lib64/python3.11/site-packages/wrapt/decorators.py:34: in <module>
    from inspect import ismethod, isclass, formatargspec
E   ImportError: cannot import name 'formatargspec' from 'inspect' (/usr/lib64/python3.11/inspect.py)
=========================== short test summary info ============================
ERROR jwcrypto/tests-cookbook.py
ERROR jwcrypto/tests.py
!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!
============================== 2 errors in 0.27s ===============================

Removed from the inspect module:
    the getargspec function, deprecated since Python 3.0; use inspect.signature() or inspect.getfullargspec() instead.
    the formatargspec function, deprecated since Python 3.5; use the inspect.signature() function and Signature object directly.
    the undocumented Signature.from_callable and Signature.from_function functions, deprecated since Python 3.5; use the Signature.from_callable() method instead.

(Contributed by Hugo van Kemenade in bpo-45320.)

https://bugs.python.org/issue45320
https://docs.python.org/3.11/whatsnew/3.11.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.11/fedora-rawhide-x86_64/02988820-python-jwcrypto/

For all our attempts to build python-jwcrypto with Python 3.11, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/package/python-jwcrypto/

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.11:
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/

Let us know here if you have any questions.

Python 3.11 is planned to be included in Fedora 37. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.11.
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 Christian Heimes 2021-11-25 19:33:26 UTC
The issue will get fixed automatically once a new version of wrapt is available, see rhbz#2022393

Comment 2 Ben Cotton 2022-02-08 21:25:21 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 36 development cycle.
Changing version to 36.

Comment 3 Florence Blanc-Renaud 2022-05-03 08:34:54 UTC
Tomáš,
according to https://copr.fedorainfracloud.org/coprs/g/python/python3.11/package/python-jwcrypto/ it seems that the issue has been fixed with the update of python-wrapt on rawhide. Can we close this BZ as a duplicate or is there any work needed on f36?

Comment 4 Tomáš Hrnčiar 2022-05-03 08:57:06 UTC
Yes, you are correct. Thank you, I am closing this.


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