Bug 1792793 - pyudev fails to import on Python 3.9: imports abc from collections
Summary: pyudev fails to import on Python 3.9: imports abc from collections
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: lvm2
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Marian Csontos
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 1772058
Blocks: PYTHON39
TreeView+ depends on / blocked
 
Reported: 2020-01-20 01:05 UTC by Miro Hrončok
Modified: 2020-02-24 08:15 UTC (History)
22 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-02-18 09:58:37 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Miro Hrončok 2020-01-20 01:05:06 UTC
lvm2 fails to build with Python 3.9.0a2.

checking for python3-config... /usr/bin/python3-config
checking python3 module: pyudev... no
configure: error: failed to find required module pyudev

python3-pyudev is installed.

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.9/fedora-rawhide-x86_64/01160709-lvm2/

For all our attempts to build lvm2 with Python 3.9, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.9/package/lvm2/

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

Let us know here if you have any questions.

Python 3.9 will be included in Fedora 33. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.9.
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 Marian Csontos 2020-01-23 10:05:30 UTC
Note to myself: the ./configure need to be rebuilt, to recognize python-3.9 I think. New build will follow soon

Comment 2 Marian Csontos 2020-01-24 08:58:48 UTC
TL;DR: Looks like there may be an error in pyudev. The configure runs `/usr/bin/python3 -c "import pyudev"` and that is failing. If you have env to check that out, try that please, I will try myself.

I checked the logs, and correct python-3.9 from copr IS installed and the same for python3-pyudev, so there must be something else going on...

    DEBUG util.py:598:  ================================================================================
    DEBUG util.py:598:   Package                         ArchVersion                 Repository                                                    Size
    DEBUG util.py:598:  ================================================================================
    DEBUG util.py:598:  Installing:
    ...
    DEBUG util.py:598:   python3-pyudev                  noarch0.21.0-13.fc32          copr_base                                                     77 k
    ...
    DEBUG util.py:598:  Installing dependencies:
    DEBUG util.py:598:   python-pip-wheel                noarch19.3.1-2.fc32           copr_base                                                     1.2 M
    DEBUG util.py:598:   python-setuptools-wheel         noarch41.6.0-2.fc32           copr_base                                                     282 k
    DEBUG util.py:598:   python3                         x86_643.9.0~a2-1.fc32         copr_base                                                     25 k

The configure script output show python 3.9 is used:

    checking for python3... /usr/bin/python3
    checking for python3 version... 3.9
    checking for python3 platform... linux
    checking for python3 script directory... ${prefix}/lib/python3.9/site-packages
    checking for python3 extension module directory... ${exec_prefix}/lib64/python3.9/site-packages
    checking for x86_64-redhat-linux-gnu-python3-config... no
    checking for python3-config... /usr/bin/python3-config
    checking python3 module: pyudev... no

This runs the above `/usr/bin/python3 -c "import pyudev"` which is failing. configure is hiding errors, so I have no output

Comment 3 Miro Hrončok 2020-01-24 13:34:46 UTC
<mock-chroot> sh-5.0# /usr/bin/python3 -c "import pyudev"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.9/site-packages/pyudev/__init__.py", line 43, in <module>
    from pyudev.device import Attributes
  File "/usr/lib/python3.9/site-packages/pyudev/device/__init__.py", line 28, in <module>
    from ._device import Attributes
  File "/usr/lib/python3.9/site-packages/pyudev/device/_device.py", line 35, in <module>
    from collections import Container
ImportError: cannot import name 'Container' from 'collections' (/usr/lib64/python3.9/collections/__init__.py)





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

"The abstract base classes in collections.abc no longer are exposed in the regular collections module. This will help create a clearer distinction between the concrete classes and the abstract base classes."

Comment 4 mulhern 2020-01-24 15:10:48 UTC
This is already fixed upstream. I will release an upstream version of pyudev shortly. Once that is completed the pyudev Fedora maintainer can simply cut a new release and all should be well.

Comment 5 Ben Cotton 2020-02-11 17:26:10 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 32 development cycle.
Changing version to 32.

Comment 6 Marian Csontos 2020-02-18 09:58:37 UTC
I see lvm2 builds fine with updated pyudev. Closing


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