From d873f8426e56dde92e9d0f77d459ce82b4f34782 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ionel=20Cristian=20M=C4=83rie=C8=99?= Date: Tue, 21 Jul 2020 17:09:48 +0300 Subject: [PATCH] Do a bit of cleanup. Use the manylinux docker image for building arm64 wheels as well. --- .travis.yml | 107 ++++++++++++++++----------------------- ci/bootstrap.py | 3 +- ci/templates/.travis.yml | 31 ++++-------- 3 files changed, 55 insertions(+), 86 deletions(-) diff --git a/.travis.yml b/.travis.yml index 12cca9f..3629a1e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,7 @@ language: python -dist: xenial -cache: false env: global: - - LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so + - LD_PRELOAD=libSegFault.so - SEGFAULT_SIGNALS=all - LANG=en_US.UTF-8 - TWINE_USERNAME=ionel @@ -23,11 +21,11 @@ matrix: - env: - TOXENV=py27-cover,codecov,extension-coveralls,coveralls python: '2.7' - arch: amd64 + arch: arm64 - env: - TOXENV=py27-cover,codecov,extension-coveralls,coveralls python: '2.7' - arch: arm64 + arch: amd64 - os: osx osx_image: xcode11 language: generic @@ -36,72 +34,84 @@ matrix: - WHEEL_PATH=.tox/dist - env: - TOXENV=py27-nocov - - WHEEL_MANYLINUX1=cp27 + - WHEEL_MANYLINUX_TAG=manylinux2014-arm + - WHEEL_MANYLINUX_PYTHON=cp27 - WHEEL_PATH=wheelhouse python: '2.7' - arch: amd64 + arch: arm64 - env: - TOXENV=py27-nocov - - WHEEL_PATH=.tox/dist + - WHEEL_MANYLINUX_TAG=manylinux1 + - WHEEL_MANYLINUX_PYTHON=cp27 + - WHEEL_PATH=wheelhouse python: '2.7' + arch: amd64 + - env: + - TOXENV=py35-cover,codecov,extension-coveralls,coveralls + python: '3.5' arch: arm64 - env: - TOXENV=py35-cover,codecov,extension-coveralls,coveralls python: '3.5' arch: amd64 - env: - - TOXENV=py35-cover,codecov,extension-coveralls,coveralls + - TOXENV=py35-nocov + - WHEEL_MANYLINUX_TAG=manylinux2014-arm + - WHEEL_MANYLINUX_PYTHON=cp35 + - WHEEL_PATH=wheelhouse python: '3.5' arch: arm64 - env: - TOXENV=py35-nocov - - WHEEL_MANYLINUX1=cp35 + - WHEEL_MANYLINUX_TAG=manylinux1 + - WHEEL_MANYLINUX_PYTHON=cp35 - WHEEL_PATH=wheelhouse python: '3.5' arch: amd64 - env: - - TOXENV=py35-nocov - - WHEEL_PATH=.tox/dist - python: '3.5' + - TOXENV=py36-cover,codecov,extension-coveralls,coveralls + python: '3.6' arch: arm64 - env: - TOXENV=py36-cover,codecov,extension-coveralls,coveralls python: '3.6' arch: amd64 - env: - - TOXENV=py36-cover,codecov,extension-coveralls,coveralls + - TOXENV=py36-nocov + - WHEEL_MANYLINUX_TAG=manylinux2014-arm + - WHEEL_MANYLINUX_PYTHON=cp36 + - WHEEL_PATH=wheelhouse python: '3.6' arch: arm64 - env: - TOXENV=py36-nocov - - WHEEL_MANYLINUX1=cp36 + - WHEEL_MANYLINUX_TAG=manylinux1 + - WHEEL_MANYLINUX_PYTHON=cp36 - WHEEL_PATH=wheelhouse python: '3.6' arch: amd64 - env: - - TOXENV=py36-nocov - - WHEEL_PATH=.tox/dist - python: '3.6' + - TOXENV=py37-cover,codecov,extension-coveralls,coveralls + python: '3.7' arch: arm64 - env: - TOXENV=py37-cover,codecov,extension-coveralls,coveralls python: '3.7' arch: amd64 - env: - - TOXENV=py37-cover,codecov,extension-coveralls,coveralls + - TOXENV=py37-nocov + - WHEEL_MANYLINUX_TAG=manylinux2014-arm + - WHEEL_MANYLINUX_PYTHON=cp37 + - WHEEL_PATH=wheelhouse python: '3.7' arch: arm64 - env: - TOXENV=py37-nocov - - WHEEL_MANYLINUX1=cp37 + - WHEEL_MANYLINUX_TAG=manylinux1 + - WHEEL_MANYLINUX_PYTHON=cp37 - WHEEL_PATH=wheelhouse python: '3.7' arch: amd64 - - env: - - TOXENV=py37-nocov - - WHEEL_PATH=.tox/dist - python: '3.7' - arch: arm64 - os: osx osx_image: xcode11 language: generic @@ -110,11 +120,11 @@ matrix: - env: - TOXENV=py38-cover,codecov,extension-coveralls,coveralls python: '3.8' - arch: amd64 + arch: arm64 - env: - TOXENV=py38-cover,codecov,extension-coveralls,coveralls python: '3.8' - arch: arm64 + arch: amd64 - os: osx osx_image: xcode11 language: generic @@ -123,40 +133,19 @@ matrix: - WHEEL_PATH=.tox/dist - env: - TOXENV=py38-nocov - - WHEEL_MANYLINUX1=cp38 + - WHEEL_MANYLINUX_TAG=manylinux2014-arm + - WHEEL_MANYLINUX_PYTHON=cp38 - WHEEL_PATH=wheelhouse python: '3.8' - arch: amd64 + arch: arm64 - env: - TOXENV=py38-nocov - - WHEEL_PATH=.tox/dist + - WHEEL_MANYLINUX_TAG=manylinux1 + - WHEEL_MANYLINUX_PYTHON=cp38 + - WHEEL_PATH=wheelhouse python: '3.8' - arch: arm64 - - env: - - TOXENV=pypy-cover,codecov,extension-coveralls,coveralls - python: 'pypy' - arch: amd64 - - env: - - TOXENV=pypy-nocov - python: 'pypy' - arch: amd64 - - env: - - TOXENV=pypy3-cover,codecov,extension-coveralls,coveralls - - TOXPYTHON=pypy3 - python: 'pypy3' - arch: amd64 - - env: - - TOXENV=pypy3-nocov - - TOXPYTHON=pypy3 - python: 'pypy3' arch: amd64 before_install: - - | - if [[ ${TRAVIS_CPU_ARCH} == "arm64" ]]; then - export LD_PRELOAD=/lib/aarch64-linux-gnu/libSegFault.so - else - export LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so - fi - python --version - uname -a - lsb_release -a || true @@ -177,19 +166,13 @@ script: - | ( set -eux - if [[ -n ${WHEEL_MANYLINUX1:-} ]]; then - docker run --rm --user $UID -itv $(pwd):/code ionelmc/manylinux $WHEEL_MANYLINUX1 + if [[ -n ${WHEEL_MANYLINUX_TAG:-} ]]; then + docker run --rm --user $UID -itv $(pwd):/code ionelmc/manylinux:$WHEEL_MANYLINUX_TAG $WHEEL_MANYLINUX_PYTHON tox --installpkg $WHEEL_PATH/*.whl -v else tox -v fi if [[ -n ${WHEEL_PATH:-} ]]; then - if [[ ${TRAVIS_CPU_ARCH} == "arm64" ]]; then - sudo apt-get install patchelf - python3 -mpip install --progress-bar=off auditwheel - python3 -m auditwheel repair $WHEEL_PATH/*.whl -w $WHEEL_PATH/ - rm -rf $WHEEL_PATH/*linux_aarch64.whl - fi twine upload --repository-url https://test.pypi.org/legacy/ --skip-existing $WHEEL_PATH/*.whl fi ) diff --git a/ci/bootstrap.py b/ci/bootstrap.py index 6f3cf58..2eb7723 100755 --- a/ci/bootstrap.py +++ b/ci/bootstrap.py @@ -70,11 +70,10 @@ def main(): for line in subprocess.check_output([sys.executable, '-m', 'tox', '--listenvs'], universal_newlines=True).splitlines() ] tox_environments = [line for line in tox_environments if line.startswith('py')] - architecture = ['amd64', 'arm64'] for name in os.listdir(join("ci", "templates")): with open(join(base_path, name), "w") as fh: - fh.write(jinja.get_template(name).render(tox_environments=tox_environments, architecture=architecture)) + fh.write(jinja.get_template(name).render(tox_environments=tox_environments)) print("Wrote {}".format(name)) print("DONE.") diff --git a/ci/templates/.travis.yml b/ci/templates/.travis.yml index 1b1adbc..eb76768 100644 --- a/ci/templates/.travis.yml +++ b/ci/templates/.travis.yml @@ -1,9 +1,7 @@ language: python -dist: xenial -cache: false env: global: - - LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so + - LD_PRELOAD=libSegFault.so - SEGFAULT_SIGNALS=all - LANG=en_US.UTF-8 - TWINE_USERNAME=ionel @@ -26,14 +24,15 @@ matrix: - WHEEL_PATH=.tox/dist {%- endif %} {%- endif %}{{ '' }} -{%- for arch in architecture %}{{ '' }} -{%- if 'arm64' not in arch or 'pypy' not in env %}{{ '' }} +{%- for arch in ['arm64', 'amd64'] %}{{ '' }} +{%- if 'pypy' not in env %}{{ '' }} - env: - TOXENV={{ env }}{% if 'cover' in env %},codecov,extension-coveralls,coveralls{% endif %} -{%- if 'pypy' not in env and 'nocov' in env and 'arm64' not in arch %}{{ '' }} - - WHEEL_MANYLINUX1=cp{{ env.split('-')[0][2:] }} +{%- if 'pypy' not in env and 'nocov' in env %}{{ '' }} + - WHEEL_MANYLINUX_TAG=manylinux{% if arch == 'arm64' %}2014-arm{% else %}1{% endif %}{{ '' }} + - WHEEL_MANYLINUX_PYTHON=cp{{ env.split('-')[0][2:] }} - WHEEL_PATH=wheelhouse -{%- elif 'pypy' not in env and 'nocov' in env and 'arm64' in arch %}{{ '' }} +{%- elif 'pypy' not in env and 'nocov' in env %}{{ '' }} - WHEEL_PATH=.tox/dist {%- endif %} {%- if env.startswith('pypy3') %}{{ '' }} @@ -49,12 +48,6 @@ matrix: {%- endfor %}{{ '' }} {%- endfor %}{{ '' }} before_install: - - | - if [[ ${TRAVIS_CPU_ARCH} == "arm64" ]]; then - export LD_PRELOAD=/lib/aarch64-linux-gnu/libSegFault.so - else - export LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so - fi - python --version - uname -a - lsb_release -a || true @@ -75,19 +68,13 @@ script: - | ( set -eux - if [[ -n ${WHEEL_MANYLINUX1:-} ]]; then - docker run --rm --user $UID -itv $(pwd):/code ionelmc/manylinux $WHEEL_MANYLINUX1 + if [[ -n ${WHEEL_MANYLINUX_TAG:-} ]]; then + docker run --rm --user $UID -itv $(pwd):/code ionelmc/manylinux:$WHEEL_MANYLINUX_TAG $WHEEL_MANYLINUX_PYTHON tox --installpkg $WHEEL_PATH/*.whl -v else tox -v fi if [[ -n ${WHEEL_PATH:-} ]]; then - if [[ ${TRAVIS_CPU_ARCH} == "arm64" ]]; then - sudo apt-get install patchelf - python3 -mpip install --progress-bar=off auditwheel - python3 -m auditwheel repair $WHEEL_PATH/*.whl -w $WHEEL_PATH/ - rm -rf $WHEEL_PATH/*linux_aarch64.whl - fi twine upload --repository-url https://test.pypi.org/legacy/ --skip-existing $WHEEL_PATH/*.whl fi )