From baae70cb4ba20caef45f6975eacb548f2955c844 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Thu, 8 Dec 2022 11:31:54 +0100 Subject: [PATCH 1/4] Fix GHA + support Python 3.11. I had to disable flake8 checks, so isort-ing the imports is not enforced. --- .github/workflows/tests.yml | 12 ++++++----- .gitignore | 1 + .meta.toml | 5 +++-- CHANGES.rst | 2 +- setup.cfg | 11 ++++++++++ setup.py | 43 ++++++++++++++++++------------------- tox.ini | 13 ++++++----- 7 files changed, 50 insertions(+), 37 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 69ce9724..42878c99 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,7 +17,7 @@ jobs: fail-fast: false matrix: os: - - ubuntu + - ["ubuntu", "ubuntu-20.04"] config: # [Python version, tox env] - ["3.9", "lint"] @@ -28,6 +28,7 @@ jobs: - ["3.8", "py38"] - ["3.9", "py39"] - ["3.10", "py310"] + - ["3.11", "py311"] - ["pypy-2.7", "pypy"] - ["pypy-3.7", "pypy3"] - ["3.9", "docs"] @@ -45,16 +46,17 @@ jobs: - ["3.10", "py310-uvloop"] - ["pypy-3.7", "pypy3-msgpack1"] - runs-on: ${{ matrix.os }}-latest + runs-on: ${{ matrix.os[1] }} + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name name: ${{ matrix.config[1] }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.config[0] }} - name: Pip cache - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ matrix.config[0] }}-${{ hashFiles('setup.*', 'tox.ini') }} diff --git a/.gitignore b/.gitignore index c724a76f..1f321f52 100644 --- a/.gitignore +++ b/.gitignore @@ -28,4 +28,5 @@ lib64 log/ parts/ pyvenv.cfg +testing.log var/ diff --git a/.meta.toml b/.meta.toml index 964aae00..6c26e038 100644 --- a/.meta.toml +++ b/.meta.toml @@ -2,7 +2,7 @@ # https://github.com/zopefoundation/meta/tree/master/config/pure-python [meta] template = "pure-python" -commit-id = "0c07a1cfd78d28a07aebd23383ed16959f166574" +commit-id = "931ebd36c89bffdc929019c5080086ed7a45b5d6" [python] with-windows = false @@ -11,9 +11,10 @@ with-future-python = false with-legacy-python = true with-docs = true with-sphinx-doctests = false +with-macos = false [tox] -use-flake8 = true +use-flake8 = false testenv-commands = [ "# Run unit tests first.", "zope-testrunner -u --test-path=src -a 1000 {posargs:-vc}", diff --git a/CHANGES.rst b/CHANGES.rst index deecc82d..c03e4d9a 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -37,7 +37,7 @@ Changelog - Lint the code with flake8 -- Add support for Python 3.10. +- Add support for Python 3.10, 3.11. - Add ``ConflictError`` to the list of unlogged server exceptions (the client/its application should determine whether it wants diff --git a/setup.cfg b/setup.cfg index 264b78c1..1ecf58c5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -11,3 +11,14 @@ ignore = .editorconfig .meta.toml docs/_build/html/_sources/* + +[isort] +force_single_line = True +combine_as_imports = True +sections = FUTURE,STDLIB,THIRDPARTY,ZOPE,FIRSTPARTY,LOCALFOLDER +known_third_party = six, docutils, pkg_resources +known_zope = +known_first_party = +default_section = ZOPE +line_length = 79 +lines_after_imports = 2 diff --git a/setup.py b/setup.py index 12eb73d9..01c12390 100644 --- a/setup.py +++ b/setup.py @@ -43,27 +43,6 @@ 'zope.testrunner', ] -classifiers = """ -Intended Audience :: Developers -License :: OSI Approved :: Zope Public License -Programming Language :: Python :: 2 -Programming Language :: Python :: 2.7 -Programming Language :: Python :: 3 -Programming Language :: Python :: 3.5 -Programming Language :: Python :: 3.6 -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 -Topic :: Database -Topic :: Software Development :: Libraries :: Python Modules -Operating System :: Microsoft :: Windows -Operating System :: Unix -Framework :: ZODB -""".strip().split('\n') - def _modname(path, base, name=''): if path == base: @@ -139,7 +118,27 @@ def emit(self, record): package_dir={'': 'src'}, license="ZPL 2.1", platforms=["any"], - classifiers=classifiers, + classifiers=[ + "Intended Audience :: Developers", + "License :: OSI Approved :: Zope Public License", + "Programming Language :: Python :: 2", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", + "Topic :: Database", + "Topic :: Software Development :: Libraries :: Python Modules", + "Operating System :: Microsoft :: Windows", + "Operating System :: Unix", + "Framework :: ZODB", + ], test_suite="__main__.alltests", # to support "setup.py test" tests_require=tests_require, extras_require={ diff --git a/tox.ini b/tox.ini index dfa36851..b7904ead 100644 --- a/tox.ini +++ b/tox.ini @@ -11,6 +11,7 @@ envlist = py38 py39 py310 + py311 pypy pypy3 docs @@ -36,15 +37,13 @@ extras = [testenv:lint] basepython = python3 skip_install = true +commands = + check-manifest + check-python-versions deps = - flake8 check-manifest check-python-versions >= 0.19.1 wheel -commands = - flake8 src setup.py - check-manifest - check-python-versions [testenv:docs] basepython = python3 @@ -68,8 +67,8 @@ deps = commands = mkdir -p {toxinidir}/parts/htmlcov coverage run -m zope.testrunner --test-path=src {posargs:-vc} - coverage html - coverage report -m --fail-under=53 + coverage html --ignore-errors + coverage report --ignore-errors --show-missing --fail-under=53 [coverage:run] branch = True From 2c2a98c3a2fd1c368948599bd6a14ba9a0128173 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Thu, 8 Dec 2022 13:29:27 +0100 Subject: [PATCH 2/4] Use older tox version. See https://github.com/tox-dev/tox/issues/2638 for details. --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 42878c99..78f39291 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -66,7 +66,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install tox + pip install "tox < 4" - name: Test run: tox -e ${{ matrix.config[1] }} - name: Coverage From 3b51dc16d62f635f8db28d051e844397299282dc Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Fri, 9 Dec 2022 08:07:38 +0100 Subject: [PATCH 3/4] Switch back to tox v4 by fixing the quote problem. --- .github/workflows/tests.yml | 2 +- .meta.toml | 4 ++-- tox.ini | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 78f39291..42878c99 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -66,7 +66,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install "tox < 4" + pip install tox - name: Test run: tox -e ${{ matrix.config[1] }} - name: Coverage diff --git a/.meta.toml b/.meta.toml index 6c26e038..bec839f0 100644 --- a/.meta.toml +++ b/.meta.toml @@ -2,7 +2,7 @@ # https://github.com/zopefoundation/meta/tree/master/config/pure-python [meta] template = "pure-python" -commit-id = "931ebd36c89bffdc929019c5080086ed7a45b5d6" +commit-id = "200573eb414d2228d463da3de7d71a6d6335a704" [python] with-windows = false @@ -23,7 +23,7 @@ testenv-commands = [ ] testenv-deps = [ "!zodbmaster: ZODB >= 4.2.0b1", - "zodbmaster: -e git+https://github.com/zopefoundation/ZODB.git@master#egg=ZODB", + "zodbmaster: -e git+https://github.com/zopefoundation/ZODB.git@master\\#egg=ZODB", "uvloop: uvloop", ] testenv-setenv = [ diff --git a/tox.ini b/tox.ini index b7904ead..f2402ec9 100644 --- a/tox.ini +++ b/tox.ini @@ -21,7 +21,7 @@ envlist = usedevelop = true deps = !zodbmaster: ZODB >= 4.2.0b1 - zodbmaster: -e git+https://github.com/zopefoundation/ZODB.git@master#egg=ZODB + zodbmaster: -e git+https://github.com/zopefoundation/ZODB.git@master\#egg=ZODB uvloop: uvloop setenv = !py27-!pypy: PYTHONWARNINGS=ignore::ResourceWarning @@ -62,7 +62,7 @@ deps = coverage coverage-python-version !zodbmaster: ZODB >= 4.2.0b1 - zodbmaster: -e git+https://github.com/zopefoundation/ZODB.git@master#egg=ZODB + zodbmaster: -e git+https://github.com/zopefoundation/ZODB.git@master\#egg=ZODB uvloop: uvloop commands = mkdir -p {toxinidir}/parts/htmlcov From a07e1b493b2c7cb834c2d1adaee420cee704c93d Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Tue, 13 Dec 2022 08:21:46 +0100 Subject: [PATCH 4/4] No longer test py27-zodbmaster because the configuration does not work with both tox 3 (Py27) and 4. Add some other test combinations instead. --- .github/workflows/tests.yml | 4 +++- .meta.toml | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 42878c99..37f9a68d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -34,7 +34,6 @@ jobs: - ["3.9", "docs"] - ["3.9", "coverage"] - ["2.7", "py27-msgpack1"] - - ["2.7", "py27-zodbmaster"] - ["3.7", "py37-msgpack1"] - ["3.7", "py37-uvloop"] - ["3.7", "py37-zodbmaster"] @@ -44,6 +43,9 @@ jobs: - ["3.9", "py39-uvloop"] - ["3.10", "py310-msgpack1"] - ["3.10", "py310-uvloop"] + - ["3.10", "py310-zodbmaster"] + - ["3.11", "py311-msgpack1"] + - ["3.11", "py311-uvloop"] - ["pypy-3.7", "pypy3-msgpack1"] runs-on: ${{ matrix.os[1] }} diff --git a/.meta.toml b/.meta.toml index bec839f0..6ab2a62f 100644 --- a/.meta.toml +++ b/.meta.toml @@ -50,7 +50,6 @@ additional-rules = [ [github-actions] additional-config = [ "- [\"2.7\", \"py27-msgpack1\"]", - "- [\"2.7\", \"py27-zodbmaster\"]", "- [\"3.7\", \"py37-msgpack1\"]", "- [\"3.7\", \"py37-uvloop\"]", "- [\"3.7\", \"py37-zodbmaster\"]", @@ -60,5 +59,8 @@ additional-config = [ "- [\"3.9\", \"py39-uvloop\"]", "- [\"3.10\", \"py310-msgpack1\"]", "- [\"3.10\", \"py310-uvloop\"]", + "- [\"3.10\", \"py310-zodbmaster\"]", + "- [\"3.11\", \"py311-msgpack1\"]", + "- [\"3.11\", \"py311-uvloop\"]", "- [\"pypy-3.7\", \"pypy3-msgpack1\"]", ]