Subject: bug#62781: [pyproject-build-system] build failure when using mesonpy pep 517 builder

From: Maxim Cournoyer <[email-masked]>
Date: Tue, 11 Apr 2023 16:50:21 -0400

Hi,

Attempting to update python-scipy on the core-updates branch, I tried
having it use pyproject-build-system with meson-python as the builder,
but it fails like:

--8<---------------cut here---------------start------------->8---
starting phase `build'
Using 'mesonpy' to build wheels, auto-detected 'mesonpy', override '#f'.
Traceback (most recent call last):
  File "<string>", line 4, in <module>
  File "/gnu/store/mpclbasyclbc4pdkf96q2iksc687f3p7-meson-python-0.12.1/lib/python3.10/site-packages/mesonpy/__init__.py", line 1054, in wrapper
    return func(*args, **kwargs)
  File "/gnu/store/mpclbasyclbc4pdkf96q2iksc687f3p7-meson-python-0.12.1/lib/python3.10/site-packages/mesonpy/__init__.py", line 1115, in build_wheel
    with _project(config_settings) as project:
  File "/gnu/store/fxd7cxzv3fzkm745x26zswrsa4gfv3fs-python-3.10.7/lib/python3.10/contextlib.py", line 135, in __enter__
    return next(self.gen)
  File "/gnu/store/mpclbasyclbc4pdkf96q2iksc687f3p7-meson-python-0.12.1/lib/python3.10/site-packages/mesonpy/__init__.py", line 971, in _project
    for key, value in config_settings.items()
AttributeError: 'list' object has no attribute 'items'
error: in phase 'build': uncaught exception:
%exception #<&invoke-error program: "python" arguments: ("-c" "import sys, importlib, json\nconfig_settings = json.loads (sys.argv[3])\nbuilder = importlib.import_module(sys.argv[1])\nbuilder.build_wheel(sys.argv[2], config_settings=config_settings)" "mesonpy" "dist" "[]") exit-status: 1 term-signal: #f stop-signal: #f> 
phase `build' failed after 0.4 seconds
--8<---------------cut here---------------end--------------->8---

As I've seen this same error with another package/attempt (meson-python
itself), I'm creating this ticket.  It's probably our custom Python code
in pyproject-build-system that needs to be updated.

-- 
Thanks,
Maxim