From 5f8e2e0410257f852298246352ba3b44e1255f88 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Fri, 28 Jan 2022 08:22:00 +0100 Subject: Add support for Python 3.11. (#253) * Add support for Python 3.11. * Do not use the binary version of coverage as it has a Python 3.11 wheel on PyPI which is not ABI compatible with the current alpha release and caused segfaults. * Do not push wheels of Python future releases to PyPI. --- .github/workflows/tests.yml | 18 +++++++++++++----- .manylinux-install.sh | 1 + .meta.toml | 6 +++--- CHANGES.rst | 2 +- appveyor.yml | 4 ++++ tox.ini | 1 + 6 files changed, 23 insertions(+), 9 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index af8c46f..cc350c2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -104,6 +104,7 @@ jobs: - "3.8" - "3.9" - "3.10" + - "3.11.0-alpha.4" os: [ubuntu-20.04, macos-latest] exclude: - os: macos-latest @@ -143,7 +144,6 @@ jobs: run: | pip install -U pip pip install -U setuptools wheel twine cffi - pip install -U coveralls coverage - name: Build zope.interface run: | @@ -152,7 +152,6 @@ jobs: python setup.py build_ext -i python setup.py bdist_wheel # Also install it, so that we get dependencies in the (pip) cache. - pip install -U coverage pip install -U 'faulthandler; python_version == "2.7" and platform_python_implementation == "CPython"' pip install .[test] @@ -169,7 +168,12 @@ jobs: # 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') && !startsWith(matrix.python-version, 'pypy') + if: > + github.event_name == 'push' + && startsWith(github.ref, 'refs/tags') + && startsWith(runner.os, 'Mac') + && !startsWith(matrix.python-version, 'pypy') + && !startsWith(matrix.python-version, '3.11.0-alpha.4') env: TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} run: | @@ -191,6 +195,7 @@ jobs: - "3.8" - "3.9" - "3.10" + - "3.11.0-alpha.4" os: [ubuntu-20.04, macos-latest] exclude: - os: macos-latest @@ -238,7 +243,7 @@ jobs: # works fine with non-editable installs.) run: | pip install -U wheel - pip install -U coverage + pip install -U --no-binary :all: coverage pip install -U 'faulthandler; python_version == "2.7" and platform_python_implementation == "CPython"' # Unzip into src/ so that testrunner can find the .so files # when we ask it to load tests from that directory. This @@ -444,7 +449,10 @@ jobs: run: sudo chown -R $(whoami) ${{ steps.pip-cache.outputs.dir }} - name: Publish package to PyPI uses: pypa/gh-action-pypi-publish@v1.4.1 - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + if: > + github.event_name == 'push' + && startsWith(github.ref, 'refs/tags') + && !startsWith(matrix.python-version, '3.11.0-alpha.4') with: user: __token__ password: ${{ secrets.TWINE_PASSWORD }} diff --git a/.manylinux-install.sh b/.manylinux-install.sh index 3b47736..7bb27b7 100755 --- a/.manylinux-install.sh +++ b/.manylinux-install.sh @@ -31,6 +31,7 @@ for PYBIN in /opt/python/*/bin; do if \ [[ "${PYBIN}" == *"cp27"* ]] || \ [[ "${PYBIN}" == *"cp35"* ]] || \ + [[ "${PYBIN}" == *"cp311"* ]] || \ [[ "${PYBIN}" == *"cp36"* ]] || \ [[ "${PYBIN}" == *"cp37"* ]] || \ [[ "${PYBIN}" == *"cp38"* ]] || \ diff --git a/.meta.toml b/.meta.toml index 5ff5122..b4ae459 100644 --- a/.meta.toml +++ b/.meta.toml @@ -2,7 +2,7 @@ # https://github.com/zopefoundation/meta/tree/master/config/c-code [meta] template = "c-code" -commit-id = "23625f0c67c2171441dbe2069830d3b3fdb17757" +commit-id = "a326a385c9c33fdb9d01ac2bfc6111a83a003f2a" [python] with-appveyor = true @@ -10,7 +10,7 @@ with-pypy = true with-legacy-python = true with-sphinx-doctests = true with-windows = false -with-future-python = false +with-future-python = true with-docs = true [tox] @@ -61,7 +61,7 @@ additional-install = [ " # works fine with non-editable installs.)", " run: |", " pip install -U wheel", - " pip install -U coverage", + " pip install -U --no-binary :all: coverage", " pip install -U 'faulthandler; python_version == \"2.7\" and platform_python_implementation == \"CPython\"'", " # Unzip into src/ so that testrunner can find the .so files", " # when we ask it to load tests from that directory. This", diff --git a/CHANGES.rst b/CHANGES.rst index 6aa9884..9cb6e63 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,7 +5,7 @@ 5.5.0 (unreleased) ================== -- Add support for Python 3.10. +- Add support for Python 3.10 and 3.11 (as of 3.11.0a4). - Add missing Trove classifier showing support for Python 3.9. diff --git a/appveyor.yml b/appveyor.yml index b334494..9f14aee 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -24,6 +24,10 @@ environment: - python: 39-x64 - python: 310 - python: 310-x64 + # `multibuild` cannot install non-final versions as they are not on + # ftp.python.org, so we skip Python 3.11 until its final release: + # - python: 311 + # - python: 311-x64 install: - "SET PYTHONVERSION=%PYTHON%" diff --git a/tox.ini b/tox.ini index f614f3f..d366ac9 100644 --- a/tox.ini +++ b/tox.ini @@ -11,6 +11,7 @@ envlist = py38,py38-pure py39,py39-pure py310,py310-pure + py311,py311-pure pypy pypy3 docs -- cgit v1.2.1