Bug 2095517 - fedmsg fails to build with Python 3.11: AttributeError: module 'inspect' has no attribute 'getargspec'
Summary: fedmsg fails to build with Python 3.11: AttributeError: module 'inspect' has ...
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Fedora
Classification: Fedora
Component: fedmsg
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Fedora Infrastructure SIG
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 2098702 (view as bug list)
Depends On:
Blocks: PYTHON3.11 F37FTBFS F37FailsToInstall
TreeView+ depends on / blocked
 
Reported: 2022-06-09 20:21 UTC by Miro Hrončok
Modified: 2022-06-20 23:16 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-06-20 23:16:55 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github fedora-infra fedmsg pull 530 0 None open Fix compatiblity with Python 3.11+ 2022-06-09 21:17:48 UTC

Description Miro Hrončok 2022-06-09 20:21:46 UTC
fedmsg fails to build with Python 3.11.0b3.

reading sources... [ 90%] publishing
reading sources... [100%] subscribing

WARNING: autodoc: failed to import module 'fedmsg'; the following exception was raised:
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/sphinx/ext/autodoc/importer.py", line 62, in import_module
    return importlib.import_module(modname)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  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 939, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/builddir/build/BUILD/fedmsg-1.1.2/fedmsg/__init__.py", line 91, in <module>
    @API_function(doc=fedmsg.core.FedMsgContext.publish.__doc__)
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/fedmsg-1.1.2/fedmsg/__init__.py", line 67, in api_function
    scrub = inspect.getargspec(func).args
            ^^^^^^^^^^^^^^^^^^
AttributeError: module 'inspect' has no attribute 'getargspec'


This leads to this error in tests:

E   AttributeError: partially initialized module 'fedmsg' has no attribute 'core' (most likely due to a circular import)



See from https://docs.python.org/3.11/whatsnew/3.11.html#removed

Removed from the inspect module:

    the getargspec function, deprecated since Python 3.0; use inspect.signature() or inspect.getfullargspec() instead.




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

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

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 Miro Hrončok 2022-06-09 21:10:21 UTC
This gets the job done:

sed -i 's/getargspec/getfullargspec/' fedmsg/__init__.py

Comment 2 Miro Hrončok 2022-06-09 21:17:49 UTC
https://github.com/fedora-infra/fedmsg/pull/530

Comment 4 Miro Hrončok 2022-06-20 10:14:40 UTC
*** Bug 2098702 has been marked as a duplicate of this bug. ***

Comment 5 Miro Hrončok 2022-06-20 23:16:55 UTC
Hello,

Please note that this comment was generated automatically. If you feel that this output has mistakes, please contact me via email (mhroncok).

All subpackages of a package against which this bug was filled are now installable or removed from Fedora 37.

Thanks for taking care of it!


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