Skip to content

Commit

Permalink
Merge pull request #222 from janden/speedup_python_ci
Browse files Browse the repository at this point in the history
Speed up Python CI
  • Loading branch information
ahbarnett authored Jun 13, 2022
2 parents 046fbba + a1c01da commit eda1628
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 16 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/python_wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
36 changes: 21 additions & 15 deletions python/ci/build-wheels-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,25 @@ 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
"${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
Expand All @@ -38,8 +44,8 @@ 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
"${PYBIN}/python" ./python/examples/simple1d1.py
for pybin in "${pys[@]}"; do
"${pybin}/pip" install finufft -f ./python/wheelhouse/
"${pybin}/python" ./python/test/run_accuracy_tests.py
"${pybin}/python" ./python/examples/simple1d1.py
done

0 comments on commit eda1628

Please sign in to comment.