diff options
| author | Jason Madden <jamadden@gmail.com> | 2020-11-16 06:51:44 -0600 |
|---|---|---|
| committer | Jason Madden <jamadden@gmail.com> | 2020-11-16 06:51:44 -0600 |
| commit | d0e6451cbcf7ea940a722a5341d939226ba6188a (patch) | |
| tree | f474e1bc32bbf5a4f81e6ccc6327f03a4088b602 | |
| parent | fc99224089b5347d01f0742d4fc1d3bd4e700da5 (diff) | |
| download | greenlet-issue191.tar.gz | |
Build and test in the manylinux environment for amd64 and aarch64. Also add macOS to the matrix.issue191
All of these environments will upload built wheels on release.
Addresses #175 and #191. Still need to automate appveyor.
| -rw-r--r-- | .travis.yml | 73 | ||||
| -rwxr-xr-x | make-manylinux | 48 |
2 files changed, 109 insertions, 12 deletions
diff --git a/.travis.yml b/.travis.yml index bacbb1d..1fbf4e8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,26 @@ language: python -cache: pip + dist: bionic +os: + - linux + - osx +osx_image: xcode11.4 +env: + global: + - PYTHONHASHSEED=8675309 + - PYTHONUNBUFFERED=1 + - PYTHONDONTWRITEBYTECODE=1 + - PIP_UPGRADE_STRATEGY=eager + # Don't get warnings about Python 2 support being deprecated. We + # know. The env var works for pip 20. + - PIP_NO_PYTHON_VERSION_WARNING=1 + - PIP_NO_WARN_SCRIPT_LOCATION=1 + # Uploading built wheels for releases. + # TWINE_PASSWORD is encrypted and stored directly in the + # travis repo settings. + - TWINE_USERNAME="__token__" arch: - - arm64 - - amd64 - ppc64le python: @@ -15,8 +31,57 @@ python: - 3.8 - 3.9 -install: pip install -U -e .[test,docs] +install: + - pip install -U -e .[test,docs] + - python setup.py bdist_wheel + - ls -l dist + - twine check dist/* script: - python -m unittest discover -v greenlet.tests - sphinx-build -b doctest -d docs/_build/doctrees2 docs docs/_build/doctest2 + +jobs: + fast_finish: true + include: + # The manylinux builds and tests. + # These take awhile, so get them started while others proceed in parallel. + - stage: test + name: x86_64 manylinux wheels (all Pythons) + language: python + os: linux + arch: amd64 + services: docker + env: DOCKER_IMAGE=quay.io/pypa/manylinux2010_x86_64 + install: docker pull $DOCKER_IMAGE + script: bash make-manylinux + - stage: test + name: arg64 manylinux wheels (all Pythons) + language: python + os: linux + arch: aarch64 + services: docker + env: DOCKER_IMAGE=quay.io/pypa/manylinux2014_aarch64 + install: docker pull $DOCKER_IMAGE + script: bash make-manylinux + +after_success: + - | + if [[ -n "$DOCKER_IMAGE" ]]; then + ls -l wheelhouse + twine check wheelhouse/* + if [[ $TRAVIS_TAG ]]; then + twine upload --skip-existing wheelhouse/* + fi + fi + - | + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then + if [[ $TRAVIS_TAG ]]; then + twine upload --skip-existing dist/* + fi + fi + +cache: + pip: true +before_cache: + - rm -f $HOME/.cache/pip/log/debug.log diff --git a/make-manylinux b/make-manylinux index 153f243..9383d3b 100755 --- a/make-manylinux +++ b/make-manylinux @@ -1,19 +1,51 @@ #!/bin/bash +# Initially based on a snippet from the greenlet project. +# This needs to be run from the root of the project. +# To update: docker pull quay.io/pypa/manylinux2010_x86_64 set -e export PYTHONUNBUFFERED=1 export PYTHONDONTWRITEBYTECODE=1 +# Use a fixed hash seed for reproducability +export PYTHONHASHSEED=8675309 +export CI=1 +export TRAVIS=true +# Don't get warnings about Python 2 support being deprecated. We +# know. The env var works for pip 20. +export PIP_NO_PYTHON_VERSION_WARNING=1 +export PIP_NO_WARN_SCRIPT_LOCATION=1 + if [ -d /greenlet -a -d /opt/python ]; then # Running inside docker - cd /greenlet - rm -rf wheelhouse - for variant in /opt/python/*; do - rm -rf dist build *.egg-info - $variant/bin/python setup.py clean --all bdist_wheel - auditwheel repair dist/*.whl + + # Build in an isolated directory + mkdir /tmp/build + cd /tmp/build + git clone /greenlet greenlet + cd greenlet + + mkdir -p /greenlet/wheelhouse + OPATH="$PATH" + which auditwheel + for variant in `ls -d /opt/python/cp{27,35,36,37,38,39}*`; do + export PATH="$variant/bin:$OPATH" + echo "Building $variant $(python --version)" + + python -mpip install -U pip + python setup.py bdist_wheel + python -mpip install -U . + python -m unittest discover -v greenlet.tests + PATH="$OPATH" auditwheel repair dist/greenlet*.whl + cp wheelhouse/greenlet*.whl /greenlet/wheelhouse + + rm -rf build + rm -f dist/greenlet*.whl + done - rm -rf dist build *.egg-info + exit 0 fi -docker run --rm -ti -v "$(pwd):/greenlet:Z" quay.io/pypa/manylinux1_x86_64 /greenlet/$(basename $0) +# Mount the current directory as /greenlet +docker run --rm -ti -v "$(pwd):/greenlet" ${DOCKER_IMAGE:-quay.io/pypa/manylinux2010_x86_64} /greenlet/$(basename $0) +ls -l wheelhouse |
