Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix GHA + support Python 3.11. #216

Merged
merged 4 commits into from
Dec 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fail-fast: false
matrix:
os:
- ubuntu
- ["ubuntu", "ubuntu-20.04"]
config:
# [Python version, tox env]
- ["3.9", "lint"]
Expand All @@ -28,12 +28,12 @@ jobs:
- ["3.8", "py38"]
- ["3.9", "py39"]
- ["3.10", "py310"]
- ["3.11", "py311"]
- ["pypy-2.7", "pypy"]
- ["pypy-3.7", "pypy3"]
- ["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"]
Expand All @@ -43,18 +43,22 @@ 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 }}-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') }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ lib64
log/
parts/
pyvenv.cfg
testing.log
var/
11 changes: 7 additions & 4 deletions .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/pure-python
[meta]
template = "pure-python"
commit-id = "0c07a1cfd78d28a07aebd23383ed16959f166574"
commit-id = "200573eb414d2228d463da3de7d71a6d6335a704"

[python]
with-windows = false
Expand All @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is interesting. We had it enabled, so flake8 should be passing. What's the reason for disabling it now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it requires imports to be sorted using isort. There are many open PRs which might get conflicts if we do this.

On the other hand I have no problem trying it – any suggestions?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is at least one very large PR open from @d-maurer, please hold off with any large "cosmetic" changes until then.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see. That makes sense, thank you for explaining!

testenv-commands = [
"# Run unit tests first.",
"zope-testrunner -u --test-path=src -a 1000 {posargs:-vc}",
Expand All @@ -22,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 = [
Expand All @@ -49,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\"]",
Expand All @@ -59,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\"]",
]
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
43 changes: 21 additions & 22 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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={
Expand Down
17 changes: 8 additions & 9 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ envlist =
py38
py39
py310
py311
pypy
pypy3
docs
Expand All @@ -20,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
Expand All @@ -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
Expand All @@ -63,13 +62,13 @@ 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
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
Expand Down