@@ -172,18 +172,35 @@ for PYBIN in "${PYBINARIES[@]}"; do
172172
173173done
174174
175+ sudo /opt/python/cp311-cp311/bin/pip3 install auditwheel wheel
176+
175177if test " ${ARCH} " == " x64" ; then
176- sudo /opt/python/cp39-cp39/bin/pip3 install auditwheel wheel
177178 # This step will fixup the wheel switching from 'linux' to 'manylinux<version>' tag
178179 for whl in dist/itk_* linux_* .whl; do
179- /opt/python/cp39-cp39 /bin/auditwheel repair --plat manylinux${MANYLINUX_VERSION} _x86_64 ${whl} -w /work/dist/
180+ /opt/python/cp311-cp311 /bin/auditwheel repair --plat manylinux${MANYLINUX_VERSION} _x86_64 ${whl} -w /work/dist/
180181 done
181182else
182183 for whl in dist/itk_* $( uname -m) .whl; do
183- auditwheel repair ${whl} -w /work/dist/
184+ /opt/python/cp311-cp311/bin/ auditwheel repair ${whl} -w /work/dist/
184185 done
185186fi
186187
188+ # auditwheel does not process this "metawheel" correctly since it does not
189+ # have any native SO's.
190+ mkdir -p metawheel-dist
191+ for whl in dist/itk-* linux_* .whl; do
192+ /opt/python/cp311-cp311/bin/wheel unpack --dest metawheel ${whl}
193+ manylinux_version=manylinux${MANYLINUX_VERSION}
194+ new_tag=$( basename ${whl/ linux/ ${manylinux_version} } .whl)
195+ sed -i " s/Tag: .*/Tag: ${new_tag} /" metawheel/itk-* /itk* .dist-info/WHEEL
196+ /opt/python/cp311-cp311/bin/wheel pack --dest metawheel-dist metawheel/itk-*
197+ mv metawheel-dist/* .whl dist/${new_tag} .whl
198+ rm -rf metawheel
199+ done
200+ rm -rf metawheel-dist
201+ rm dist/itk-* -linux_* .whl
202+ rm dist/itk_* -linux_* .whl
203+
187204# Install packages and test
188205for PYBIN in " ${PYBINARIES[@]} " ; do
189206 ${PYBIN} /pip install --user numpy
0 commit comments