pypa / cibuildwheel

🎡 Build Python wheels for all the platforms with minimal configuration.
https://cibuildwheel.pypa.io
Other
1.82k stars 231 forks source link

Warn if the build uses a too-new version of numpy with cython #615

Closed mattip closed 3 years ago

mattip commented 3 years ago

Over at numpy/numpy#16938 we recieved feedback where, bottom line, building a c-extension with "cython + newest numpy" broke a workflow. I wonder if there would be a way for cibuildwheel to recommend or even require pinning versions of numpy when using cython. At least that way projects would have to acknowledge they may be headed for trouble.

xref compomics/ms2pip_c#134 which uses cibuildwheel.

henryiii commented 3 years ago

The recommendation in the documentation is to use pyproject.toml and oldest-supported-numpy. See https://cibuildwheel.readthedocs.io/en/stable/options/#examples_5

henryiii commented 3 years ago

projects would have to acknowledge

Projects don't read warnings.

recommend or even require pinning versions of numpy when using cython

This would be really complicated, and likely would break valid workflows. You have to pin a fairly new NumPy on special archs, probably AS on MacOS (soon), etc. NEP 29 is pushing projects to pin at higher levels (1.17 currently) than are required. This is a well known problem, with a clear solution; I think we can just maybe highlight the solution a bit more strongly, but don't think there's much else we can do.

mattip commented 3 years ago

Thanks, sounds reasonable. Closing.

henryiii commented 3 years ago

I'd be fine with a stronger recommendation (a tips and tricks entry?)