Describe the bug
I have been trying to get some f2py code working that I last had working with python 3.10.11 and numpy 1.23.5. I have hit the error below, with a new environment that is built with python 3.13.5 and numpy 2.2.6, this new environment was built adding meson=1.8.2 as an added dependency.
To Reproduce
This is the full example of the issue:
(cmor3110xcd091) machine user$ f2py -c --help-fcompiler
Cannot use distutils backend with Python>=3.12, using meson backend instead.
Using meson backend
Will pass --lower to f2py
See https://numpy.org/doc/stable/f2py/buildtools/meson.html
Reading fortran codes...
Post-processing...
Applying post-processing hooks...
character_backward_compatibility_hook
Post-processing (stage 2)...
Building modules...
The Meson build system
Version: 1.8.2
Source dir: /private/var/folders/7d/rkhc67xs5w70chjmlrr6pv440017ch/T/tmpu9xikcek
Build dir: /private/var/folders/7d/rkhc67xs5w70chjmlrr6pv440017ch/T/tmpu9xikcek/bbdir
Build type: native build
meson.build:40:0: ERROR: Expecting rbracket got comma.
,
^
For a block that started at 39,21
[
^
A full log can be found at /private/var/folders/7d/rkhc67xs5w70chjmlrr6pv440017ch/T/tmpu9xikcek/bbdir/meson-logs/meson-log.txt
Traceback (most recent call last):
File "~/miniforge3/envs/cmor3110xcd091/bin/f2py", line 10, in <module>
sys.exit(main())
~~~~^^
File "~/miniforge3/envs/cmor3110xcd091/lib/python3.13/site-packages/numpy/f2py/f2py2e.py", line 781, in main
run_compile()
~~~~~~~~~~~^^
File "~/miniforge3/envs/cmor3110xcd091/lib/python3.13/site-packages/numpy/f2py/f2py2e.py", line 753, in run_compile
builder.compile()
~~~~~~~~~~~~~~~^^
File "~/miniforge3/envs/cmor3110xcd091/lib/python3.13/site-packages/numpy/f2py/_backends/_meson.py", line 192, in compile
self.run_meson(self.build_dir)
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
File "~/miniforge3/envs/cmor3110xcd091/lib/python3.13/site-packages/numpy/f2py/_backends/_meson.py", line 185, in run_meson
self._run_subprocess_command(setup_command, build_dir)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
File "~/miniforge3/envs/cmor3110xcd091/lib/python3.13/site-packages/numpy/f2py/_backends/_meson.py", line 181, in _run_subprocess_command
subprocess.run(command, cwd=cwd, check=True)
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "~/miniforge3/envs/cmor3110xcd091/lib/python3.13/subprocess.py", line 577, in run
raise CalledProcessError(retcode, process.args,
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['meson', 'setup', 'bbdir']' returned non-zero exit status 1.
Expected behavior
I had expected this simple query to work without an issue
system parameters
-
Is this a cross build or just a plain native build (for the same computer)?
This is a conda-forge built library, installed using mamba/Miniforge3.
-
what operating system (e.g. MacOS Catalina, Windows 10, CentOS 8.0, Ubuntu 18.04, etc.)
macOS 15.5; 'uname': uname_result(system='Darwin', node='ml-9953350', release='24.5.0', version='Darwin Kernel Version 24.5.0: Tue Apr 22 19:54:49 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T6000', machine='arm64')}
-
what Python version are you using e.g. 3.8.0
3.13.5
-
what meson --version
1.8.2
-
what ninja --version if it's a Ninja build
$ ninja --version
1.13.1
Describe the bug
I have been trying to get some
f2pycode working that I last had working with python 3.10.11 and numpy 1.23.5. I have hit the error below, with a new environment that is built with python 3.13.5 and numpy 2.2.6, this new environment was built addingmeson=1.8.2as an added dependency.To Reproduce
This is the full example of the issue:
Expected behavior
I had expected this simple query to work without an issue
system parameters
Is this a cross build or just a plain native build (for the same computer)?
This is a conda-forge built library, installed using mamba/Miniforge3.what operating system (e.g. MacOS Catalina, Windows 10, CentOS 8.0, Ubuntu 18.04, etc.)
macOS 15.5; 'uname': uname_result(system='Darwin', node='ml-9953350', release='24.5.0', version='Darwin Kernel Version 24.5.0: Tue Apr 22 19:54:49 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T6000', machine='arm64')}what Python version are you using e.g. 3.8.0
3.13.5what
meson --version1.8.2what
ninja --versionif it's a Ninja build$ ninja --version1.13.1