comparison contrib/build-linux-wheels.sh @ 32080:fcddcf442e4f stable

packaging: add make target for linux wheels Having linux wheels is going to helps system without compiler or python-dev plus speed up the installation for everyone. I followed the manylinux example repository https://github.com/pypa/python-manylinux-demo to add a make target (build-linux-wheels) using official docker image to build python 2 linux wheels for mercurial. It generates Python 2.6 and Python 2.7 for both 32 and 64 bits architectures. I had to blacklist several test cases for various reasons: * test-convert-git.t and test-subrepo-git.t because of the git version * test-patchbomb-tls.t because of warning using tls 1.0 It's likely because the docker image is based on centos 5.0 and openssl is outdated.
author Boris Feld <boris.feld@octobus.net>
date Tue, 25 Apr 2017 16:50:01 +0200
parents
children 637267114513
comparison
equal deleted inserted replaced
32079:76ed60630dd5 32080:fcddcf442e4f
1 #!/bin/bash
2 # This file is directly inspired by
3 # https://github.com/pypa/python-manylinux-demo/blob/master/travis/build-wheels.sh
4 set -e -x
5
6 PYTHON_TARGETS=$(ls -d /opt/python/cp2*/bin)
7
8 # Create an user for the tests
9 useradd hgbuilder
10
11 # Bypass uid/gid problems
12 cp -R /src /io && chown -R hgbuilder:hgbuilder /io
13
14 # Compile wheels for Python 2.X
15 for PYBIN in $PYTHON_TARGETS; do
16 "${PYBIN}/pip" wheel /io/ -w wheelhouse/
17 done
18
19 # Bundle external shared libraries into the wheels with
20 # auditwheel (https://github.com/pypa/auditwheel) repair.
21 # It also fix the ABI tag on the wheel making it pip installable.
22 for whl in wheelhouse/*.whl; do
23 auditwheel repair "$whl" -w /src/wheelhouse/
24 done
25
26 # Install packages and run the tests for all Python versions
27 cd /io/tests/
28
29 for PYBIN in $PYTHON_TARGETS; do
30 # Install mercurial wheel as root
31 "${PYBIN}/pip" install mercurial --no-index -f /src/wheelhouse
32 # But run tests as hgbuilder user (non-root)
33 su hgbuilder -c "\"${PYBIN}/python\" /io/tests/run-tests.py --with-hg=\"${PYBIN}/hg\" --blacklist=/io/contrib/linux-wheel-centos5-blacklist"
34 done