Skip to content

Commit

Permalink
refactor: patch pyproject.toml instead of using `SKBUILD_CONFIGURE_…
Browse files Browse the repository at this point in the history
…OPTIONS`

* This approach seems to be a lot more robust, especially since CIBuildWheel seems to have some issues with properly propagating the env vars
  • Loading branch information
Curve committed May 2, 2024
1 parent 9ab3be7 commit 8d1e35a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@ runs:
if: ${{ inputs.container == 'windows-latest' }}
run: git config --system core.longpaths true

- name: 🖥️ Enable MSVC Dev Console
uses: ilammy/msvc-dev-cmd@v1

- name: 📋 Install Dependencies
shell: bash
if: ${{ inputs.container == 'ubuntu-latest' }}
run: dnf install -y make automake gcc gcc-c++ kernel-devel cmake git python3 python3-pip python3-devel docker
run: dnf install -y make automake gcc gcc-c++ kernel-devel cmake git python3 python3-pip python3-devel docker sed

- name: 📋 Install OpenMP
shell: bash
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,18 @@ jobs:
- name: 🛞 CIBuildWheel
run: python -m pip install cibuildwheel==2.17.0

- name: 🛠️ Build VTK
if: ${{ matrix.os != 'ubuntu-latest' }}
run: sed -i 's/DVIENNALS_BUILD_PYTHON=ON"/\0,"-DVIENNALS_PACKAGE_PYTHON=ON"/g' pyproject.toml

- name: 🛠️ Use VTK-Python Libs
if: ${{ matrix.os == 'ubuntu-latest' }}
run: sed -i 's/DVIENNALS_BUILD_PYTHON=ON"/\0,"-DVIENNALS_VTK_PYTHON_LIBS=ON"/g' pyproject.toml

- name: 🏗️ Build Wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: "cp310-* cp311-* cp312-*"
CIBW_ENVIRONMENT: SKBUILD_CONFIGURE_OPTIONS="${{ matrix.os == 'ubuntu-latest' && '-DVIENNALS_VTK_PYTHON_LIBS=ON' || '-DVIENNALS_PACKAGE_PYTHON=ON' }}"
CIBW_BUILD: cp310-* cp311-* cp312-*

- name: 📦 Upload Artifact
uses: actions/upload-artifact@v4
Expand Down

0 comments on commit 8d1e35a

Please sign in to comment.