From f38dc0502f50fa6d44ca55fc628c9c0b3ce3af1c Mon Sep 17 00:00:00 2001 From: Marius Gedminas Date: Sun, 10 Nov 2019 11:13:16 +0200 Subject: [PATCH 1/3] Add Python 3.8 to appveyor.yml --- CHANGES.rst | 2 +- appveyor.yml | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 89d60b6..a5701e9 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -7,7 +7,7 @@ - Drop support for Python 3.4. -- Add support for Python 3.8a3. +- Add support for Python 3.8. - Properly declare dependency on zope.schema >= 4.2.0, introduced in zope.security 4.2.1. diff --git a/appveyor.yml b/appveyor.yml index 2f86bda..9a191ef 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -13,11 +13,20 @@ environment: - python: 36-x64 - python: 37 - python: 37-x64 + - python: 38 + - python: 38-x64 - { python: 27, PURE_PYTHON: 1 } - { python: 37, PURE_PYTHON: 1 } install: - "SET PATH=C:\\Python%PYTHON%;c:\\Python%PYTHON%\\scripts;%PATH%" + - ps: | + $env:PYTHON = "C:\\Python${env:PYTHON}" + if (-not (Test-Path $env:PYTHON)) { + curl -o install_python.ps1 https://raw.githubusercontent.com/matthew-brett/multibuild/11a389d78892cf90addac8f69433d5e22bfa422a/install_python.ps1 + .\install_python.ps1 + } + - ps: if (-not (Test-Path $env:PYTHON)) { throw "No $env:PYTHON" } - echo "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 > "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\vcvars64.bat" # We need to install the C extensions that BTrees setup-requires # separately because we've seen problems with the BTrees build cleanup step trying @@ -44,6 +53,6 @@ artifacts: name: wheel deploy_script: - - ps: if ($env:APPVEYOR_REPO_TAG -eq $TRUE -and $env:PURE_PYTHON -ne 1) { pip install twine; twine upload dist/* } + - ps: if ($env:APPVEYOR_REPO_TAG -eq $TRUE -and $env:PURE_PYTHON -ne 1) { pip install twine; twine upload --skip-existing dist/* } deploy: on From 9f7cdf2568a293f89c0e3e265134482ff1b0907c Mon Sep 17 00:00:00 2001 From: Marius Gedminas Date: Sun, 10 Nov 2019 11:21:55 +0200 Subject: [PATCH 2/3] Build manylinux and MacOS wheels --- .manylinux-install.sh | 22 ++++++++ .manylinux.sh | 5 ++ .travis.yml | 116 ++++++++++++++++++++++++++++++++++-------- 3 files changed, 122 insertions(+), 21 deletions(-) create mode 100755 .manylinux-install.sh create mode 100755 .manylinux.sh diff --git a/.manylinux-install.sh b/.manylinux-install.sh new file mode 100755 index 0000000..f82f0c4 --- /dev/null +++ b/.manylinux-install.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +set -e -x + +# Compile wheels +for PYBIN in /opt/python/*/bin; do + if [[ "${PYBIN}" == *"cp27"* ]] || \ + [[ "${PYBIN}" == *"cp35"* ]] || \ + [[ "${PYBIN}" == *"cp36"* ]] || \ + [[ "${PYBIN}" == *"cp37"* ]] || \ + [[ "${PYBIN}" == *"cp38"* ]]; then + "${PYBIN}/pip" install -U pip setuptools cffi + "${PYBIN}/pip" install -e /io/ + "${PYBIN}/pip" wheel /io/ -w wheelhouse/ + rm -rf /io/build /io/*.egg-info + fi +done + +# Bundle external shared libraries into the wheels +for whl in wheelhouse/zope.security*.whl; do + auditwheel repair "$whl" -w /io/wheelhouse/ +done diff --git a/.manylinux.sh b/.manylinux.sh new file mode 100755 index 0000000..2fed778 --- /dev/null +++ b/.manylinux.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -e -x + +docker run --rm -v "$(pwd)":/io $DOCKER_IMAGE $PRE_CMD /io/.manylinux-install.sh diff --git a/.travis.yml b/.travis.yml index c9f6e54..9e23153 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,31 +1,105 @@ language: python -dist: xenial + +env: + global: + TWINE_USERNAME: zope.wheelbuilder + TWINE_PASSWORD: + secure: "U6CeZtNEPDN3qKXfrLcvHFLrowqNWxmapXLWygZRxKgfR+ypowe1Y0a4kCBEBZKtysbY26MmIkrMV07tEMxny1yUWVCvRvUaQw0Ic3t5CM0R019zjVh9fQUTdWGCwri86Qj/OaeuPeMR0LCr6d9nMSun0GWSWhjOUhkTCdchfQw=" + +python: + - 2.7 + - 3.5 + - 3.6 + - 3.7 + - 3.8 + - pypy + - pypy3 + matrix: include: - - python: 2.7 - - python: 3.5 - - python: 3.6 - - python: 3.7 - - python: 3.8 - - python: pypy2.7-6.0 - - python: pypy3.5-6.0 - - python: 2.7 - env: - - PURE_PYTHON=1 - - ZOPE_WATCH_CHECKERS=1 - - python: 3.7 + + - name: "Python: 2.7, pure (no C extensions), with ZOPE_WATCH_CHECKERS enabled" + python: "2.7" + env: PURE_PYTHON=1 ZOPE_WATCH_CHECKERS=1 + + - name: "Python: 3.7, with ZOPE_WATCH_CHECKERS enabled" + python: 3.7 env: ZOPE_WATCH_CHECKERS=1 - - python: 3.7 + + - name: "Python: 3.7, pure (no C extensions)" + python: 3.7 env: PURE_PYTHON=1 + + # manylinux wheel builds + - name: 64-bit manylinux wheels (all Pythons) + services: docker + env: DOCKER_IMAGE=quay.io/pypa/manylinux2010_x86_64 + install: docker pull $DOCKER_IMAGE + script: bash .manylinux.sh + + - name: 32-bit manylinux wheels (all Pythons) + services: docker + env: DOCKER_IMAGE=quay.io/pypa/manylinux2010_i686 PRE_CMD=linux32 + install: docker pull $DOCKER_IMAGE + script: bash .manylinux.sh + + # 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. + - name: Python 2.7 wheels for MacOS + os: osx + language: generic + env: TERRYFY_PYTHON='macpython 2.7.17' + - 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.0' + - name: Python 3.7 wheels for MacOS + os: osx + language: generic + env: TERRYFY_PYTHON='macpython 3.7.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 + install: - - pip install -U pip setuptools - - pip install -U coveralls coverage - - pip install -U -e .[test,docs] + - pip install -U pip setuptools + - pip install -U coveralls coverage + - pip install -U -e .[test,docs] + script: - - coverage run -m zope.testrunner --test-path=src - - coverage run -a -m sphinx -b doctest -d docs/_build/doctrees docs docs/_build/doctest + - python --version + - coverage run -m zope.testrunner --test-path=src + - coverage run -a -m sphinx -b doctest -d docs/_build/doctrees docs docs/_build/doctest + - python setup.py bdist_wheel + after_success: - - coveralls + - coveralls + - | + if [[ $TRAVIS_TAG && "$TRAVIS_OS_NAME" == "osx" ]]; then + # macpython 3.5 doesn't support recent TLS protocols which causes twine + # upload to fail, so we use the system Python to run twine + /usr/bin/python -m pip install twine + twine upload --skip-existing dist/* + fi + - | + if [[ $TRAVIS_TAG && -n "$DOCKER_IMAGE" ]]; then + pip install twine + twine upload --skip-existing wheelhouse/* + fi + notifications: - email: false + email: false + cache: pip +before_cache: + - rm -f $HOME/.cache/pip/log/debug.log From 80f215d4026e579d63481654e8db10e10e7709ee Mon Sep 17 00:00:00 2001 From: Marius Gedminas Date: Sun, 10 Nov 2019 11:38:08 +0200 Subject: [PATCH 3/3] Add a workaround for Mac OS Python 3.5 The problem is a TLS protocol mismatch (PyPI wants TLS 1.2 or newer, Python 3.5 doesn't support it, pip takes great pains to use alternative http/tls implementations to make everything work somehow). --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 9e23153..ea44323 100644 --- a/.travis.yml +++ b/.travis.yml @@ -74,6 +74,9 @@ before_install: install: - pip install -U pip setuptools - pip install -U coveralls coverage + # pip install zope.proxy here because because setup_requires will use + # easy_install, which fails on Python 3.5 on Mac OS + - pip install -U zope.proxy - pip install -U -e .[test,docs] script: