Skip to content

Commit 74a715f

Browse files
committed
COMP: Do not apply delocate package patch workaround
Patch fails to apply and this was not required with recent delocate.
1 parent 6644eff commit 74a715f

5 files changed

Lines changed: 92 additions & 21 deletions

scripts/delocate.package.apply.patch

Lines changed: 0 additions & 5 deletions
This file was deleted.

scripts/delocate.package.revert.patch

Lines changed: 0 additions & 5 deletions
This file was deleted.

scripts/macpython-build-module-wheels.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,6 @@ for VENV in "${VENVS[@]}"; do
109109
done
110110

111111
for wheel in $PWD/dist/*.whl; do
112-
${DELOCATE_PATCH} $wheel ${script_dir}/delocate.package.apply.patch # workaround for delocate's need for a package
113112
${DELOCATE_LISTDEPS} $wheel # lists library dependencies
114113
${DELOCATE_WHEEL} $wheel # copies library dependencies into wheel
115-
${DELOCATE_PATCH} $wheel ${script_dir}/delocate.package.revert.patch # workaround for delocate's need for a package
116114
done

scripts/macpython-build-wheels.sh

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -212,15 +212,8 @@ done
212212

213213
for wheel in dist/*.whl; do
214214
echo "Delocating $wheel"
215-
if [[ $wheel = *itk_core* ]]; then
216-
${DELOCATE_LISTDEPS} $wheel # lists library dependencies
217-
${DELOCATE_WHEEL} $wheel # copies library dependencies into wheel
218-
else
219-
${DELOCATE_PATCH} $wheel ${SCRIPT_DIR}/delocate.package.apply.patch # workaround for delocate's need for a package
220-
${DELOCATE_LISTDEPS} $wheel # lists library dependencies
221-
${DELOCATE_WHEEL} $wheel # copies library dependencies into wheel
222-
${DELOCATE_PATCH} $wheel ${SCRIPT_DIR}/delocate.package.revert.patch # workaround for delocate's need for a package
223-
fi
215+
${DELOCATE_LISTDEPS} $wheel # lists library dependencies
216+
${DELOCATE_WHEEL} $wheel # copies library dependencies into wheel
224217
done
225218

226219
# Install packages and test
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
#!/usr/bin/env bash
2+
3+
# Run this script to build the ITK Python wheel packages for macOS.
4+
#
5+
# Versions can be restricted by passing them in as arguments to the script
6+
# For example,
7+
#
8+
# scripts/macpython-build-wheels.sh 3.9
9+
#
10+
# Shared libraries can be included in the wheel by exporting them to DYLD_LIBRARY_PATH before
11+
# running this script.
12+
#
13+
# For example,
14+
#
15+
# export DYLD_LIBRARY_PATH="/path/to/libs"
16+
# scripts/macpython-build-module-wheels.sh 3.9
17+
#
18+
19+
# -----------------------------------------------------------------------
20+
# These variables are set in common script:
21+
#
22+
MACPYTHON_PY_PREFIX=""
23+
PYBINARIES=""
24+
SCRIPT_DIR=""
25+
26+
script_dir=$(cd $(dirname $0) || exit 1; pwd)
27+
source "${script_dir}/macpython-build-common.sh"
28+
29+
# -----------------------------------------------------------------------
30+
# Remove previous virtualenv's
31+
rm -rf ${SCRIPT_DIR}/../venvs
32+
# Create virtualenv's
33+
VENVS=()
34+
mkdir -p ${SCRIPT_DIR}/../venvs
35+
for PYBIN in "${PYBINARIES[@]}"; do
36+
if [[ $(basename $PYBIN) = "Current" ]]; then
37+
continue
38+
fi
39+
py_mm=$(basename ${PYBIN})
40+
VENV=${SCRIPT_DIR}/../venvs/${py_mm}
41+
VIRTUALENV_EXECUTABLE="${PYBIN}/bin/python3 -m venv"
42+
${VIRTUALENV_EXECUTABLE} ${VENV}
43+
VENVS+=(${VENV})
44+
done
45+
46+
VENV="${VENVS[0]}"
47+
Python3_EXECUTABLE=${VENV}/bin/python3
48+
${Python3_EXECUTABLE} -m pip install --no-cache delocate
49+
DELOCATE_LISTDEPS=${VENV}/bin/delocate-listdeps
50+
DELOCATE_WHEEL=${VENV}/bin/delocate-wheel
51+
DELOCATE_PATCH=${VENV}/bin/delocate-patch
52+
53+
build_type="Release"
54+
55+
if [[ $(arch) == "arm64" ]]; then
56+
osx_target="11.0"
57+
osx_arch="arm64"
58+
use_tbb="OFF"
59+
else
60+
osx_target="10.9"
61+
osx_arch="x86_64"
62+
use_tbb="OFF"
63+
fi
64+
65+
for wheel in dist/*.whl; do
66+
echo "Delocating $wheel"
67+
#if [[ $wheel = *itk_core* ]]; then
68+
${DELOCATE_LISTDEPS} $wheel # lists library dependencies
69+
${DELOCATE_WHEEL} $wheel # copies library dependencies into wheel
70+
#else
71+
#${DELOCATE_PATCH} $wheel ${SCRIPT_DIR}/delocate.package.apply.patch # workaround for delocate's need for a package
72+
#${DELOCATE_LISTDEPS} $wheel # lists library dependencies
73+
#${DELOCATE_WHEEL} $wheel # copies library dependencies into wheel
74+
#${DELOCATE_PATCH} $wheel ${SCRIPT_DIR}/delocate.package.revert.patch # workaround for delocate's need for a package
75+
#fi
76+
done
77+
78+
# Install packages and test
79+
# numpy wheel not currently available for the M1
80+
# https://github.com/numpy/numpy/issues/17807
81+
if [[ $(arch) != "arm64" ]]; then
82+
for VENV in "${VENVS[@]}"; do
83+
${VENV}/bin/pip install numpy
84+
${VENV}/bin/pip install itk --no-cache-dir --no-index -f ${SCRIPT_DIR}/../dist
85+
(cd $HOME && ${VENV}/bin/python -c 'import itk;')
86+
(cd $HOME && ${VENV}/bin/python -c 'import itk; image = itk.Image[itk.UC, 2].New()')
87+
(cd $HOME && ${VENV}/bin/python -c 'import itkConfig; itkConfig.LazyLoading = False; import itk;')
88+
(cd $HOME && ${VENV}/bin/python ${SCRIPT_DIR}/../docs/code/test.py )
89+
done
90+
fi

0 commit comments

Comments
 (0)