letmaik / rawpy

📷 RAW image processing for Python, a wrapper for libraw
https://pypi.python.org/pypi/rawpy
MIT License
587 stars 67 forks source link

Avoid separate numpy and cython install when building from source #148

Open letmaik opened 3 years ago

letmaik commented 3 years ago

Related to #147.

The end goal is to be able to do pip install git+https://github.com/letmaik/rawpy.git@v0.16.0 without installing numpy and cython in advance. This is mostly for Linux and will also work on macOS.

setuptools got more clever regarding cython: https://github.com/pypa/setuptools/blob/main/CHANGES.rst#180 But see also https://github.com/pypa/setuptools/issues/1317. However, this is not enough, as there's also this bit in setup.py: include_dirs += [numpy.get_include()]. I'm not sure yet how that can be deferred. Probably using pyproject.toml to declare build dependencies. The issue with that is that the numpy version should depend on the Python version to be as ABI compatible as possible, see also the GitHub Actions workflow. Maybe the requirements specifiers allow to express this. EDIT: There's https://pypi.org/project/oldest-supported-numpy/ which seems to be useful for this.