Skip to content

Commit cdfeb62

Browse files
committed
Merge branch 'master' into module-cleanup
2 parents 9536c56 + ab642b2 commit cdfeb62

7 files changed

+63
-17
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ if(ITKPythonPackage_SUPERBUILD)
8989

9090
set(ITK_REPOSITORY "https://github.com/InsightSoftwareConsortium/ITK.git")
9191

92-
# ITK nightly-master 2022-07-27
93-
set(ITK_GIT_TAG "fb3bc5d9799b3e0ff86505413c2d58c56fd97aac")
92+
# ITK master 2022-09-20
93+
set(ITK_GIT_TAG "171fb2ba33a87041f99328a2f26612ff33aa9cc8")
9494

9595
#-----------------------------------------------------------------------------
9696
# A separate project is used to download ITK, so that it can reused

itkVersion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION = '5.3rc04.dev20220728+19.g8f5c337311'
1+
VERSION = '5.3rc04.post3'
22

33
def get_versions():
44
"""Returns versions for the ITK Python package.

scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,25 +46,27 @@ if [[ ! -f ./zstd-1.2.0-linux/bin/unzstd ]]; then
4646
exit 255
4747
fi
4848

49-
if [[ ! -f ITKPythonBuilds-linux.tar.zst ]]; then
50-
curl -L https://github.com/InsightSoftwareConsortium/ITKPythonBuilds/releases/download/${ITK_PACKAGE_VERSION:=v5.2.0.post1}/ITKPythonBuilds-linux.tar.zst -O
49+
TARBALL_NAME="ITKPythonBuilds-linux${TARBALL_SPECIALIZATION}.tar"
50+
51+
if [[ ! -f ${TARBALL_NAME}.zst ]]; then
52+
curl -L https://github.com/InsightSoftwareConsortium/ITKPythonBuilds/releases/download/${ITK_PACKAGE_VERSION:=v5.2.0.post1}/${TARBALL_NAME}.zst -O
5153
fi
52-
if [[ ! -f ./ITKPythonBuilds-linux.tar.zst ]]; then
53-
echo "ERROR: can not find required binary './ITKPythonBuilds-linux.tar.zst'"
54+
if [[ ! -f ./${TARBALL_NAME}.zst ]]; then
55+
echo "ERROR: can not find required binary './${TARBALL_NAME}.zst'"
5456
exit 255
5557
fi
56-
./zstd-1.2.0-linux/bin/unzstd ./ITKPythonBuilds-linux.tar.zst -o ITKPythonBuilds-linux.tar
58+
./zstd-1.2.0-linux/bin/unzstd ./${TARBALL_NAME}.zst -o ${TARBALL_NAME}
5759
if [ "$#" -lt 1 ]; then
5860
echo "Extracting all files";
59-
tar xf ITKPythonBuilds-linux.tar
61+
tar xf ${TARBALL_NAME}
6062
else
6163
echo "Extracting files relevant for: $1";
62-
tar xf ITKPythonBuilds-linux.tar ITKPythonPackage/scripts/
63-
tar xf ITKPythonBuilds-linux.tar ITKPythonPackage/ITK-source/
64-
tar xf ITKPythonBuilds-linux.tar ITKPythonPackage/oneTBB-prefix/
65-
tar xf ITKPythonBuilds-linux.tar --wildcards ITKPythonPackage/ITK-$1*
64+
tar xf ${TARBALL_NAME} ITKPythonPackage/scripts/
65+
tar xf ${TARBALL_NAME} ITKPythonPackage/ITK-source/
66+
tar xf ${TARBALL_NAME} ITKPythonPackage/oneTBB-prefix/
67+
tar xf ${TARBALL_NAME} --wildcards ITKPythonPackage/ITK-$1*
6668
fi
67-
rm ITKPythonBuilds-linux.tar
69+
rm ${TARBALL_NAME}
6870
if [[ ! -f ./ITKPythonPackage/scripts/dockcross-manylinux-build-module-wheels.sh ]]; then
6971
echo "ERROR: can not find required binary './ITKPythonPackage/scripts/dockcross-manylinux-build-module-wheels.sh'"
7072
exit 255

scripts/internal/manylinux-build-module-wheels.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ for PYBIN in "${PYBINARIES[@]}"; do
9090
echo 'ITK source tree not available!' 1>&2
9191
exit 1
9292
fi
93+
${PYBIN}/python setup.py clean
9394
${PYBIN}/python setup.py bdist_wheel --build-type Release -G Ninja -- \
9495
-DITK_DIR:PATH=${itk_build_dir} \
9596
-DITK_USE_SYSTEM_SWIG:BOOL=ON \

scripts/macpython-build-common.sh

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,53 @@ SCRIPT_DIR=$(cd $(dirname $0) || exit 1; pwd)
77

88
MACPYTHON_PY_PREFIX=/Library/Frameworks/Python.framework/Versions
99

10+
# -----------------------------------------------------------------------
11+
# Script argument parsing
12+
#
13+
usage()
14+
{
15+
echo "Usage:
16+
macpython-build-common
17+
[ -h | --help ] show usage
18+
[ -c | --cmake_options ] space-separated string of CMake options to forward to the module (e.g. \"-DBUILD_TESTING=OFF\")
19+
[ -- python_versions ] build wheel for a specific python version(s). (e.g. -- cp39 cp310)"
20+
exit 2
21+
}
22+
23+
PYTHON_VERSIONS=""
24+
CMAKE_OPTIONS=""
25+
26+
while (( "$#" )); do
27+
case "$1" in
28+
-c|--cmake_options)
29+
CMAKE_OPTIONS="$2";
30+
shift 2;;
31+
-h|--help)
32+
usage;
33+
break;;
34+
--)
35+
shift;
36+
break;;
37+
*)
38+
# Parse any unrecognized arguments as python versions
39+
PYTHON_VERSIONS="${PYTHON_VERSIONS} $1";
40+
shift;;
41+
esac
42+
done
43+
44+
# Parse all arguments after "--" as python versions
45+
PYTHON_VERSIONS="${PYTHON_VERSIONS} $@"
46+
# Trim whitespace
47+
PYTHON_VERSIONS=$(xargs <<< "${PYTHON_VERSIONS}")
48+
1049
# Versions can be restricted by passing them in as arguments to the script
1150
# For example,
1251
# macpython-build-wheels.sh 3.9
13-
if [[ $# -eq 0 ]]; then
52+
if [[ -n "${PYTHON_VERSIONS}" ]]; then
1453
PYBINARIES=(${MACPYTHON_PY_PREFIX}/*)
1554
else
1655
PYBINARIES=()
17-
for version in "$@"; do
56+
for version in "$PYTHON_VERSIONS"; do
1857
PYBINARIES+=(${MACPYTHON_PY_PREFIX}/*${version}*)
1958
done
2059
fi

scripts/macpython-build-module-wheels.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ for VENV in "${VENVS[@]}"; do
7272
-DBUILD_TESTING:BOOL=OFF \
7373
-DPython3_EXECUTABLE:FILEPATH=${Python3_EXECUTABLE} \
7474
-DPython3_INCLUDE_DIR:PATH=${Python3_INCLUDE_DIR} \
75+
${CMAKE_OPTIONS} \
7576
|| exit 1
7677
# ${Python3_EXECUTABLE} setup.py clean # Permission denied
7778
done

scripts/macpython-build-wheels.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ for VENV in "${VENVS[@]}"; do
124124
-DPython3_INCLUDE_DIR:PATH=${Python3_INCLUDE_DIR} \
125125
-DModule_ITKTBB:BOOL=${use_tbb} \
126126
-DTBB_DIR:PATH=${tbb_dir} \
127-
-DITK_WRAP_DOC:BOOL=ON
127+
-DITK_WRAP_DOC:BOOL=ON \
128+
${CMAKE_OPTIONS}
128129
# Cleanup
129130
${Python3_EXECUTABLE} setup.py clean
130131

@@ -159,6 +160,7 @@ for VENV in "${VENVS[@]}"; do
159160
-DITK_WRAP_DOC:BOOL=ON \
160161
-DModule_ITKTBB:BOOL=${use_tbb} \
161162
-DTBB_DIR:PATH=${tbb_dir} \
163+
${CMAKE_OPTIONS} \
162164
-G Ninja \
163165
${source_path} \
164166
&& ninja\
@@ -185,6 +187,7 @@ for VENV in "${VENVS[@]}"; do
185187
-DPython3_EXECUTABLE:FILEPATH=${Python3_EXECUTABLE} \
186188
-DPython3_INCLUDE_DIR:PATH=${Python3_INCLUDE_DIR} \
187189
-DITK_WRAP_DOC:BOOL=ON \
190+
${CMAKE_OPTIONS} \
188191
|| exit 1
189192
# Cleanup
190193
${Python3_EXECUTABLE} setup.py clean

0 commit comments

Comments
 (0)