Skip to content

Commit 368b246

Browse files
thewtexjcfr
andcommitted
macpython,manylinux: Use SKBUILD_CMAKE_INSTALL_PREFIX for PY_SITE_PACKAGES
Required for skbuild 0.7.0 and newer to address: Traceback (most recent call last): File "setup.py", line 62, in <module> install_requires=[ File "/opt/python/cp37-cp37m/lib/python3.7/site-packages/skbuild/setuptools_wrap.py", line 558, in setup cmake_source_dir, skbuild_kw['cmake_install_dir']) File "/opt/python/cp37-cp37m/lib/python3.7/site-packages/skbuild/setuptools_wrap.py", line 686, in _classify_installed_files install_root, to_platform_path(path))) skbuild.exceptions.SKBuildError: CMake-installed files must be within the project root. Project Root : /work/_skbuild/linux-x86_64-3.7/cmake-install Violating File: _skbuild/cmake-install/itkConfig.py Co-authored-by: Jean-Christophe Fillion-Robin <[email protected]>
1 parent a36c1d5 commit 368b246

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

scripts/internal/manylinux-build-wheels.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ SINGLE_WHEEL=0
2828

2929
# Compile wheels re-using standalone project and archive cache
3030
for PYBIN in "${PYBINARIES[@]}"; do
31-
PYTHON_EXECUTABLE=${PYBIN}/python
31+
export PYTHON_EXECUTABLE=${PYBIN}/python
3232
PYTHON_INCLUDE_DIR=$( find -L ${PYBIN}/../include/ -name Python.h -exec dirname {} \; )
3333

3434
echo ""
@@ -43,6 +43,7 @@ for PYBIN in "${PYBINARIES[@]}"; do
4343
source_path=/work/standalone-${ARCH}-build/ITK-source
4444
build_path=/work/ITK-$(basename $(dirname ${PYBIN}))-manylinux1_${ARCH}
4545
SETUP_PY_CONFIGURE="${script_dir}/../setup_py_configure.py"
46+
SKBUILD_CMAKE_INSTALL_PREFIX=$(${PYTHON_EXECUTABLE} -c "from skbuild.constants import CMAKE_INSTALL_DIR; print(CMAKE_INSTALL_DIR)")
4647

4748
# Clean up previous invocations
4849
rm -rf ${build_path}
@@ -93,7 +94,7 @@ for PYBIN in "${PYBINARIES[@]}"; do
9394
-DWRAP_ITK_INSTALL_COMPONENT_IDENTIFIER:STRING=PythonWheel \
9495
-DWRAP_ITK_INSTALL_COMPONENT_PER_MODULE:BOOL=ON \
9596
-DITK_WRAP_unsigned_short:BOOL=ON \
96-
-DPY_SITE_PACKAGES_PATH:PATH=${script_dir}/../../_skbuild/cmake-install \
97+
-DPY_SITE_PACKAGES_PATH:PATH=${SKBUILD_CMAKE_INSTALL_PREFIX} \
9798
-DITK_LEGACY_SILENT:BOOL=ON \
9899
-DITK_WRAP_PYTHON:BOOL=ON \
99100
-DITK_WRAP_PYTHON_LEGACY:BOOL=OFF \

scripts/macpython-build-wheels.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ SINGLE_WHEEL=0
6363
# Compile wheels re-using standalone project and archive cache
6464
for VENV in "${VENVS[@]}"; do
6565
py_mm=$(basename ${VENV})
66-
PYTHON_EXECUTABLE=${VENV}/bin/python
66+
export PYTHON_EXECUTABLE=${VENV}/bin/python
6767
PYTHON_INCLUDE_DIR=$( find -L ${MACPYTHON_PY_PREFIX}/${py_mm}/include -name Python.h -exec dirname {} \; )
6868

6969
echo ""
@@ -80,6 +80,7 @@ for VENV in "${VENVS[@]}"; do
8080
source_path=${SCRIPT_DIR}/../standalone-build/ITK-source
8181
build_path="${SCRIPT_DIR}/../ITK-${py_mm}-macosx_x86_64"
8282
SETUP_PY_CONFIGURE="${script_dir}/setup_py_configure.py"
83+
SKBUILD_CMAKE_INSTALL_PREFIX=$(${PYTHON_EXECUTABLE} -c "from skbuild.constants import CMAKE_INSTALL_DIR; print(CMAKE_INSTALL_DIR)")
8384

8485
# Clean up previous invocations
8586
rm -rf ${build_path}
@@ -130,7 +131,7 @@ for VENV in "${VENVS[@]}"; do
130131
-DPYTHON_LIBRARY:FILEPATH=${PYTHON_LIBRARY} \
131132
-DWRAP_ITK_INSTALL_COMPONENT_IDENTIFIER:STRING=PythonWheel \
132133
-DWRAP_ITK_INSTALL_COMPONENT_PER_MODULE:BOOL=ON \
133-
-DPY_SITE_PACKAGES_PATH:PATH=${SCRIPT_DIR}/../_skbuild/cmake-install \
134+
-DPY_SITE_PACKAGES_PATH:PATH=${SKBUILD_CMAKE_INSTALL_PREFIX} \
134135
-DITK_LEGACY_SILENT:BOOL=ON \
135136
-DITK_WRAP_PYTHON:BOOL=ON \
136137
-DITK_WRAP_PYTHON_LEGACY:BOOL=OFF \

0 commit comments

Comments
 (0)