Commit dae6bd6f authored by Matthew Brett's avatar Matthew Brett
Browse files

Add pip spec build / wheel filtering

parent db8656e7
Subproject commit 2781b203f3889e04bee30c5df866b03a902235b7
Subproject commit 880bc9c1d4c875021376c8d2bb91789055d0dba2
#!/usr/bin/env python
""" Filter out wheel filenames not supported on this platform
"""
from __future__ import print_function
import sys
from wheel.install import WheelFile
from pip.pep425tags import get_supported
def main():
supported = set(get_supported())
for fname in sys.argv[1:]:
tags = set(WheelFile(fname).tags)
if supported.intersection(tags):
print(fname)
if __name__ == '__main__':
main()
......@@ -22,7 +22,7 @@ function build_wheels {
# BUILD_COMMIT
# BUILD_PRE_SCRIPT
# BUILD_SCRIPT
# REPO_DIR
# REPO_DIR | PKG_SPEC
# TRAVIS_PYTHON_VERSION
#
# Build both 32- and 64-bit
......@@ -58,7 +58,7 @@ function build_plat_wheels {
# BUILD_COMMIT
# BUILD_PRE_SCRIPT (can be empty)
# BUILD_SCRIPT
# REPO_DIR
# REPO_DIR | PKG_SPEC
# TRAVIS_PYTHON_VERSION
local plat=${1:-x86_64}
local docker_image=quay.io/pypa/manylinux1_$plat
......@@ -72,6 +72,7 @@ function build_plat_wheels {
-e BUILD_DEPENDS="$BUILD_DEPENDS" \
-e BUILD_COMMIT="$BUILD_COMMIT" \
-e BUILD_PRE_SCRIPT="$BUILD_PRE_SCRIPT" \
-e PKG_SPEC="$PKG_SPEC" \
-e REPO_DIR="$REPO_DIR" \
-v $PWD:/io \
$docker_image $intro_cmd $BUILD_SCRIPT
......
......@@ -19,17 +19,21 @@ function build_wheels {
# Builds wheel, puts into $WHEELHOUSE
#
# Depends on
# REPO_DIR
# REPO_DIR | PKG_SPEC
# BUILD_DEPENDS
# BUILD_COMMIT
# WHEELHOUSE
cd $REPO_DIR
git fetch origin
git checkout $BUILD_COMMIT
git clean -fxd
if [ -n "$BUILD_DEPENDS" ]; then pip install $BUILD_DEPENDS; fi
pip wheel -w $WHEELHOUSE --no-deps .
cd ..
if [-n "$BUILD_DEPENDS" ]; then pip install $BUILD_DEPENDS; fi
if [ -n "$REPO_DIR" ]; then
cd $REPO_DIR
git fetch origin
git checkout $BUILD_COMMIT
git clean -fxd
pip wheel -w $WHEELHOUSE --no-deps .
cd ..
else
pip wheel -w $WHEELHOUSE --no-deps $PKG_SPEC
fi
pip install delocate
delocate-listdeps $WHEELHOUSE/*.whl # lists library dependencies
delocate-wheel $WHEELHOUSE/*.whl # copies library dependencies into wheel
......
......@@ -9,14 +9,16 @@ MULTIBUILD_DIR=$(dirname "${BASH_SOURCE[0]}")
if [ ! -d "$WHEELHOUSE" ]; then mkdir $WHEELHOUSE; fi
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
source $MULTIBUILD_DIR/travis_osx_steps.sh
whl_tail="*.whl"
else
source $MULTIBUILD_DIR/travis_linux_steps.sh
# Selects narrow build on Python 2.7
whl_tail="*m-manylinux1_x86_64.whl"
fi
if [ -z "$REPO_DIR$PKG_SPEC" ]; then
echo "Must specify REPO_DIR or PKG_SPEC"
exit 1
fi
function install_wheel {
if [ -n "$TEST_DEPENDS" ]; then pip install $TEST_DEPENDS; fi
pip install $WHEELHOUSE/$whl_tail
pip install $(python $MULTIBUILD_DIR/supported_wheels.py $WHEELHOUSE/*.whl)
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment