contrib/packaging/build-linux-wheels.sh
author Matt Harbison <matt_harbison@yahoo.com>
Wed, 24 Nov 2021 20:43:05 -0500
changeset 48350 cbbbbbef800d
parent 38011 6f5b4ceea95b
permissions -rwxr-xr-x
packaging: regenerate the requirements files with pip-tools 6.4.0 Somewhere along the line, the formatting changed. There's no change in package content here- it's just some minor text changes. Py2 doesn't have any packages we'll be updating, so I'm not bothering there. Differential Revision: https://phab.mercurial-scm.org/D11803

#!/bin/bash
# This file is directly inspired by
# https://github.com/pypa/python-manylinux-demo/blob/master/travis/build-wheels.sh
set -e -x

PYTHON_TARGETS=$(ls -d /opt/python/cp27*/bin)

# Create an user for the tests
useradd hgbuilder

# Bypass uid/gid problems
cp -R /src /io && chown -R hgbuilder:hgbuilder /io

# Compile wheels for Python 2.X
for PYBIN in $PYTHON_TARGETS; do
    "${PYBIN}/pip" wheel /io/ -w wheelhouse/
done

# Bundle external shared libraries into the wheels with
# auditwheel (https://github.com/pypa/auditwheel) repair.
# It also fix the ABI tag on the wheel making it pip installable.
for whl in wheelhouse/*.whl; do
    auditwheel repair "$whl" -w /src/wheelhouse/
done

# Install packages and run the tests for all Python versions
cd /io/tests/

for PYBIN in $PYTHON_TARGETS; do
    # Install mercurial wheel as root
    "${PYBIN}/pip" install mercurial --no-index -f /src/wheelhouse
    # But run tests as hgbuilder user (non-root)
    su hgbuilder -c "\"${PYBIN}/python\" /io/tests/run-tests.py --with-hg=\"${PYBIN}/hg\" --blacklist=/io/contrib/packaging/linux-wheel-centos5-blacklist"
done