libcint fails to build in Fedora 39 and rawhide due to a bug in numpy: 2: Test command: /usr/bin/python3.12 "/builddir/build/BUILD/libcint-5.5.0/testsuite/test_3c2e.py" "--quick" 2: Working Directory: /builddir/build/BUILD/libcint-5.5.0/x86_64-redhat-linux-gnu 2: Test timeout computed to be: 10000000 2: Traceback (most recent call last): 2: File "/builddir/build/BUILD/libcint-5.5.0/testsuite/test_3c2e.py", line 16, in <module> 2: _cint = numpy.ctypeslib.load_library('libcint', '.') 2: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2: File "/usr/lib64/python3.12/site-packages/numpy/ctypeslib.py", line 137, in load_library 2: from numpy.distutils.misc_util import get_shared_lib_extension 2: File "/usr/lib64/python3.12/site-packages/numpy/distutils/__init__.py", line 26, in <module> 2: from . import ccompiler 2: File "/usr/lib64/python3.12/site-packages/numpy/distutils/ccompiler.py", line 8, in <module> 2: from distutils import ccompiler 2: ModuleNotFoundError: No module named 'distutils' 2/2 Test #2: cint3c2etest .....................***Failed 0.17 sec This error is caused by the removal of distutils in Python 3.12; numpy is therefore not Python 3.12 compatible.
Note that `numpy.distutils` is removed in numpy 1.26 (not yet packaged) on Python 3.12. That is also the first numpy release to *officially* support Python 3.12. https://numpy.org/doc/stable/reference/distutils_status_migration.html#distutils-status-migration For now, with numpy 1.24.4, this can be fixed by adding a runtime dependency on setuptools to numpy, since setuptools vendors distutils and provides it for external use. (Adding BuildRequires: %{py3_dist setuptools}) to libcint would also work, but doesn’t seem to be the right approach since this might affect other packages.)
https://src.fedoraproject.org/rpms/numpy/pull-request/36
FEDORA-2023-e1b5f14c24 has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-e1b5f14c24
FEDORA-2023-e1b5f14c24 has been pushed to the Fedora 39 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-e1b5f14c24` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-e1b5f14c24 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
I've stopped the Fedora 39 update. I am afraid this will break more things than it is fixing. Dependent packages are failing to build in Rawhide (opencv, scipy, ...). https://koschei.fedoraproject.org/affected-by/python3-numpy?epoch1=1&version1=1.24.4&release1=2.fc39&epoch2=1&version2=1.26.0&release2=1.fc40&collection=f40
I'm surprised, I did some testing in a copr and it seemed to fix more than it broke.
Backporting this commit should fix the immediate problem as reported by this bugzilla: https://github.com/numpy/numpy/commit/00f633b8579878fa058586e3e412a5d0f82027a1 To clarify when I said "more things" I did not necessarily mean "more packages" but rather the amount of work needed to solve a problem. With 1.24 installing setuptools should fix the problem of missing distutils. With 1.26 there is no way to solve missing numpy.distutils easily.
See also https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/RBFO44RPUOH5GQV4FYUTW6373RHDNXXJ/
At this point of the Fedora 39 release, all numpy-dependent Python packages were either rebuilt successfully or are on their way to a farm upstate. If we make this update, we are forcing several of them to upgrade on very short notice, possibly introducing even more backward-incompatible changes for their dependents. The Final Freeze starts in less than 4 days. My opinion is: Leave Fedora 39 on numpy 1.24, and backport patches if needed (like the one linked above).
Hi, After read this bug report, I checked numpy dependencies and we have 362 packages that depends on numpy, reported by find_unblocked_orphans.py script . Removing numpy.distutils and for distutils now we need install python3-setuptools, it can have impact or not, I don't know . But this combination confuse me , on python mass-rebuild a saw a few packages with the warning "distutils it will be removed for Python 3.12" , now I think is "just" numpy.distutils that is removed. On other hand , I already found a fix for package opencv , turn out it was just in detection of numpy that opencv needs numpy.distutils [1]. I also check VirtualBox-server and still builds on rawhide normally with the same warning: /builddir/build/BUILD/VirtualBox-7.0.10/src/libs/xpcom18a4/python/gen_python_deps.py:123: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. [1] https://src.fedoraproject.org/rpms/opencv/blob/fb8443873603132bda5fa8869d067291f1a2dbfc/f/numpy.distutils_removal.patch
Sergio, - distutils was removed from Python 3.12 since almost the very beginning - python3-setuptools provides its own (forked) distutils module -- many Fedora packages depending on distutils were fixed just by adding BuildRequires: python3-setuptools - numpy.distutils (depends on distutils, either the one from Python or the one from setuptools) was removed form NumPy 1.26 Hope this explains things. If you see: ModuleNotFoundError: No module named 'distutils' Install python3-setuptools. If you see: ModuleNotFoundError: No module named 'numpy.distutils' No idea what to do.
(In reply to Miro Hrončok from comment #11) > Sergio, > > - distutils was removed from Python 3.12 since almost the very beginning > - python3-setuptools provides its own (forked) distutils module -- many > Fedora packages depending on distutils were fixed just by adding > BuildRequires: python3-setuptools Yes, but is this a fix or a "fix", i.e. a hotfix masking the original problem that packages should migrate away from *any* distutils? > - numpy.distutils (depends on distutils, either the one from Python or the > one from setuptools) was removed form NumPy 1.26 > It's unfortunate that we didn't have numpy 1.26 during the py 3.12 mass rebuild (due to numpy's release date). For example, current pandas requires numpy<2,>=1.26.0. Do you consider numpy 1.26 (i.e. a numpy without numpy.distutils) fair game for a F39 update, or should we expect to live with 1.24 for the F39 cycle (and use pip/whatnot)?
(In reply to Michael J Gruber from comment #12) > Yes, but is this a fix or a "fix", i.e. a hotfix masking the original > problem that packages should migrate away from *any* distutils? I would call it a “fix” rather than a fix, but there are a few projects that have so heavily extended distutils (in ways that don’t map trivially to setuptools) that migrating away is a major project rather than a quick PR. It’s a good idea to at least suggest the idea upstream, though.
> Do you consider numpy 1.26 (i.e. a numpy without numpy.distutils) fair game for a F39 update... I don't.
I have to admit that maybe is my fault, when I needed to rebuilt opencv in last minute before F39 Release , I confused missing python3-setuptools with missing numpy.distutils . In my point of view we should consider numpy 1.26 on F39. And why not rebuild the 362 packages that depends on numpy ?
Besides numpy.distutils going away, the list of breaking changes since numpy 1.24.4 is long: https://numpy.org/doc/stable/release/1.25.0-notes.html#expired-deprecations That’s a lot to cope with in post-release updates.
Fedora Linux 39 entered end-of-life (EOL) status on 2024-11-26. Fedora Linux 39 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora Linux please feel free to reopen this bug against that version. Note that the version field may be hidden. Click the "Show advanced fields" button if you do not see the version field. If you are unable to reopen this bug, please file a new report against an active release. Thank you for reporting this bug and we are sorry it could not be fixed.