Skip to content

Commit d28e6af

Browse files
committed
macpython: improve tool install logic
In the itk wheels build, the venv's are not available until after they are created in the itk build script. VENVS[0] are not necessarily the same between runs -- ensure the tools are always present in the module wheel build script.
1 parent 37d2642 commit d28e6af

File tree

3 files changed

+20
-11
lines changed

3 files changed

+20
-11
lines changed

scripts/macpython-build-common.sh

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,6 @@ for PYBIN in "${PYBINARIES[@]}"; do
2828
VENVS+=(${VENV})
2929
done
3030

31-
VENV="${VENVS[0]}"
32-
PYTHON_EXECUTABLE=${VENV}/bin/python
33-
$PYTHON_EXECUTABLE -m pip install --no-cache cmake
34-
CMAKE_EXECUTABLE=${VENV}/bin/cmake
35-
$PYTHON_EXECUTABLE -m pip install --no-cache ninja
36-
NINJA_EXECUTABLE=${VENV}/bin/ninja
37-
$PYTHON_EXECUTABLE -m pip install --no-cache delocate
38-
DELOCATE_LISTDEPS=${VENV}/bin/delocate-listdeps
39-
DELOCATE_WHEEL=${VENV}/bin/delocate-wheel
40-
41-
4231
# Since the python interpreter exports its symbol (see [1]), python
4332
# modules should not link against any python libraries.
4433
# To ensure it is not the case, we configure the project using an empty

scripts/macpython-build-module-wheels.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@
1111
script_dir="`cd $(dirname $0); pwd`"
1212
source "${script_dir}/macpython-build-common.sh"
1313

14+
VENV="${VENVS[0]}"
15+
PYTHON_EXECUTABLE=${VENV}/bin/python
16+
$PYTHON_EXECUTABLE -m pip install --no-cache cmake
17+
CMAKE_EXECUTABLE=${VENV}/bin/cmake
18+
$PYTHON_EXECUTABLE -m pip install --no-cache ninja
19+
NINJA_EXECUTABLE=${VENV}/bin/ninja
20+
$PYTHON_EXECUTABLE -m pip install --no-cache delocate
21+
DELOCATE_LISTDEPS=${VENV}/bin/delocate-listdeps
22+
DELOCATE_WHEEL=${VENV}/bin/delocate-wheel
23+
1424
# Compile wheels re-using standalone project and archive cache
1525
for VENV in "${VENVS[@]}"; do
1626
py_mm=$(basename ${VENV})

scripts/macpython-build-wheels.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@ for PYBIN in "${PYBINARIES[@]}"; do
2626
VENVS+=(${VENV})
2727
done
2828

29+
VENV="${VENVS[0]}"
30+
PYTHON_EXECUTABLE=${VENV}/bin/python
31+
$PYTHON_EXECUTABLE -m pip install --no-cache cmake
32+
CMAKE_EXECUTABLE=${VENV}/bin/cmake
33+
$PYTHON_EXECUTABLE -m pip install --no-cache ninja
34+
NINJA_EXECUTABLE=${VENV}/bin/ninja
35+
$PYTHON_EXECUTABLE -m pip install --no-cache delocate
36+
DELOCATE_LISTDEPS=${VENV}/bin/delocate-listdeps
37+
DELOCATE_WHEEL=${VENV}/bin/delocate-wheel
38+
2939
# Build standalone project and populate archive cache
3040
mkdir -p standalone-build
3141
pushd standalone-build > /dev/null 2>&1

0 commit comments

Comments
 (0)