Install docker:

    sudo apt install docker.io

Create a temporary folder, enter it and clone the new release:

    git clone git@github.com:raysect/source.git

Start the manylinux docker container (this will download the container, mount the current folder as "io", and start an interactive session):

    sudo docker run -ti -v $(pwd):/io quay.io/pypa/manylinux2010_x86_64 /bin/bash

This will drop you into the manylinux container terminal. The /opt/python folder in the container holds the various versions of python. This example targets python 3.7. Adjust the paths as appropriate to build bdists for different python versions.

    cd io/source
    /opt/python/cp37-cp37m/bin/python -m pip install cython numpy==1.14.6
    /opt/python/cp37-cp37m/bin/python setup.py bdist_wheel
    auditwheel repair dist/raysect-0.8.2-cp37-cp37m-linux_x86_64.whl --plat manylinux2010_x86_64

This will compile the wheel and repair any library references to produce the manylinux wheel files in a folder ./wheelhouse. e.g. raysect-0.8.2-cp37-cp37m-manylinux1_x86_64.whl and raysect-0.8.2-cp37-cp37m-manylinux2010_x86_64.whl.

These can then be uploaded to pypi.

For more info see:
 https://realpython.com/python-wheels/#building-a-platform-wheel-macos-and-windows
 https://uwekorn.com/2019/09/15/how-we-build-apache-arrows-manylinux-wheels.html

Scripts to semi-automate the wheel building process
===================================================

There are two scripts which automate this for different versions of Python:
- dev/build_wheels_manylinux2010.sh builds manylinux2010 wheels for Python 3.7, 3.8 and 3.9
- dev/build_wheels_manylinux2014.sh builds manylinux2014 wheels for Python 3.10, 3.11 and 3.12

These can be used to produce wheels in a semi-automated fashion:
1. Install docker as above
2. Clone the raysect/source repository
3. Change into the top level of the raysect/source repository.
4. Run `sudo docker run -ti -v $(pwd):/io quay.io/pypa/manylinux2010_x86_64 /io/dev/build_wheels_manylinux2010.sh`
5. Run `sudo docker run -ti -v $(pwd):/io quay.io/pypa/manylinux2014_x86_64 /io/dev/build_wheels_manylinux2014.sh`
6. Upload the wheels in wheelhouse/, and the sdist in dist/, to PyPI using twine.

