raysect / source

The main source repository for the Raysect project.
http://www.raysect.org
BSD 3-Clause "New" or "Revised" License
86 stars 23 forks source link

Add pyproject.toml, remove Cython as runtime dependency #404

Closed jacklovell closed 2 years ago

jacklovell commented 2 years ago

This means it's now possible to install raysect from source or sdist without having to manually install Cython and numpy first. It also enables wheels to be built using PyPA's build package, with proper build isolation, which should simplify the process of producing manylinux wheels.

The procedure to build a wheel is now as simple as:

python -m pip install build
cd <path-to-raysect>
python -m build .
auditwheel repair dist/*.whl  # To make a manylinux wheel when running in the appropriate docker container

This also means users don't get an error when doing pip install raysect in a Python environment for which there isn't a raysect wheel and Cython/numpy aren't already installed, e.g. a fresh Python 3.6 or 3.10 virtualenv.

It'll also simplify the procedure for building manylinux wheelsl for downstream projects like Cherab, since the build module will be able to properly handle raysect as a build dependency without erroring.

I noticed in setup.py the minimum runtime version of Numpy is given as 0.14. I suspect this is a typo and it should be 1.14 instead, but haven't changed it until that's confirmed.

Fixes #401

jacklovell commented 2 years ago

I've submitted this PR against the master branch as it contains no functional changes to Raysect and end users would see the result quicker if it resulted in a 0.7.2 or even 0.7.1.post1 release, but it would apply equally well to the development branch.