@@ -18,6 +18,9 @@ MAIN_PYTHON_BIN="/opt/python/cp39-cp39/bin/"
1818echo " BUILD_PYTHON: ${BUILD_PYTHON} "
1919REPO_ROOT=/var/code/python-crc32c/
2020
21+ # Install `openssl-devel` so that `cmake` can be built.
22+ yum install -y openssl-devel
23+
2124# Upgrade `pip` before using it.
2225${MAIN_PYTHON_BIN} /python -m pip install --upgrade pip
2326# Install `cmake` (i.e. non-Python build dependency).
@@ -31,11 +34,12 @@ cd ${REPO_ROOT}/google_crc32c/
3134rm -rf build
3235mkdir build
3336cd build/
34- ${MAIN_PYTHON_BIN} / cmake \
37+ cmake \
3538 -DCMAKE_BUILD_TYPE=Release \
3639 -DCRC32C_BUILD_TESTS=no \
3740 -DCRC32C_BUILD_BENCHMARKS=no \
3841 -DBUILD_SHARED_LIBS=yes \
42+ -DCMAKE_POLICY_VERSION_MINIMUM=3.12 \
3943 ..
4044make all install
4145
@@ -56,7 +60,7 @@ if [[ -z ${BUILD_PYTHON} ]]; then
5660 elif [[ " ${PYTHON_BIN} " == * " 312" * ]]; then
5761 PYTHON_VERSIONS=" ${PYTHON_VERSIONS} ${PYTHON_BIN} "
5862 continue
59- elif [[ " ${PYTHON_BIN} " == * " 313" * ]]; then
63+ elif [[ " ${PYTHON_BIN} " == * " 313" * && " ${PYTHON_BIN} " != * " 313t " * ]]; then
6064 PYTHON_VERSIONS=" ${PYTHON_VERSIONS} ${PYTHON_BIN} "
6165 continue
6266 else
8488
8589# Bundle external shared libraries into the wheels
8690for whl in dist_wheels/google_crc32c* .whl; do
87- ${MAIN_PYTHON_BIN} /auditwheel repair " ${whl} " --wheel-dir wheels/
91+ " ${MAIN_PYTHON_BIN} /auditwheel" repair " ${whl} " --wheel-dir wheels/
92+ done
93+
94+ # Install and test wheels
95+ for PYTHON_BIN in ${PYTHON_VERSIONS} ; do
96+ # Identify the short python version e.g. "39", "310"
97+ # Get the ABI tag from the Python binary's path, e.g., "cp310-cp310"
98+ ABI_TAG=$( basename $( dirname ${PYTHON_BIN} ) )
99+ ARCH=$( uname -m)
100+ # Create a virtual environment to install and test the wheel
101+ ${PYTHON_BIN} /python -m venv /tmp/venv
102+
103+ # Find the correct wheel file using the precise ABI tag and architecture.
104+ WHEEL_FILE=$( ls ${REPO_ROOT} /wheels/google_crc32c-* -${ABI_TAG} -* manylinux* ${ARCH} * .whl) # Install the wheel
105+ /tmp/venv/bin/pip install " ${WHEEL_FILE} "
106+
107+ # Verify that the module is installed and peek at contents.
108+ /tmp/venv/bin/python ${REPO_ROOT} /scripts/check_crc32c_extension.py
109+
110+ # Clean up the virtual environment
111+ rm -rf /tmp/venv
88112done
89113
90114# Clean up.
0 commit comments