Skip to content

Missing prepare_metadata_for_build_wheel attribute #55

@rgommers

Description

@rgommers

Just observed this in a 32-bit Linux SciPy CI job (log):

Processing /scipy
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'error'
  error: subprocess-exited-with-error
  
  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [42 lines of output]
      + meson setup --native-file=/scipy/.mesonpy-native-file.ini -Ddebug=false -Dstrip=true -Doptimization=2 --prefix=/usr /scipy /scipy/.mesonpy-n5dcevv3/build
      Traceback (most recent call last):
        File "/usr/local/lib/python3.8/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 156, in prepare_metadata_for_build_wheel
          hook = backend.prepare_metadata_for_build_wheel
      AttributeError: module 'mesonpy' has no attribute 'prepare_metadata_for_build_wheel'

      During handling of the above exception, another exception occurred:
      
      Traceback (most recent call last):
        File "/usr/local/lib/python3.8/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
        File "/usr/local/lib/python3.8/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/usr/local/lib/python3.8/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 160, in prepare_metadata_for_build_wheel
          whl_basename = backend.build_wheel(metadata_directory, config_settings)
        File "/root/.local/lib/python3.8/site-packages/mesonpy/__init__.py", line 806, in build_wheel
          with _project(config_settings) as project:
        File "/usr/lib/python3.8/contextlib.py", line 113, in __enter__
          return next(self.gen)
        File "/root/.local/lib/python3.8/site-packages/mesonpy/__init__.py", line 759, in _project
          with Project.with_temp_working_dir(
        File "/usr/lib/python3.8/contextlib.py", line 113, in __enter__
          return next(self.gen)
        File "/root/.local/lib/python3.8/site-packages/mesonpy/__init__.py", line 478, in with_temp_working_dir
          yield cls(source_dir, tmpdir, build_dir)
        File "/root/.local/lib/python3.8/site-packages/mesonpy/__init__.py", line 422, in __init__
          self._configure(reconfigure=bool(build_dir) and not native_file_mismatch)
        File "/root/.local/lib/python3.8/site-packages/mesonpy/__init__.py", line 449, in _configure
          self._meson(
        File "/root/.local/lib/python3.8/site-packages/mesonpy/__init__.py", line 437, in _meson
          return self._proc('meson', *args)
        File "/root/.local/lib/python3.8/site-packages/mesonpy/__init__.py", line 433, in _proc
          subprocess.check_call(list(args))
        File "/usr/lib/python3.8/subprocess.py", line 359, in check_call
          retcode = call(*popenargs, **kwargs)
        File "/usr/lib/python3.8/subprocess.py", line 340, in call
          with Popen(*popenargs, **kwargs) as p:
        File "/usr/lib/python3.8/subprocess.py", line 854, in __init__
          self._execute_child(args, executable, preexec_fn, close_fds,
        File "/usr/lib/python3.8/subprocess.py", line 1702, in _execute_child
          raise child_exception_type(errno_num, err_msg, err_filename)
      FileNotFoundError: [Errno 2] No such file or directory: 'meson'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

PEP 517 says that this hook is optional, so it's not clear to me that this is a problem in meson-python, it may be in pep517 or in pip.

The command that triggered it is:

CC=gcc-5 CXX=g++-5 FC=gfortran pip3 install . --no-build-isolation

Other invocations of pip install . --no-build-isolation don't have that issue. It may be that we're using pip 22.1 though - I'll try to pin it to the same 22.0.4 version as in other jobs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions