From f26c942ed146d63843e6a12f5fd452e5832a753d Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Mon, 10 Feb 2025 14:49:00 -0500 Subject: [PATCH 1/3] BUG: auditwheel updates for the metawheel Remove non-manylinux wheels, which recent auditwheel versions are not doing after the repair. Manually update the `itk` metapackage wheel tag and filename since scikit-build and auditwheel are currently not doing it. --- scripts/internal/manylinux-build-wheels.sh | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/scripts/internal/manylinux-build-wheels.sh b/scripts/internal/manylinux-build-wheels.sh index abf90ae9..6b0f9a3b 100755 --- a/scripts/internal/manylinux-build-wheels.sh +++ b/scripts/internal/manylinux-build-wheels.sh @@ -173,11 +173,26 @@ for PYBIN in "${PYBINARIES[@]}"; do done if test "${ARCH}" == "x64"; then - sudo /opt/python/cp39-cp39/bin/pip3 install auditwheel wheel + sudo /opt/python/cp311-cp311/bin/pip3 install auditwheel wheel # This step will fixup the wheel switching from 'linux' to 'manylinux' tag for whl in dist/itk_*linux_*.whl; do - /opt/python/cp39-cp39/bin/auditwheel repair --plat manylinux${MANYLINUX_VERSION}_x86_64 ${whl} -w /work/dist/ + /opt/python/cp311-cp311/bin/auditwheel repair --plat manylinux${MANYLINUX_VERSION}_x86_64 ${whl} -w /work/dist/ done + # auditwheel does not process this "metawheel" correctly since it does not + # have any native SO's. + mkdir -p metawheel-dist + for whl in dist/itk-*linux_*.whl; do + /opt/python/cp311-cp311/bin/wheel unpack --dest metawheel ${whl} + manylinux_version=manylinux${MANYLINUX_VERSION} + new_tag=$(basename ${whl/linux/${manylinux_version}} .whl) + sed -i "s/Tag: .*/Tag: ${new_tag}/" metawheel/itk-*/itk*.dist-info/WHEEL + /opt/python/cp311-cp311/bin/wheel pack --dest metawheel-dist metawheel/itk-* + mv metawheel-dist/*.whl dist/${new_tag}.whl + rm -rf metawheel + done + rm -rf metawheel-dist + rm dist/itk-*-linux_*.whl + rm dist/itk_*-linux_*.whl else for whl in dist/itk_*$(uname -m).whl; do auditwheel repair ${whl} -w /work/dist/ From 96f5fe41260fa0779ac79a338f002d36e3bd260e Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Mon, 10 Feb 2025 14:53:23 -0500 Subject: [PATCH 2/3] BUG: Use metapackage wheel tagging for aarch64 Similar to the x64 wheels. And use the updated version of auditwheel. --- scripts/internal/manylinux-build-wheels.sh | 36 ++++++++++++---------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/scripts/internal/manylinux-build-wheels.sh b/scripts/internal/manylinux-build-wheels.sh index 6b0f9a3b..11c30f61 100755 --- a/scripts/internal/manylinux-build-wheels.sh +++ b/scripts/internal/manylinux-build-wheels.sh @@ -172,33 +172,35 @@ for PYBIN in "${PYBINARIES[@]}"; do done +sudo /opt/python/cp311-cp311/bin/pip3 install auditwheel wheel + if test "${ARCH}" == "x64"; then - sudo /opt/python/cp311-cp311/bin/pip3 install auditwheel wheel # This step will fixup the wheel switching from 'linux' to 'manylinux' tag for whl in dist/itk_*linux_*.whl; do /opt/python/cp311-cp311/bin/auditwheel repair --plat manylinux${MANYLINUX_VERSION}_x86_64 ${whl} -w /work/dist/ done - # auditwheel does not process this "metawheel" correctly since it does not - # have any native SO's. - mkdir -p metawheel-dist - for whl in dist/itk-*linux_*.whl; do - /opt/python/cp311-cp311/bin/wheel unpack --dest metawheel ${whl} - manylinux_version=manylinux${MANYLINUX_VERSION} - new_tag=$(basename ${whl/linux/${manylinux_version}} .whl) - sed -i "s/Tag: .*/Tag: ${new_tag}/" metawheel/itk-*/itk*.dist-info/WHEEL - /opt/python/cp311-cp311/bin/wheel pack --dest metawheel-dist metawheel/itk-* - mv metawheel-dist/*.whl dist/${new_tag}.whl - rm -rf metawheel - done - rm -rf metawheel-dist - rm dist/itk-*-linux_*.whl - rm dist/itk_*-linux_*.whl else for whl in dist/itk_*$(uname -m).whl; do - auditwheel repair ${whl} -w /work/dist/ + /opt/python/cp311-cp311/bin/auditwheel repair ${whl} -w /work/dist/ done fi +# auditwheel does not process this "metawheel" correctly since it does not +# have any native SO's. +mkdir -p metawheel-dist +for whl in dist/itk-*linux_*.whl; do + /opt/python/cp311-cp311/bin/wheel unpack --dest metawheel ${whl} + manylinux_version=manylinux${MANYLINUX_VERSION} + new_tag=$(basename ${whl/linux/${manylinux_version}} .whl) + sed -i "s/Tag: .*/Tag: ${new_tag}/" metawheel/itk-*/itk*.dist-info/WHEEL + /opt/python/cp311-cp311/bin/wheel pack --dest metawheel-dist metawheel/itk-* + mv metawheel-dist/*.whl dist/${new_tag}.whl + rm -rf metawheel +done +rm -rf metawheel-dist +rm dist/itk-*-linux_*.whl +rm dist/itk_*-linux_*.whl + # Install packages and test for PYBIN in "${PYBINARIES[@]}"; do ${PYBIN}/pip install --user numpy From d7148c184f01747996c1a942716764a326f86199 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Tue, 11 Feb 2025 06:30:39 -0500 Subject: [PATCH 3/3] ENH: Bump version to 5.4.2.post1 Includes manylinux auditwheel fixes. --- itkVersion.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/itkVersion.py b/itkVersion.py index 1e3fcde4..a6a3205a 100644 --- a/itkVersion.py +++ b/itkVersion.py @@ -1,4 +1,4 @@ -VERSION = '5.4.2' +VERSION = '5.4.2.post1' def get_versions(): """Returns versions for the ITK Python package.