From 38643e4f9bf4256f2a7d72c217a309d5df8cc46e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20And=C3=A9n?= Date: Wed, 8 Jun 2022 17:57:11 +0200 Subject: [PATCH 1/3] Limit Python versions used for wheels --- python/ci/build-wheels-linux.sh | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/python/ci/build-wheels-linux.sh b/python/ci/build-wheels-linux.sh index dfc502dcf..eec702fbf 100755 --- a/python/ci/build-wheels-linux.sh +++ b/python/ci/build-wheels-linux.sh @@ -17,13 +17,19 @@ export FINUFFT_DIR=$(pwd) # Needed for auditwheel to find the dynamic libraries export LD_LIBRARY_PATH=${FINUFFT_DIR}/lib:${LD_LIBRARY_PATH} -pys=(/opt/python/*/bin) - -# Filter out old Python versions -pys=(${pys[@]//*27*/}) -pys=(${pys[@]//*34*/}) -pys=(${pys[@]//*35*/}) -pys=(${pys[@]//*pp39-pypy39_pp73*/}) +# Explicitly list Python versions to build +versions=("cp36-cp36m" + "cp37-cp37m" + "cp38-cp38" + "cp39-cp39" + "cp310-cp310" + "pp37-pypy37_pp73" + "pp38-pypy38_pp73") + +pys=() +for version in "${versions[@]}"; do + pys+=("/opt/python/${version}/bin") +done # build wheel for PYBIN in "${pys[@]}"; do From 8b8f3a8bb963e341d3f2d75c2eab1730bea48b5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20And=C3=A9n?= Date: Wed, 8 Jun 2022 17:57:35 +0200 Subject: [PATCH 2/3] Harmonize style in build-wheels-linux.sh --- python/ci/build-wheels-linux.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/python/ci/build-wheels-linux.sh b/python/ci/build-wheels-linux.sh index eec702fbf..f28ecbf7c 100755 --- a/python/ci/build-wheels-linux.sh +++ b/python/ci/build-wheels-linux.sh @@ -32,10 +32,10 @@ for version in "${versions[@]}"; do done # build wheel -for PYBIN in "${pys[@]}"; do - "${PYBIN}/pip" install --upgrade pip - "${PYBIN}/pip" install auditwheel wheel twine numpy - "${PYBIN}/pip" wheel ./python -w python/wheelhouse +for pybin in "${pys[@]}"; do + "${pybin}/pip" install --upgrade pip + "${pybin}/pip" install auditwheel wheel twine numpy + "${pybin}/pip" wheel ./python -w python/wheelhouse done # fix wheel @@ -44,7 +44,7 @@ for whl in python/wheelhouse/finufft-*.whl; do done # test wheel -for PYBIN in "${pys[@]}"; do - "${PYBIN}/pip" install finufft -f ./python/wheelhouse/ - "${PYBIN}/python" ./python/test/run_accuracy_tests.py +for pybin in "${pys[@]}"; do + "${pybin}/pip" install finufft -f ./python/wheelhouse/ + "${pybin}/python" ./python/test/run_accuracy_tests.py done From 74341892ee618a866626bde0283767d86c857c48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20And=C3=A9n?= Date: Wed, 8 Jun 2022 22:52:15 +0200 Subject: [PATCH 3/3] Cache Python binaries on macOS --- .github/workflows/python_wheel.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python_wheel.yml b/.github/workflows/python_wheel.yml index 1b0790dca..3d6e7c7d7 100644 --- a/.github/workflows/python_wheel.yml +++ b/.github/workflows/python_wheel.yml @@ -60,11 +60,24 @@ jobs: # hack to make libquadmath link statically sudo rm /usr/local/opt/gcc@11/lib/gcc/11/libquadmath.*dylib + - name: Cache macOS Python binaries + id: cache-python + uses: actions/cache@v3 + with: + path: | + /Library/Frameworks/Python.framework/Versions/3.6 + /Library/Frameworks/Python.framework/Versions/3.7 + /Library/Frameworks/Python.framework/Versions/3.8 + /Library/Frameworks/Python.framework/Versions/3.9 + /Library/Frameworks/Python.framework/Versions/3.10 + key: macos-python-3.6.8-macosx10.9-python3.7.9-macosx10.9-python3.8.3-macosx10.9-python3.9.7-macos11-python3.10.1-macos11 + # Download and install Python instead of using the setup_python # as the python interpreters in the Github machines # were compiled in 10.14, the wheels built with them # are incompatible with older MacOS versions - - name: Download and install Python + - if: steps.cache-python.outputs.cache-hit != 'true' + name: Download and install Python run: | curl \ https://www.python.org/ftp/python/3.6.8/python-3.6.8-macosx10.9.pkg \