Bug 2022393 - python-wrapt fails to build with Python 3.11: ImportError: cannot import name 'formatargspec' from 'inspect' (/usr/lib64/python3.11/inspect.py)
Summary: python-wrapt fails to build with Python 3.11: ImportError: cannot import name...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-wrapt
Version: 36
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Fedora Infrastructure SIG
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 2061075
Blocks: PYTHON3.11 2026771 2034919 2034943
TreeView+ depends on / blocked
 
Reported: 2021-11-11 14:43 UTC by Tomáš Hrnčiar
Modified: 2022-05-07 04:29 UTC (History)
11 users (show)

Fixed In Version: python-wrapt-1.14.0-1.fc36
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-05-07 04:29:49 UTC
Type: Bug


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github GrahamDumpleton wrapt pull 203 0 None open Use inspect.Signature instead of inspect.formatargspec 2022-02-22 10:40:04 UTC

Description Tomáš Hrnčiar 2021-11-11 14:43:17 UTC
python-wrapt fails to build with Python 3.11.0a2.

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/setuptools/config.py", line 35, in __getattr__
    return next(
           ^^^^^
  File "/usr/lib/python3.11/site-packages/setuptools/config.py", line 36, in <genexpr>
    ast.literal_eval(statement.value)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/ast.py", line 108, in literal_eval
    return _convert(node_or_string)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/ast.py", line 107, in _convert
    return _convert_signed_num(node)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/ast.py", line 81, in _convert_signed_num
    return _convert_num(node)
           ^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/ast.py", line 72, in _convert_num
    _raise_malformed_node(node)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/ast.py", line 69, in _raise_malformed_node
    raise ValueError(msg + f': {node!r}')
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: malformed node or string on line 2: <ast.Call object at 0x7f4b00396c80>

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

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/setuptools/config.py", line 419, in _parse_attr
    return getattr(StaticModule(module_name), attr_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/setuptools/config.py", line 43, in __getattr__
    raise AttributeError(
    ^^^^^^^^^^^^^^^^^^^^^
AttributeError: wrapt has no attribute __version__

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/builddir/build/BUILD/wrapt-1.13.3/setup.py", line 41, in <module>
    setuptools.setup(
    ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/setuptools/__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/distutils/core.py", line 121, in setup
    dist.parse_config_files()
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/setuptools/dist.py", line 798, in parse_config_files
    parse_configuration(
    ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/setuptools/config.py", line 158, in parse_configuration
    meta.parse()
    ^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/setuptools/config.py", line 498, in parse
    section_parser_method(section_options)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/setuptools/config.py", line 469, in parse_section
    self[name] = value
    ~~~~^^^^^^
  File "/usr/lib/python3.11/site-packages/setuptools/config.py", line 222, in __setitem__
    value = parser(value)
            ^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/setuptools/config.py", line 597, in _parse_version
    version = self._parse_attr(value, self.package_dir)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/setuptools/config.py", line 422, in _parse_attr
    module = importlib.import_module(module_name)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 897, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/builddir/build/BUILD/wrapt-1.13.3/src/wrapt/__init__.py", line 10, in <module>
    from .decorators import (adapter_factory, AdapterFactory, decorator,
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/wrapt-1.13.3/src/wrapt/decorators.py", line 34, in <module>
    from inspect import ismethod, isclass, formatargspec
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: cannot import name 'formatargspec' from 'inspect' (/usr/lib64/python3.11/inspect.py)

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/02940920-python-wrapt/

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

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 Ben Cotton 2022-02-08 21:19:25 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 36 development cycle.
Changing version to 36.

Comment 2 Simo Sorce 2022-02-11 17:10:49 UTC
Is there any update on this issue?
Why is it not assigned to a maintainer?

Comment 3 Kevin Fenzi 2022-02-13 21:07:47 UTC
No update, it's not assigned because no one has had time to look into it yet. 

Help welcome.

Comment 4 Zbigniew Jędrzejewski-Szmek 2022-03-26 12:40:00 UTC
This seems to be patches upstream, and the patch is in the latest release. I'll try to update.

Comment 5 Fedora Update System 2022-03-26 17:57:01 UTC
FEDORA-2022-bba9b410c4 has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-bba9b410c4

Comment 6 Fedora Update System 2022-03-27 01:58:44 UTC
FEDORA-2022-bba9b410c4 has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-bba9b410c4`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-bba9b410c4

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 7 Alexander Sosedkin 2022-04-04 18:11:11 UTC
I believe upgrading wrapt to 0.14 broke pylint in return: bz2069837

Comment 8 Fedora Update System 2022-04-22 17:37:01 UTC
FEDORA-2022-5236a62e55 has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-5236a62e55

Comment 9 Fedora Update System 2022-04-23 17:13:44 UTC
FEDORA-2022-5236a62e55 has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-5236a62e55`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-5236a62e55

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 10 Fedora Update System 2022-05-07 04:29:49 UTC
FEDORA-2022-5236a62e55 has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.


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