diff options
author | Jason Madden <jamadden@gmail.com> | 2021-01-13 07:26:54 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-13 07:26:54 -0600 |
commit | 951b2076acc757e93c16dbfd465292485b8f116d (patch) | |
tree | c65d24b0877e262585471a03fec11331b086df92 | |
parent | 28802e8e40e5b9aa3b29d5a4c2611d7bb5e0a6e3 (diff) | |
parent | fa764abe680a0a0aee138a75dabfa4e147cc9ce2 (diff) | |
download | greenlet-951b2076acc757e93c16dbfd465292485b8f116d.tar.gz |
Merge pull request #228 from python-greenlet/github-actions
Move to GitHub actions and away from Travis.
-rw-r--r-- | .github/workflows/tests.yml | 117 | ||||
-rw-r--r-- | .travis.yml | 142 | ||||
-rw-r--r-- | CHANGES.rst | 2 | ||||
-rw-r--r-- | MANIFEST.in | 2 | ||||
-rw-r--r-- | README.rst | 4 |
5 files changed, 123 insertions, 144 deletions
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..affac53 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,117 @@ +name: tests + +on: [push, pull_request] + +env: + PYTHONHASHSEED: 1042466059 + ZOPE_INTERFACE_STRICT_IRO: 1 + 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 + # repo settings. + TWINE_USERNAME: __token__ + + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9] + os: [ubuntu-latest, macos-latest] + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Pip cache + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('setup.*') }} + restore-keys: | + ${{ runner.os }}-pip- + - name: Install dependencies + run: | + python -m pip install -U pip setuptools wheel + python -m pip install -U twine + - name: Install greenlet + run: | + python setup.py bdist_wheel + python -m pip install -U -e ".[test,docs]" + - name: Check greenlet build + run: | + ls -l dist + twine check dist/* + - name: Store greenlet wheel + uses: actions/upload-artifact@v2 + with: + name: greenlet-${{ runner.os }}-${{ matrix.python-version }}.whl + path: dist/*whl + - name: Test + run: | + python -m unittest discover -v greenlet.tests + sphinx-build -b doctest -d docs/_build/doctrees2 docs docs/_build/doctest2 + - name: Publish package to PyPI (mac) + # We cannot 'uses: pypa/gh-action-pypi-publish@v1.4.1' because + # that's apparently a container action, and those don't run on + # the Mac. + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && startsWith(runner.os, 'Mac') + env: + TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} + run: | + twine upload --skip-existing dist/* + + + manylinux: + + runs-on: ubuntu-latest + # We use a regular Python matrix entry to share as much code as possible. + strategy: + matrix: + python-version: [3.9] + image: [manylinux2010_x86_64, manylinux2014_aarch64, manylinux2014_ppc64le] + + steps: + - name: checkout + uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Enable emulation + run: | + docker run --rm --privileged hypriot/qemu-register + # This one was seen in pyca/bcrypt. What's the difference? + # (Other than this one not working.) + #run: | + # docker run --rm --privileged multiarch/qemu-user-static:register --reset + - name: Build and test greenlet + # An alternate way to do this is to run the container directly with a uses: + # and then the script runs inside it. That may work better with caching. + # See https://github.com/pyca/bcrypt/blob/f6b5ee2eda76d077c531362ac65e16f045cf1f29/.github/workflows/wheel-builder.yml + # The 2010 image is the last one that comes with Python 2.7. + env: + DOCKER_IMAGE: quay.io/pypa/${{ matrix.image }} + run: bash ./make-manylinux + - name: Store greenlet wheels + uses: actions/upload-artifact@v2 + with: + path: wheelhouse/*whl + name: ${{ matrix.image }}_wheels.zip + - name: Publish package to PyPI + uses: pypa/gh-action-pypi-publish@v1.4.1 + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + with: + user: __token__ + password: ${{ secrets.TWINE_PASSWORD }} + skip_existing: true + packages_dir: wheelhouse/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 2233f14..0000000 --- a/.travis.yml +++ /dev/null @@ -1,142 +0,0 @@ -language: python - -dist: bionic -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: - - ppc64le - -python: - - 2.7 - - 3.5 - - 3.6 - - 3.7 - - 3.8 - - 3.9 - -install: - - python -m pip install -U pip - - python -m pip install -U twine - - python setup.py bdist_wheel - - python -m pip install -U -e .[test,docs] - - 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 tests and wheels (all Pythons) - language: python - python: 3.8 - os: linux - arch: amd64 - services: docker - env: DOCKER_IMAGE=quay.io/pypa/manylinux2010_x86_64 - install: - - python -m pip install -U pip twine - - docker pull $DOCKER_IMAGE - script: bash make-manylinux - - stage: test - name: aarch64 manylinux tests and wheels (all Pythons) - language: python - os: linux - python: 3.8 - arch: arm64 - services: docker - env: DOCKER_IMAGE=quay.io/pypa/manylinux2014_aarch64 - install: - - python -m pip install -U pip twine - - docker pull $DOCKER_IMAGE - script: bash ./make-manylinux - - # It's important to use 'macpython' builds to get the least - # restrictive wheel tag. It's also important to avoid - # 'homebrew 3' because it floats instead of being a specific - # version. - # XXX: This doesn't seem to properly save the pip cache. Is it - # because of 'language: generic'? Trying to list the directory specifically. - - name: Python 2.7 wheels for MacOS - os: osx - language: generic - # We require at least 2.7.15 to upload wheels. - # See https://github.com/zopefoundation/BTrees/issues/113 - env: TERRYFY_PYTHON='macpython 2.7.18' - # Can't correctly upload. - # - name: Python 3.5 wheels for MacOS - # os: osx - # language: generic - # env: TERRYFY_PYTHON='macpython 3.5' - - name: Python 3.6 wheels for MacOS - os: osx - language: generic - env: TERRYFY_PYTHON='macpython 3.6.1' - - name: Python 3.7 wheels for MacOS - os: osx - language: generic - env: TERRYFY_PYTHON='macpython 3.7.0' - - name: Python 3.8 wheels for MacOS - os: osx - language: generic - env: TERRYFY_PYTHON='macpython 3.8.0' - - name: Python 3.9 wheels for MacOS - os: osx - language: generic - env: TERRYFY_PYTHON='macpython 3.9.0' - -before_install: - - | - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - git clone https://github.com/MacPython/terryfy - source terryfy/travis_tools.sh - get_python_environment $TERRYFY_PYTHON venv - fi - -after_success: - - | - if [[ -n "$DOCKER_IMAGE" ]]; then - python -mensurepip - python -m pip install -U pip - python -m pip install -U twine - ls -l wheelhouse - twine check wheelhouse/* - if [[ $TRAVIS_TAG ]]; then - twine upload --skip-existing wheelhouse/* - fi - fi - - | - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - ls -l dist - twine check dist/* - if [[ $TRAVIS_TAG ]]; then - python -m twine upload --skip-existing dist/* - fi - fi - -cache: - pip: true - directories: - - $HOME/Library/Caches/pip - -before_cache: - - rm -f $HOME/.cache/pip/log/debug.log diff --git a/CHANGES.rst b/CHANGES.rst index d7196c1..75e24ab 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -10,6 +10,8 @@ `issue 218 <https://github.com/python-greenlet/greenlet/issues/218>`_. +- Move continuous integration from Travis CI to Github Actions. + 1.0a1 (2020-11-20) ================== diff --git a/MANIFEST.in b/MANIFEST.in index a811098..8e2d3f5 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -33,6 +33,8 @@ recursive-include appveyor *.cmd recursive-include appveyor *.ps1 recursive-include appveyor *.py +recursive-include .github *.yml + include AUTHORS include LICENSE include LICENSE.PSF @@ -1,7 +1,7 @@ .. This file is included into docs/history.rst -.. image:: https://secure.travis-ci.org/python-greenlet/greenlet.png - :target: http://travis-ci.org/python-greenlet/greenlet +.. image:: https://github.com/python-greenlet/greenlet/workflows/tests/badge.svg + :target: https://github.com/python-greenlet/greenlet/actions Greenlets are lightweight coroutines for in-process concurrent programming. |