Skip to content

Commit

Permalink
Add support for Python 3.10.
Browse files Browse the repository at this point in the history
Fix building the docs.
  • Loading branch information
Michael Howitz committed Apr 4, 2022
1 parent bd0889b commit e8f2d46
Show file tree
Hide file tree
Showing 11 changed files with 85 additions and 48 deletions.
72 changes: 39 additions & 33 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,24 +92,26 @@ jobs:
# with `test`, and `docs` must use a subset.
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version:
- 2.7
- 3.5
- pypy-2.7
- pypy-3.6
- 3.6
- 3.7
- 3.8
- 3.9
- "2.7"
- "3.5"
- "pypy-2.7"
- "pypy-3.7"
- "3.6"
- "3.7"
- "3.8"
- "3.9"
- "3.10"
os: [ubuntu-20.04, macos-latest]
exclude:
- os: macos-latest
python-version: pypy-2.7
python-version: "pypy-2.7"
- os: macos-latest
python-version: pypy-3.6
python-version: "pypy-3.7"
- os: macos-latest
python-version: 3.5
python-version: "3.5"

steps:
- name: checkout
Expand Down Expand Up @@ -141,7 +143,6 @@ jobs:
run: |
pip install -U pip
pip install -U setuptools wheel twine cffi
pip install -U coveralls coverage
- name: Build zope.hookable
run: |
Expand All @@ -150,7 +151,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]
Expand All @@ -167,7 +167,11 @@ 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')
if: >
github.event_name == 'push'
&& startsWith(github.ref, 'refs/tags')
&& startsWith(runner.os, 'Mac')
&& !startsWith(matrix.python-version, 'pypy')
env:
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: |
Expand All @@ -177,24 +181,26 @@ jobs:
needs: build-package
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version:
- 2.7
- 3.5
- pypy-2.7
- pypy-3.6
- 3.6
- 3.7
- 3.8
- 3.9
- "2.7"
- "3.5"
- "pypy-2.7"
- "pypy-3.7"
- "3.6"
- "3.7"
- "3.8"
- "3.9"
- "3.10"
os: [ubuntu-20.04, macos-latest]
exclude:
- os: macos-latest
python-version: pypy-2.7
python-version: "pypy-2.7"
- os: macos-latest
python-version: pypy-3.6
python-version: "pypy-3.7"
- os: macos-latest
python-version: 3.5
python-version: "3.5"

steps:
- name: checkout
Expand Down Expand Up @@ -229,8 +235,8 @@ jobs:
path: dist/
- name: Install zope.hookable
run: |
pip install -U wheel
pip install -U coverage coverage-python-version
pip install -U wheel setuptools
pip install -U 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
Expand Down Expand Up @@ -270,7 +276,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.9]
python-version: ["3.9"]
os: [ubuntu-20.04]

steps:
Expand Down Expand Up @@ -309,8 +315,6 @@ jobs:
pip install -U wheel
pip install -U coverage
pip install -U "`ls dist/zope.hookable-*.whl`[docs]"
# Until repoze.sphinx.autointerface supports Sphinx 4.x we cannot use it:
pip install -U "Sphinx < 4"
- name: Build docs
env:
ZOPE_INTERFACE_STRICT_IRO: 1
Expand All @@ -323,7 +327,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.9]
python-version: ["3.9"]
os: [ubuntu-20.04]

steps:
Expand Down Expand Up @@ -375,7 +379,7 @@ jobs:
# We use a regular Python matrix entry to share as much code as possible.
strategy:
matrix:
python-version: [3.9]
python-version: ["3.9"]
image: [manylinux2010_x86_64, manylinux2010_i686, manylinux2014_aarch64]

