libvips / pyvips

python binding for libvips using cffi
MIT License
636 stars 49 forks source link

No support for PEP 517 builds #499

Open bnbourgade opened 1 month ago

bnbourgade commented 1 month ago

Hello,

I've been trying to install pyvips using poetry 1.8.2, and it fails, returning me the following error :

  error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1

  at /usr/local/lib/python3.10/dist-packages/poetry/installation/chef.py:164 in _prepare
      160│ 
      161│                 error = ChefBuildError("\n\n".join(message_parts))
      162│ 
      163│             if error is not None:
    → 164│                 raise error from None
      165│ 
      166│             return path
      167│ 
      168│     def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:

Note: This error originates from the build backend, and is likely not a problem with poetry but with pyvips (2.2.3) not supporting PEP 517 builds. You can verify this by running 'pip wheel --no-cache-dir --use-pep517 "pyvips (==2.2.3)"'.

I've found a workaround using an older version of poetry, alongside installing some apt packages, but i would find an issue that uses the latest version of Poetry.

Thanks in advance !

kleisauke commented 1 week ago

I think PR #445 will fix this.

$ pip3 install git+https://github.com/kleisauke/pyvips.git@pyproject-toml --use-pep517 --break-system-packages
[...]
Successfully built pyvips
Installing collected packages: pyvips
Successfully installed pyvips-2.2.3
kleisauke commented 1 week ago

Actually, it seems that the underlying issue might be error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1. Is there a way to enable verbose build output in Poetry?

[...] You can verify this by running 'pip wheel --no-cache-dir --use-pep517 "pyvips (==2.2.3)"'.

FWIW, the command mentioned here also works for me without any issues.

kleisauke commented 1 week ago

... according to https://peps.python.org/pep-0517/, it should revert to the setup.py build if the pyproject.toml file is absent.

If the pyproject.toml file is absent, or the build-backend key is missing, the source tree is not using this specification, and tools should revert to the legacy behaviour of running setup.py (either directly, or by implicitly invoking the setuptools.build_meta:__legacy__ backend).

So, IIUC, pyvips should already be compatible with PEP 517.