Skip to content

Commit

Permalink
Merge pull request #1089 from VincentRouvreau/fix_pip_wheel
Browse files Browse the repository at this point in the history
Fix pip wheels build
  • Loading branch information
VincentRouvreau authored Jun 26, 2024
2 parents 0c33077 + e741bc4 commit e4feb7b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/pip-packaging-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
# numpy~=1.21.4 means any numpy=1.21.*, but also numpy>=1.21.4 (numpy~=1.21 do not work as it means any numpy==1.*)
- name: Build wheel for Python 3.8
run: |
rm -rf src/python/gudhi/*.cpp
mkdir build_38
cd build_38
cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=$PYTHON38/bin/python ..
Expand All @@ -36,6 +37,7 @@ jobs:
$PYTHON38/bin/python -m pytest -v src/python/test/test_rips_complex.py
- name: Build wheel for Python 3.9
run: |
rm -rf src/python/gudhi/*.cpp
mkdir build_39
cd build_39
cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=$PYTHON39/bin/python ..
Expand All @@ -57,6 +59,7 @@ jobs:
$PYTHON39/bin/python -m pytest -v src/python/test/test_rips_complex.py
- name: Build wheel for Python 3.10
run: |
rm -rf src/python/gudhi/*.cpp
mkdir build_310
cd build_310
cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=$PYTHON310/bin/python ..
Expand All @@ -74,6 +77,7 @@ jobs:
$PYTHON310/bin/python -m pytest -v src/python/test/test_rips_complex.py
- name: Build wheel for Python 3.11
run: |
rm -rf src/python/gudhi/*.cpp
mkdir build_311
cd build_311
cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=$PYTHON311/bin/python ..
Expand All @@ -91,6 +95,7 @@ jobs:
$PYTHON311/bin/python -m pytest -v src/python/test/test_rips_complex.py
- name: Build wheel for Python 3.12
run: |
rm -rf src/python/gudhi/*.cpp
mkdir build_312
cd build_312
cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=$PYTHON312/bin/python ..
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/pip-packaging-osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ env:
_PYTHON_HOST_PLATFORM: macosx-12.0-universal2
ARCHFLAGS: "-arch arm64 -arch x86_64"

# Python 3.8 specific case where NumPy 2.x will not be supported
# NumPy packages for osx x86 and arm are only available from 1.21.2, but stable for both versions from 1.21.4 and python 3.8+
# numpy~=1.21.4 means any numpy=1.21.*, but also numpy>=1.21.4 (numpy~=1.21 do not work as it means any numpy==1.*)
jobs:
build:
# Python 3.8 specific case where NumPy 2.x will not be supported
wheels_3_8:
# Should use macos-latest, but python 3.8 and 3.9 is no more available from macos-14
runs-on: macos-13
name: Build wheels for Python 3.8
Expand All @@ -25,6 +23,8 @@ jobs:
with:
python-version: 3.8
architecture: x64
# NumPy packages for osx x86 and arm are only available from 1.21.2, but stable for both versions from 1.21.4 and python 3.8+
# numpy~=1.21.4 means any numpy=1.21.*, but also numpy>=1.21.4 (numpy~=1.21 do not work as it means any numpy==1.*)
- name: Install dependencies
run: |
brew update || true
Expand Down Expand Up @@ -65,10 +65,9 @@ jobs:
delocate-wheel --require-archs universal2 -w wheelhouse build/src/python/dist/*.whl
python -m twine upload wheelhouse/*.whl
# Python 3.9+ specific case where NumPy 2.x will be supported
# NumPy packages for osx x86 and arm are only available from 1.21.2, but stable for both versions from 1.21.4 and python 3.8+
jobs:
build:
# Python 3.9+ specific case where NumPy 2.x will be supported
# NumPy packages for osx x86 and arm are only available from 1.21.2, but stable for both versions from 1.21.4 and python 3.8+
wheels:
# Should use macos-latest, but python 3.8 and 3.9 is no more available from macos-14
runs-on: macos-13
strategy:
Expand All @@ -93,6 +92,8 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
architecture: x64
# For python >=3.9, numpy >= 2.0 for package build and ABI compatibility with numpy 1.X and 2.X
# cf. https://numpy.org/doc/stable/dev/depending_on_numpy.html#numpy-2-0-specific-advice
- name: Install dependencies
run: |
brew update || true
Expand All @@ -113,6 +114,7 @@ jobs:
cmake -DCMAKE_BUILD_TYPE=Release -DPython_ADDITIONAL_VERSIONS=3 ..
cd src/python
python -m build -n -w
# Test ABI compatibility with numpy 1.X
- name: Install and test python wheel
run: |
python -m pip install --user numpy~=${{ matrix.numpy-version }}
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/pip-packaging-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ on:
release:
types: [published]

# Python 3.8 specific case where NumPy 2.x will not be supported
# numpy~=1.21.4 means any numpy=1.21.*, but also numpy>=1.21.4 (numpy~=1.21 do not work as it means any numpy==1.*)
jobs:
build:
# Python 3.8 specific case where NumPy 2.x will not be supported
# numpy~=1.21.4 means any numpy=1.21.*, but also numpy>=1.21.4 (numpy~=1.21 do not work as it means any numpy==1.*)
wheels_3_8:
runs-on: windows-latest
name: Build wheels for Python 3.8
steps:
Expand Down Expand Up @@ -58,9 +58,8 @@ jobs:
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: python -m twine upload build/src/python/dist/*.whl

# Python 3.9+ specific case where NumPy 2.x will be supported
jobs:
build:
# Python 3.9+ specific case where NumPy 2.x will be supported
wheels:
runs-on: windows-latest
strategy:
max-parallel: 4
Expand Down

0 comments on commit e4feb7b

Please sign in to comment.