steps:
Expand Down Expand Up @@ -442,7 +446,9 @@ 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')
with:
user: __token__
password: ${{ secrets.TWINE_PASSWORD }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/c-code
*.dll
*.egg-info/
*.profraw
*.pyc
Expand Down
17 changes: 11 additions & 6 deletions .manylinux-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,26 @@ fi
ls -ld /cache
ls -ld /cache/pip

# We need some libraries because we build wheels from scratch:
yum -y install libffi-devel

# Compile wheels
for PYBIN in /opt/python/*/bin; do
if [[ "${PYBIN}" == *"cp27"* ]] || \
if \
[[ "${PYBIN}" == *"cp27"* ]] || \
[[ "${PYBIN}" == *"cp35"* ]] || \
[[ "${PYBIN}" == *"cp36"* ]] || \
[[ "${PYBIN}" == *"cp37"* ]] || \
[[ "${PYBIN}" == *"cp38"* ]] || \
[[ "${PYBIN}" == *"cp39"* ]]; then
[[ "${PYBIN}" == *"cp39"* ]] || \
[[ "${PYBIN}" == *"cp310"* ]] ; then
"${PYBIN}/pip" install -e /io/
"${PYBIN}/pip" wheel /io/ -w wheelhouse/
if [ `uname -m` == 'aarch64' ]; then
cd /io/
"${PYBIN}/pip" install tox
"${PYBIN}/tox" -e py
cd ..
cd /io/
"${PYBIN}/pip" install tox
"${PYBIN}/tox" -e py
cd ..
fi
rm -rf /io/build /io/*.egg-info
fi
Expand Down
2 changes: 1 addition & 1 deletion .meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# https://github.com/zopefoundation/meta/tree/master/config/c-code
[meta]
template = "c-code"
commit-id = "9659f4d5d3dab75f0727e5e86349934c0bc776ae"
commit-id = "efa4b7532073de2e151785892b48ac95bc72981b"

[python]
with-appveyor = true
Expand Down
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
5.1.1 (unreleased)
==================

- Nothing changed yet.
- Add support for Python 3.10.


5.1.0 (2021-07-20)
Expand Down
23 changes: 23 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!--
Generated from:
https://github.com/zopefoundation/meta/tree/master/config/c-code
-->
# Contributing to zopefoundation projects

The projects under the zopefoundation GitHub organization are open source and
welcome contributions in different forms:

* bug reports
* code improvements and bug fixes
* documentation improvements
* pull request reviews

For any changes in the repository besides trivial typo fixes you are required
to sign the contributor agreement. See
https://www.zope.dev/developer/becoming-a-committer.html for details.

Please visit our [Developer
Guidelines](https://www.zope.dev/developer/guidelines.html) if you'd like to
contribute code changes and our [guidelines for reporting
bugs](https://www.zope.dev/developer/reporting-bugs.html) if you want to file a
bug report.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/c-code
include *.md
include *.rst
include *.txt
include buildout.cfg
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
:target: https://pypi.org/project/zope.hookable/
:alt: Supported Python versions

.. image:: https://travis-ci.com/zopefoundation/zope.hookable.svg?branch=master
:target: https://travis-ci.com/zopefoundation/zope.hookable
.. image:: https://github.com/zopefoundation/zope.hookable/actions/workflows/tests.yml/badge.svg
:target: https://github.com/zopefoundation/zope.hookable/actions/workflows/tests.yml

.. image:: https://readthedocs.org/projects/zopehookable/badge/?version=latest
:target: https://zopehookable.readthedocs.io/en/latest/
Expand Down
2 changes: 2 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ environment:
- python: 38-x64
- python: 39
- python: 39-x64
- python: 310
- python: 310-x64

install:
- "SET PYTHONVERSION=%PYTHON%"
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ def read(*rnames):
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Framework :: Zope :: 3",
Expand Down
8 changes: 3 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ envlist =
py37,py37-pure
py38,py38-pure
py39,py39-pure
py310,py310-pure
pypy
pypy3
docs
Expand All @@ -18,8 +19,6 @@ envlist =
[testenv]
usedevelop = true
deps =
# Until repoze.sphinx.autointerface supports Sphinx 4.x we cannot use it:
Sphinx < 4
setenv =
pure: PURE_PYTHON=1
!pure-!pypy-!pypy3: PURE_PYTHON=0
Expand Down Expand Up @@ -50,7 +49,8 @@ skip_install = true
deps =
flake8
check-manifest
check-python-versions
check-python-versions >= 0.19.1
wheel
commands =
flake8 src setup.py
check-manifest
Expand All @@ -59,8 +59,6 @@ commands =
[testenv:docs]
basepython = python3
skip_install = false
# Until repoze.sphinx.autointerface supports Sphinx 4.x we cannot use it:
deps = Sphinx < 4
commands_pre =
commands =
sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html
Expand Down

0 comments on commit e8f2d46

Please sign in to comment.