Skip to content

Commit eda1628

Browse files
authored
Merge pull request #222 from janden/speedup_python_ci
Speed up Python CI
2 parents 046fbba + a1c01da commit eda1628

File tree

2 files changed

+35
-16
lines changed

2 files changed

+35
-16
lines changed

.github/workflows/python_wheel.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,24 @@ jobs:
6060
# hack to make libquadmath link statically
6161
sudo rm /usr/local/opt/gcc@11/lib/gcc/11/libquadmath.*dylib
6262
63+
- name: Cache macOS Python binaries
64+
id: cache-python
65+
uses: actions/cache@v3
66+
with:
67+
path: |
68+
/Library/Frameworks/Python.framework/Versions/3.6
69+
/Library/Frameworks/Python.framework/Versions/3.7
70+
/Library/Frameworks/Python.framework/Versions/3.8
71+
/Library/Frameworks/Python.framework/Versions/3.9
72+
/Library/Frameworks/Python.framework/Versions/3.10
73+
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
74+
6375
# Download and install Python instead of using the setup_python
6476
# as the python interpreters in the Github machines
6577
# were compiled in 10.14, the wheels built with them
6678
# are incompatible with older MacOS versions
67-
- name: Download and install Python
79+
- if: steps.cache-python.outputs.cache-hit != 'true'
80+
name: Download and install Python
6881
run: |
6982
curl \
7083
https://www.python.org/ftp/python/3.6.8/python-3.6.8-macosx10.9.pkg \

python/ci/build-wheels-linux.sh

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,25 @@ export FINUFFT_DIR=$(pwd)
1717
# Needed for auditwheel to find the dynamic libraries
1818
export LD_LIBRARY_PATH=${FINUFFT_DIR}/lib:${LD_LIBRARY_PATH}
1919

20-
pys=(/opt/python/*/bin)
21-
22-
# Filter out old Python versions
23-
pys=(${pys[@]//*27*/})
24-
pys=(${pys[@]//*34*/})
25-
pys=(${pys[@]//*35*/})
26-
pys=(${pys[@]//*pp39-pypy39_pp73*/})
20+
# Explicitly list Python versions to build
21+
versions=("cp36-cp36m"
22+
"cp37-cp37m"
23+
"cp38-cp38"
24+
"cp39-cp39"
25+
"cp310-cp310"
26+
"pp37-pypy37_pp73"
27+
"pp38-pypy38_pp73")
28+
29+
pys=()
30+
for version in "${versions[@]}"; do
31+
pys+=("/opt/python/${version}/bin")
32+
done
2733

2834
# build wheel
29-
for PYBIN in "${pys[@]}"; do
30-
"${PYBIN}/pip" install --upgrade pip
31-
"${PYBIN}/pip" install auditwheel wheel twine numpy
32-
"${PYBIN}/pip" wheel ./python -w python/wheelhouse
35+
for pybin in "${pys[@]}"; do
36+
"${pybin}/pip" install --upgrade pip
37+
"${pybin}/pip" install auditwheel wheel twine numpy
38+
"${pybin}/pip" wheel ./python -w python/wheelhouse
3339
done
3440

3541
# fix wheel
@@ -38,8 +44,8 @@ for whl in python/wheelhouse/finufft-*.whl; do
3844
done
3945

4046
# test wheel
41-
for PYBIN in "${pys[@]}"; do
42-
"${PYBIN}/pip" install finufft -f ./python/wheelhouse/
43-
"${PYBIN}/python" ./python/test/run_accuracy_tests.py
44-
"${PYBIN}/python" ./python/examples/simple1d1.py
47+
for pybin in "${pys[@]}"; do
48+
"${pybin}/pip" install finufft -f ./python/wheelhouse/
49+
"${pybin}/python" ./python/test/run_accuracy_tests.py
50+
"${pybin}/python" ./python/examples/simple1d1.py
4551
done

0 commit comments

Comments
 (0)