test_supported_wheels.sh 2.45 KB
Newer Older
1
2
3
# Test supported wheels script
PYTHON_EXE=${PYTHON_EXE:-python}
if [ -z "$PIP_CMD" ]; then
4
    pip_install="$PYTHON_EXE -m pip install --user"
5
6
7
else
    pip_install="$PIP_CMD install"
fi
8
# Needed for supported_wheels script
9
$pip_install packaging
Matthew Brett's avatar
Matthew Brett committed
10
# Current wheel versions not available for older Pythons.
Matthew Brett's avatar
Matthew Brett committed
11
lpv=$(lex_ver $MB_PYTHON_VERSION)
Matthew Brett's avatar
Matthew Brett committed
12
# Check no errors.
13
14
15
if [ $lpv -ge $(lex_ver 3.5) ] || [ $lpv -lt $(lex_ver 3) ]; then
    for whl in wheel==0.31.1 wheel==0.32.0 wheel; do
        $pip_install -U $whl
16
17
18
19
20
21
22
23
24
25
        $PYTHON_EXE supported_wheels.py \
        tornado-5.1-cp27-cp27m-macosx_10_6_intel.whl \
        tornado-5.1-cp27-cp27m-macosx_10_9_intel.whl \
        tornado-5.1-cp27-cp27m-macosx_10_9_x86_64.whl \
        tornado-5.1-cp27-cp27m-macosx_10_13_x86_64.whl \
        tornado-5.1-cp36-cp36m-macosx_10_6_intel.whl \
        tornado-5.1-cp36-cp36m-macosx_10_9_intel.whl \
        tornado-5.1-cp36-cp36m-macosx_10_9_x86_64.whl \
        tornado-5.1-cp36-cp36m-macosx_10_13_x86_64.whl \
        texext-0.6.1-cp36-none-any.whl
26
27
    done
fi
Matthew Brett's avatar
Matthew Brett committed
28
29

# Test that wheels for versions other than our own, not supported.
30
31
py_impl=$($PYTHON_EXE -c 'import platform; print(platform.python_implementation())')
if [ "$py_impl" == 'CPython' ] && [ $(uname) == 'Darwin' ]; then
Matthew Brett's avatar
Matthew Brett committed
32
    our_ver=$($PYTHON_EXE -c 'import sys; print("{}{}".format(*sys.version_info[:2]))')
33
    other_ver=$([ "$our_ver" == "37" ] && echo "36" || echo "37")
Matthew Brett's avatar
Matthew Brett committed
34
    # Python <= 3.7 needs m for API tag.
35
    api_m=$([ $our_ver -le 37 ] && echo "m") || :
36
37
    whl_suff="cp${our_ver}-cp${our_ver}${api_m}-macosx_10_9_x86_64.whl"
    good_whl="tornado-5.1-${whl_suff}"
Matthew Brett's avatar
Matthew Brett committed
38
    bad_whl="tornado-5.1-cp${other_ver}-cp${other_ver}m-macosx_10_9_x86_64.whl"
Matthew Brett's avatar
Matthew Brett committed
39
40
    if [ "$($PYTHON_EXE supported_wheels.py $bad_whl)" != "" ]; then
        echo "$bad_whl not supported, but supported wheels says it is."
Matthew Brett's avatar
Matthew Brett committed
41
42
        RET=1
    fi
Matthew Brett's avatar
Matthew Brett committed
43
44
45
46
    if [ "$($PYTHON_EXE supported_wheels.py $good_whl)" != "$good_whl" ]; then
        echo "$good_whl supported, but supported wheels says it is not."
        RET=1
    fi
47
    good_whl2="mypkg-0.3-${whl_suff}"
Matthew Brett's avatar
Matthew Brett committed
48
49
50
51
    both="$good_whl
$good_whl2"
    if [ "$($PYTHON_EXE supported_wheels.py $good_whl $good_whl2)" != "$both" ]; then
        echo "$good_whl, $good_whl2 supported, supported_wheels does not return both."
Matthew Brett's avatar
Matthew Brett committed
52
53
        RET=1
    fi
54
55
56
57
    if [ "$($PYTHON_EXE supported_wheels.py $good_whl $bad_whl $good_whl2)" != "$both" ]; then
        echo "$good_whl, $good_whl2 supported, $bad_whl not; supported_wheels disagrees."
        RET=1
    fi
Matthew Brett's avatar
Matthew Brett committed
58
59
fi