Skip to content

Commit 9e8623a

Browse files
committed
ENH: Add code to allow making tarballs for manylinux.
1 parent 502ed62 commit 9e8623a

1 file changed

Lines changed: 38 additions & 6 deletions

File tree

‎scripts/make_tarballs.sh‎

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,46 @@
1+
#!/usr/bin/env bash
12
# NOTES: Building tarballs requires specific pathing for supporting github CI
23
# workflows
34

4-
5-
ITK_GIT_TAG=${ITK_GIT_TAG:=v6.0b02}
5+
script_dir=$(cd $(dirname $0) || exit 1; pwd)
6+
_ipp_dir=$(dirname ${script_dir})
67

78
# If args are given, use them. Otherwise use default python environments
89
pyenvs=("${@:-py39 py310 py311}")
910

11+
# Otherwise process mac and linux based on uname
12+
13+
BUILD_WHEELS_EXTRA_FLAGS=" --build-itk-tarball-cache "
14+
if [ -z "${ITK_GIT_TAG}" ]; then
15+
DEFAULT_ITK_GIT_TAG=v6.0b02
16+
echo "============================================================================="
17+
echo "============================================================================="
18+
for i in x x x x x x x x x x x x x x x x x x x x x x x x x x x x x; do
19+
echo "===== WARNING: ITK_GIT_TAG not set, so defaulting to ${DEFAULT_ITK_GIT_TAG}"
20+
done
21+
echo "============================================================================="
22+
echo "============================================================================="
23+
fi
24+
ITK_GIT_TAG=${ITK_GIT_TAG:=${DEFAULT_ITK_GIT_TAG}}
1025

26+
## --
27+
# --
28+
# --
29+
# --
30+
# Short circuit builds to use dockercross if MANYLINUX_VERSION is requested
31+
if [ ! -z "${MANYLINUX_VERSION}" ]; then
32+
# Need to explicitly request to --build-itk-tarball-cache
33+
ITK_GIT_TAG=${ITK_GIT_TAG} \
34+
MANYLINUX_VERSION=${MANYLINUX_VERSION} \
35+
bash ${_ipp_dir}/scripts/dockcross-manylinux-build-wheels.sh \
36+
"${pyenvs[@]}"
37+
exit $?
38+
fi
39+
40+
## --
41+
# --
42+
# --
43+
# --
1144
case "$(uname -s)" in
1245
Darwin)
1346
PLATFORM_PREFIX="macos"
@@ -50,10 +83,9 @@ fi
5083
unset _missing_required
5184

5285
if [ ! -d ${DASHBOARD_BUILD_DIRECTORY} ]; then
53-
# This is the expected directory for the cache
86+
# This is the expected directory for the cache, It may require creation with administrator credentials
5487
mkdir -p ${DASHBOARD_BUILD_DIRECTORY}
5588
fi
56-
script_dir=$(cd $(dirname $0) || exit 1; pwd)
5789
if [ "${script_dir}" != "${DASHBOARD_BUILD_DIRECTORY}/ITKPythonPackage/scripts" ]; then
5890
echo "ERROR: Github CI requires rigid directory structure"
5991
echo " RUN: git checkout git@github.com:InsightSoftwareConsortium/ITKPythonPackage.git ${DASHBOARD_BUILD_DIRECTORY}/ITKPythonPackage"
@@ -73,10 +105,10 @@ fi
73105
for pyenv in ${pyenvs[@]}; do
74106
cd ${DASHBOARD_BUILD_DIRECTORY}/ITKPythonPackage
75107
${PIXI_HOME}/bin/pixi run -e ${PLATFORM_PREFIX}-${pyenv} \
76-
python3 scripts/build_wheels.py \
108+
python3 ${DASHBOARD_BUILD_DIRECTORY}/ITKPythonPackage/scripts/build_wheels.py \
77109
--platform-env ${PLATFORM_PREFIX}-${pyenv} \
78110
--build-dir-root ${DASHBOARD_BUILD_DIRECTORY}/ITKPythonPackage-build \
79111
--itk-source-dir ${DASHBOARD_BUILD_DIRECTORY}/ITKPythonPackage-build/ITK \
80112
--itk-git-tag ${ITK_GIT_TAG} \
81-
--build-itk-tarball-cache
113+
${BUILD_WHEELS_EXTRA_FLAGS}
82114
done

0 commit comments

Comments
 (0)