diff options
author | Stefan Behnel <stefan_ml@behnel.de> | 2016-08-18 15:03:00 +0200 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2016-08-18 15:03:00 +0200 |
commit | 5ddce3d1fc59c77b08396eccc4810d8eef870ece (patch) | |
tree | 71f728ceb2473b82a7fd773b4789d35daf82ddf7 | |
parent | 3ce6462f0ca2f5a59de968f6740f744a836a73e7 (diff) | |
download | python-lxml-5ddce3d1fc59c77b08396eccc4810d8eef870ece.tar.gz |
build and reuse sdist when building wheels and properly pass CFLAGS into docker container
-rw-r--r-- | Makefile | 10 | ||||
-rwxr-xr-x | tools/manylinux/build-wheels.sh | 17 |
2 files changed, 19 insertions, 8 deletions
@@ -24,11 +24,17 @@ sdist: build: $(PYTHON) setup.py $(SETUPFLAGS) build $(PYTHON_WITH_CYTHON) -wheel_manylinux: +require-cython: + @[ -n "$(PYTHON_WITH_CYTHON)" ] || { \ + echo "NOTE: missing Cython - please use '$(PYTHON) -m pip install Cython' to install it"; false; } + +wheel_manylinux: require-cython sdist docker run --rm -t \ -v $(shell pwd):/io \ + -e CFLAGS="$(CFLAGS)" \ + -e LDFLAGS="$(LDFLAGS)" \ $(MANYLINUX_IMAGE_X86_64) \ - bash /io/tools/manylinux/build-wheels.sh + bash /io/tools/manylinux/build-wheels.sh /io/dist/lxml-$(LXMLVERSION).tar.gz wheel: $(PYTHON) setup.py $(SETUPFLAGS) bdist_wheel $(PYTHON_WITH_CYTHON) diff --git a/tools/manylinux/build-wheels.sh b/tools/manylinux/build-wheels.sh index eec1cffe..0ed2820f 100755 --- a/tools/manylinux/build-wheels.sh +++ b/tools/manylinux/build-wheels.sh @@ -6,14 +6,18 @@ echo "Started $0 $@" set -e -x REQUIREMENTS=/io/requirements.txt WHEELHOUSE=/io/wheelhouse +SDIST=$1 build_wheel() { + source="$1" + [ -n "$source" ] || source=/io + env STATIC_DEPS=true \ LDFLAGS="$LDFLAGS -fPIC" \ CFLAGS="$CFLAGS -fPIC" \ ${PYBIN}/pip \ wheel \ - /io \ + "$source" \ -w $WHEELHOUSE } @@ -29,17 +33,18 @@ assert_importable() { prepare_system() { yum install -y zlib-devel # Remove Python 2.6 symlinks - rm /opt/python/cp26* + rm -f /opt/python/cp26* } build_wheels() { # Compile wheels for all python versions for PYBIN in /opt/python/*/bin; do - # Install requirements if file exists - test ! -e $REQUIREMENTS \ - || ${PYBIN}/pip install -r $REQUIREMENTS + test -e "$SDIST" && source="$SDIST" || source= + # Install build requirements if we need them and file exists + test -z "$SDIST" -a -e "$REQUIREMENTS" \ + && ${PYBIN}/pip install -r "$REQUIREMENTS" - build_wheel + build_wheel "$source" done } |