Skip to content

Commit

Permalink
Fix the supported wheel test.
Browse files Browse the repository at this point in the history
  • Loading branch information
freakboy3742 committed Oct 22, 2024
1 parent 7e7edc8 commit 65de037
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/test_supported_wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -56,4 +63,3 @@ $good_whl2"
RET=1
fi
fi

0 comments on commit 65de037

Please sign in to comment.