Skip to content

Commit

Permalink
Do a bit of cleanup. Use the manylinux docker image for building arm6…
Browse files Browse the repository at this point in the history
…4 wheels as well.
  • Loading branch information
ionelmc committed Jul 21, 2020
1 parent ae27e46 commit d873f84
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 86 deletions.
107 changes: 45 additions & 62 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
)
Expand Down
3 changes: 1 addition & 2 deletions ci/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")

Expand Down
31 changes: 9 additions & 22 deletions ci/templates/.travis.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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') %}{{ '' }}
Expand All @@ -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
Expand All @@ -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
)
Expand Down

0 comments on commit d873f84

Please sign in to comment.