#!/bin/bash
# Simple script to create galpy wheels for a bunch of different
# Python version locally; useful for creating ARM64 wheels, because
# not possible with CIs currently
source ~/.bash_profile
PYTHON_VERSIONS=("3.8" "3.9" "3.10")

rm -rf galpy-wheels-output 
mkdir galpy-wheels-output
# Loop over the entire thing to make sure nothing gets re-used
for PYTHON_VERSION in "${PYTHON_VERSIONS[@]}"; do
    git clone https://github.com/jobovy/galpy.git galpy-wheels
    cd galpy-wheels
    git checkout v1.7.1
    mkdir wheelhouse
    conda activate base;
    conda create -y --name galpywheels"$PYTHON_VERSION" python="$PYTHON_VERSION";
    conda env update --name galpywheels"$PYTHON_VERSION" --file .github/conda-build-environment-macos-latest.yml --prune;
    conda activate galpywheels"$PYTHON_VERSION";
    pip install wheel;
    CFLAGS="$CFLAGS -I$CONDA_PREFIX/include";
    LDFLAGS="$LDFLAGS -L$CONDA_PREFIX/lib";
    LD_LIBRARY_PATH="$LD_LIBRARY_PATH -L$CONDA_PREFIX/lib";
    python setup.py build_ext;
    python setup.py bdist_wheel -d wheelhouse;
    mv wheelhouse/* ../galpy-wheels-output;
    conda activate base;
    conda remove -y --name galpywheels"$PYTHON_VERSION" --all;
    cd ../;
    rm -rf galpy-wheels;
done

Add simple script to locally create wheels for different python versions (useful for arm64)
Add simple script to locally create wheels for different python versions (useful for arm64)
