From 65de03743de9b808a1aa9cce505abe5991d26684 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Tue, 22 Oct 2024 15:46:41 +0800 Subject: [PATCH] Fix the supported wheel test. --- tests/test_supported_wheels.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/test_supported_wheels.sh b/tests/test_supported_wheels.sh index 6b59a7a7..f114cfde 100644 --- a/tests/test_supported_wheels.sh +++ b/tests/test_supported_wheels.sh @@ -30,16 +30,23 @@ fi py_impl=$($PYTHON_EXE -c 'import platform; print(platform.python_implementation())') if [ "$py_impl" == 'CPython' ] && [ $(uname) == 'Darwin' ]; then our_ver=$($PYTHON_EXE -c 'import sys; print("{}{}".format(*sys.version_info[:2]))') + our_arch=$($PYTHON_EXE -c 'import os; print(os.uname().machine())') + other_arch=$($PYTHON_EXE -c 'import os; print("x86_64" if os.uname().machine() == "arm64" else "x86_64")') other_ver=$([ "$our_ver" == "37" ] && echo "36" || echo "37") # Python <= 3.7 needs m for API tag. api_m=$([ $our_ver -le 37 ] && echo "m") || : - whl_suff="cp${our_ver}-cp${our_ver}${api_m}-macosx_10_9_x86_64.whl" + whl_suff="cp${our_ver}-cp${our_ver}${api_m}-macosx_10_9_${our_arch}.whl" good_whl="tornado-5.1-${whl_suff}" - bad_whl="tornado-5.1-cp${other_ver}-cp${other_ver}m-macosx_10_9_x86_64.whl" + bad_whl="tornado-5.1-cp${other_ver}-cp${other_ver}m-macosx_10_9_${our_arch}.whl" + bad_arch_whl="tornado-5.1-cp${our_ver}-cp${our_ver}${api_m}-macosx_10_9_${other_arch}.whl" if [ "$($PYTHON_EXE supported_wheels.py $bad_whl)" != "" ]; then echo "$bad_whl not supported, but supported wheels says it is." RET=1 fi + if [ "$($PYTHON_EXE supported_wheels.py $bad_arch_whl)" != "" ]; then + echo "$bad_arch_whl not supported, but supported wheels says it is." + RET=1 + fi if [ "$($PYTHON_EXE supported_wheels.py $good_whl)" != "$good_whl" ]; then echo "$good_whl supported, but supported wheels says it is not." RET=1 @@ -56,4 +63,3 @@ $good_whl2" RET=1 fi fi -