"vscode:/vscode.git/clone" did not exist on "19a599e12dd92b80469b7c626d805765d34e8a49"
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 { ...@@ -22,7 +22,7 @@ function build_wheels {
# BUILD_COMMIT # BUILD_COMMIT
# BUILD_PRE_SCRIPT # BUILD_PRE_SCRIPT
# BUILD_SCRIPT # BUILD_SCRIPT
# REPO_DIR # REPO_DIR | PKG_SPEC
# TRAVIS_PYTHON_VERSION # TRAVIS_PYTHON_VERSION
# #
# Build both 32- and 64-bit # Build both 32- and 64-bit
...@@ -58,7 +58,7 @@ function build_plat_wheels { ...@@ -58,7 +58,7 @@ function build_plat_wheels {
# BUILD_COMMIT # BUILD_COMMIT
# BUILD_PRE_SCRIPT (can be empty) # BUILD_PRE_SCRIPT (can be empty)
# BUILD_SCRIPT # BUILD_SCRIPT
# REPO_DIR # REPO_DIR | PKG_SPEC
# TRAVIS_PYTHON_VERSION # TRAVIS_PYTHON_VERSION
local plat=${1:-x86_64} local plat=${1:-x86_64}
local docker_image=quay.io/pypa/manylinux1_$plat local docker_image=quay.io/pypa/manylinux1_$plat
...@@ -72,6 +72,7 @@ function build_plat_wheels { ...@@ -72,6 +72,7 @@ function build_plat_wheels {
-e BUILD_DEPENDS="$BUILD_DEPENDS" \ -e BUILD_DEPENDS="$BUILD_DEPENDS" \
-e BUILD_COMMIT="$BUILD_COMMIT" \ -e BUILD_COMMIT="$BUILD_COMMIT" \
-e BUILD_PRE_SCRIPT="$BUILD_PRE_SCRIPT" \ -e BUILD_PRE_SCRIPT="$BUILD_PRE_SCRIPT" \
-e PKG_SPEC="$PKG_SPEC" \
-e REPO_DIR="$REPO_DIR" \ -e REPO_DIR="$REPO_DIR" \
-v $PWD:/io \ -v $PWD:/io \
$docker_image $intro_cmd $BUILD_SCRIPT $docker_image $intro_cmd $BUILD_SCRIPT
......
...@@ -19,17 +19,21 @@ function build_wheels { ...@@ -19,17 +19,21 @@ function build_wheels {
# Builds wheel, puts into $WHEELHOUSE # Builds wheel, puts into $WHEELHOUSE
# #
# Depends on # Depends on
# REPO_DIR # REPO_DIR | PKG_SPEC
# BUILD_DEPENDS # BUILD_DEPENDS
# BUILD_COMMIT # BUILD_COMMIT
# WHEELHOUSE # WHEELHOUSE
cd $REPO_DIR if [-n "$BUILD_DEPENDS" ]; then pip install $BUILD_DEPENDS; fi
git fetch origin if [ -n "$REPO_DIR" ]; then
git checkout $BUILD_COMMIT cd $REPO_DIR
git clean -fxd git fetch origin
if [ -n "$BUILD_DEPENDS" ]; then pip install $BUILD_DEPENDS; fi git checkout $BUILD_COMMIT
pip wheel -w $WHEELHOUSE --no-deps . git clean -fxd
cd .. pip wheel -w $WHEELHOUSE --no-deps .
cd ..
else
pip wheel -w $WHEELHOUSE --no-deps $PKG_SPEC
fi
pip install delocate pip install delocate
delocate-listdeps $WHEELHOUSE/*.whl # lists library dependencies delocate-listdeps $WHEELHOUSE/*.whl # lists library dependencies
delocate-wheel $WHEELHOUSE/*.whl # copies library dependencies into wheel delocate-wheel $WHEELHOUSE/*.whl # copies library dependencies into wheel
......
...@@ -9,14 +9,16 @@ MULTIBUILD_DIR=$(dirname "${BASH_SOURCE[0]}") ...@@ -9,14 +9,16 @@ MULTIBUILD_DIR=$(dirname "${BASH_SOURCE[0]}")
if [ ! -d "$WHEELHOUSE" ]; then mkdir $WHEELHOUSE; fi if [ ! -d "$WHEELHOUSE" ]; then mkdir $WHEELHOUSE; fi
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
source $MULTIBUILD_DIR/travis_osx_steps.sh source $MULTIBUILD_DIR/travis_osx_steps.sh
whl_tail="*.whl"
else else
source $MULTIBUILD_DIR/travis_linux_steps.sh source $MULTIBUILD_DIR/travis_linux_steps.sh
# Selects narrow build on Python 2.7 fi
whl_tail="*m-manylinux1_x86_64.whl"
if [ -z "$REPO_DIR$PKG_SPEC" ]; then
echo "Must specify REPO_DIR or PKG_SPEC"
exit 1
fi fi
function install_wheel { function install_wheel {
if [ -n "$TEST_DEPENDS" ]; then pip install $TEST_DEPENDS; fi 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