Skip to content

Commit 290c735

Browse files
authored
Merge pull request #112 from SimonRit/pkg_macos_intel
Intel MacOS Python wheels for ITK v5.4.3
2 parents fed6f13 + 1ae2d99 commit 290c735

File tree

1 file changed

+75
-1
lines changed

1 file changed

+75
-1
lines changed

.github/workflows/build-test-package-python.yml

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ on:
2020
required: false
2121
type: string
2222
# v5.4.3
23-
default: 'v5.4.3'
23+
default: 'c8abf82ce0198110a8226bec311c4bf6ccb7fb8f'
2424
itk-python-package-org:
2525
description: 'Github organization name for fetching ITKPythonPackage build scripts'
2626
required: false
@@ -206,6 +206,79 @@ jobs:
206206
name: LinuxWheel3${{ matrix.python3-minor-version }}_2_28-aarch64
207207
path: dist/*.whl
208208

209+
build-macos-py:
210+
runs-on: macos-13
211+
strategy:
212+
max-parallel: 2
213+
matrix:
214+
python3-minor-version: ${{ fromJSON(inputs.python3-minor-versions) }}
215+
216+
steps:
217+
- uses: actions/checkout@v4
218+
219+
- name: 'Specific XCode version'
220+
run: |
221+
sudo xcode-select -s "/Applications/Xcode_15.2.0.app"
222+
223+
- name: Get specific version of CMake, Ninja
224+
uses: lukka/[email protected]
225+
226+
- name: 'Fetch build script'
227+
run: |
228+
IPP_DOWNLOAD_GIT_TAG=${{ inputs.itk-python-package-tag }}
229+
IPP_DOWNLOAD_ORG=${{ inputs.itk-python-package-org }}
230+
curl -L https://raw.githubusercontent.com/${IPP_DOWNLOAD_ORG:=InsightSoftwareConsortium}/ITKPythonPackage/${IPP_DOWNLOAD_GIT_TAG:=master}/scripts/macpython-download-cache-and-build-module-wheels.sh -O
231+
chmod u+x macpython-download-cache-and-build-module-wheels.sh
232+
233+
- name: 'Build 🐍 Python 📦 package'
234+
shell: bash
235+
run: |
236+
rm -rf dist
237+
238+
export ITK_PACKAGE_VERSION=${{ inputs.itk-wheel-tag }}
239+
export ITKPYTHONPACKAGE_TAG=${{ inputs.itk-python-package-tag }}
240+
export ITKPYTHONPACKAGE_ORG=${{ inputs.itk-python-package-org }}
241+
export ITK_MODULE_PREQ=${{ inputs.itk-module-deps }}
242+
if [ -z ${{ inputs.macosx-deployment-target }} ]; then
243+
export MACOSX_DEPLOYMENT_TARGET=10.9
244+
else
245+
export MACOSX_DEPLOYMENT_TARGET=${{ inputs.macosx-deployment-target }}
246+
fi
247+
if [ -z ${{ inputs.cmake-options }} ]; then
248+
CMAKE_OPTIONS=""
249+
else
250+
CMAKE_OPTIONS="--cmake_options ${{ inputs.cmake-options }}"
251+
fi
252+
./macpython-download-cache-and-build-module-wheels.sh $CMAKE_OPTIONS "3.${{ matrix.python3-minor-version }}"
253+
254+
- name: Set up Python 3.11 for Validation
255+
uses: actions/setup-python@v5
256+
with:
257+
python-version: "3.11"
258+
259+
- name: Validate build output
260+
shell: bash
261+
run: |
262+
python -m pip install twine
263+
ls dist/
264+
265+
WHEEL_PATTERN="dist/itk_*macosx*.whl"
266+
EXPECTED_WHEEL_COUNT=1
267+
268+
WHEEL_COUNT=`(ls ${WHEEL_PATTERN} | wc -l)`
269+
if (( ${WHEEL_COUNT} != ${EXPECTED_WHEEL_COUNT} )); then
270+
echo "Expected ${EXPECTED_WHEEL_COUNT} wheels but found ${WHEEL_COUNT}"
271+
exit 1
272+
fi
273+
274+
python -m twine check ${WHEEL_PATTERN}
275+
276+
- name: Publish Python package as GitHub Artifact
277+
uses: actions/upload-artifact@v4
278+
with:
279+
name: MacOSWheel3${{ matrix.python3-minor-version }}
280+
path: dist/*.whl
281+
209282
build-macos-arm-py:
210283
runs-on: macos-14
211284
strategy:
@@ -410,6 +483,7 @@ jobs:
410483
needs:
411484
- build-linux-py
412485
- build-linux-arm-py
486+
- build-macos-py
413487
- build-macos-arm-py
414488
- build-windows-python-packages
415489
runs-on: ubuntu-22.04

0 commit comments

Comments
 (0)