Bug 2260318

Summary: python-scikit-misc fails to build with Python 3.13: ERROR: Command `/usr/bin/python3 -c 'import os os.chdir(os.path.join("..", "tools")) failed with status 1.
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: python-scikit-miscAssignee: Sandro <gui1ty>
Status: CLOSED ERRATA QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: code, gui1ty, ksurma, mhroncok, neuro-sig, python-packagers-sig
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-scikit-misc-0.3.1-6.fc41 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-03-25 14:30:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2244836    
Attachments:
Description Flags
Python 3.12 build.log
none
Python 3.13 build.log none

Description Karolina Surma 2024-01-25 09:08:29 UTC
python-scikit-misc fails to build with Python 3.13.03.

../skmisc/meson.build:22:15: ERROR: Command `/usr/bin/python3 -c 'import os
  os.chdir(os.path.join("..", "tools"))
  import numpy as np
  try:
    incdir = os.path.relpath(np.get_include())
  except Exception:
    incdir = np.get_include()
  print(incdir)
  '` failed with status 1.


https://docs.python.org/3.13/whatsnew/3.13.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.13/fedora-rawhide-x86_64/06947650-python-scikit-misc/

For all our attempts to build python-scikit-misc with Python 3.13, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/package/python-scikit-misc/

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

Let us know here if you have any questions.

Python 3.13 is planned to be included in Fedora 41.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.13.
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 Aoife Moloney 2024-02-15 23:12:11 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 40 development cycle.
Changing version to 40.

Comment 2 Sandro 2024-03-07 17:07:37 UTC
Thanks. I reported this upstream for now. I will also try and see if I can come up with a patch myself.

Comment 3 Sandro 2024-03-23 18:57:51 UTC
This turns out to be an issue with python-meson-python behaving differently when using Python 3.13.

The build.log contains above error, but it doesn't actually tell what is going on when the python code snippet is executed. Executing the same snippet in the mock chroot, the error turns out to be:

Traceback (most recent call last):
  File "<string>", line 3, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

I can solve the issue by simply listing numpy as a build dependency. However, up until now, that was not needed. It was determined dynamically somehow.

Another thing I noticed. Just below the error, the build.log contains:

A full log can be found at /builddir/build/BUILD/scikit-misc-0.3.1/.mesonpy-k1ili086/meson-logs/meson-log.txt

That file is nowhere to be found in the mock chroot.

So, there are two issues here:

1) meson-python-meson behaves differently using Python 3.13

2) Error handling should be improved

  a) Show all output in console
  b) Make sure mentioned log files are actually available

Comment 4 Sandro 2024-03-23 19:00:05 UTC
Created attachment 2023259 [details]
Python 3.12 build.log

Comment 5 Sandro 2024-03-23 19:00:54 UTC
Created attachment 2023260 [details]
Python 3.13 build.log

Comment 6 Sandro 2024-03-25 13:26:39 UTC
*** Bug 2271403 has been marked as a duplicate of this bug. ***

Comment 7 Sandro 2024-03-25 14:12:48 UTC
We've found the issue. It was a few lines further down in `pyproject.toml`.

Comment 8 Fedora Update System 2024-03-25 14:26:36 UTC
FEDORA-2024-0fefba2c32 (python-scikit-misc-0.3.1-6.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-0fefba2c32

Comment 9 Fedora Update System 2024-03-25 14:30:29 UTC
FEDORA-2024-0fefba2c32 (python-scikit-misc-0.3.1-6.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.