| 1 |
name: pip build osx |
| 2 |
|
| 3 |
on: [push, pull_request] |
| 4 |
|
| 5 |
env: |
| 6 |
MACOSX_DEPLOYMENT_TARGET: 12.0 |
| 7 |
_PYTHON_HOST_PLATFORM: macosx-12.0-universal2 |
| 8 |
ARCHFLAGS: "-arch arm64 -arch x86_64" |
| 9 |
|
| 10 |
jobs: |
| 11 |
build: |
| 12 |
|
| 13 |
runs-on: macos-13 |
| 14 |
strategy: |
| 15 |
max-parallel: 4 |
| 16 |
matrix: |
| 17 |
python-version: ["3.9"] |
| 18 |
include: |
| 19 |
- python-version: "3.9" |
| 20 |
numpy-version: "1.21.4" |
| 21 |
name: Build wheels for Python ${{ matrix.python-version }} |
| 22 |
steps: |
| 23 |
- uses: actions/checkout@v4 |
| 24 |
with: |
| 25 |
submodules: true |
| 26 |
- uses: actions/setup-python@v5 |
| 27 |
with: |
| 28 |
python-version: ${{ matrix.python-version }} |
| 29 |
architecture: x64 |
| 30 |
|
| 31 |
|
| 32 |
- name: Install dependencies |
| 33 |
run: | |
| 34 |
brew update || true |
| 35 |
brew install boost eigen gmp mpfr cgal || true |
| 36 |
python -m pip install --user numpy>=2.0 |
| 37 |
python -m pip install --user -r ext/gudhi-deploy/build-requirements.txt |
| 38 |
python -m pip install --user delocate |
| 39 |
./scripts/build_osx_universal_gmpfr.sh |
| 40 |
# Now the universal libraries are in $PWD/deps-uni/lib |
| 41 |
- name: Build python wheel |
| 42 |
run: | |
| 43 |
export GMP_LIB_DIR=$PWD/deps-uni/lib |
| 44 |
export GMPXX_LIB_DIR=$PWD/deps-uni/lib |
| 45 |
export MPFR_LIB_DIR=$PWD/deps-uni/lib |
| 46 |
python --version |
| 47 |
mkdir build |
| 48 |
cd build |
| 49 |
cmake -DCMAKE_BUILD_TYPE=Release .. |
| 50 |
cd src/python |
| 51 |
python -m build -n -w |
| 52 |
export PATH="$PATH:`python -m site --user-base`/bin" |
| 53 |
delocate-wheel --require-archs universal2 -v dist/*.whl |
| 54 |
- name: Upload OSx python wheel |
| 55 |
uses: actions/upload-artifact@v4 |
| 56 |
with: |
| 57 |
name: osx python wheel |
| 58 |
path: build/src/python/dist/*.whl |
| 59 |
|
| 60 |
- name: Install and test python wheel |
| 61 |
run: | |
| 62 |
python -m pip install --user numpy~=${{ matrix.numpy-version }} |
| 63 |
python -m pip install --user pytest build/src/python/dist/*.whl |
| 64 |
python -c "import gudhi; print(gudhi.__version__)" |
| 65 |
python -m pytest -v src/python/test/test_alpha_complex.py |
| 66 |
python -m pytest -v src/python/test/test_delaunay_complex.py |
| 67 |
python -m pytest -v src/python/test/test_bottleneck_distance.py |
| 68 |
python -m pytest -v src/python/test/test_cubical_complex.py |
| 69 |
python -m pytest -v src/python/test/test_rips_complex.py |