Skip to content

Commit

Permalink
Add test for supported_wheels, with fix
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew-brett committed Oct 1, 2018
1 parent 0623c58 commit 24936a2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
5 changes: 3 additions & 2 deletions supported_wheels.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
from os.path import basename

try:
from wheel.install import WHEEL_INFO_RE
from wheel.install import WHEEL_INFO_RE as wheel_matcher
except ImportError: # As of Wheel 0.32.0
from wheel.wheelfile import WHEEL_INFO_RE
wheel_matcher = WHEEL_INFO_RE.match
try:
from pip.pep425tags import get_supported
except ImportError: # pip 10
Expand All @@ -18,7 +19,7 @@

def tags_for(fname):
# Copied from WheelFile code
parsed_filename = WHEEL_INFO_RE.match(basename(fname))
parsed_filename = wheel_matcher(basename(fname))
tags = parsed_filename.groupdict()
for pyver in tags['pyver'].split('.'):
for abi in tags['abi'].split('.'):
Expand Down
2 changes: 2 additions & 0 deletions tests/test_multibuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ if [ -n "$TEST_BUILDS" ]; then
fi
fi

source tests/test_supported_wheels.sh

# Exit 1 if any test errors
barf
# Don't need Travis' machinery trace
Expand Down
15 changes: 15 additions & 0 deletions tests/test_supported_wheels.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Test supported wheels script
PYTHON_EXE=${PYTHON_EXE:-python}
if [ -z "$PIP_CMD" ]; then
pip_install="pip install --user"
else
pip_install="$PIP_CMD install"
fi
# Current wheel versions not available for older Pythons
lpv=$(lex_ver $PYTHON_VERSION)
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
$PYTHON_EXE supported_wheels.py tornado-5.1-cp27-cp27m-macosx_10_6_intel.whl tornado-5.1-cp36-cp36m-macosx_10_13_x86_64.whl texext-0.6.1-cp36-none-any.whl
done
fi

0 comments on commit 24936a2

Please sign in to comment.