Skip to content

Commit

Permalink
Config with pure python template (#15)
Browse files Browse the repository at this point in the history
* Make the tests compatible with `zope.testing >= 5`.
* Drop support for Python 2.7, 3.5, 3.6.
  • Loading branch information
Michael Howitz committed Dec 31, 2022
1 parent 48609dc commit 3939030
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 30 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,11 @@ jobs:
config:
# [Python version, tox env]
- ["3.9", "lint"]
- ["2.7", "py27"]
- ["3.5", "py35"]
- ["3.6", "py36"]
- ["3.7", "py37"]
- ["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"]
Expand Down Expand Up @@ -60,7 +56,7 @@ jobs:
- name: Coverage
if: matrix.config[1] == 'coverage'
run: |
pip install coveralls coverage-python-version
pip install coveralls
coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 1 addition & 2 deletions .meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
# https://github.com/zopefoundation/meta/tree/master/config/pure-python
[meta]
template = "pure-python"
commit-id = "200573eb414d2228d463da3de7d71a6d6335a704"
commit-id = "4dceff2f"

[python]
with-windows = false
with-pypy = true
with-future-python = false
with-legacy-python = true
with-docs = true
with-sphinx-doctests = false
with-macos = false
Expand Down
8 changes: 6 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
Changes
=========

5.0.1 (unreleased)
==================
6.0 (unreleased)
================

- Drop support for Python 2.7, 3.5, 3.6.

- Add support for Python 3.11.

- Make the tests compatible with ``zope.testing >= 5``.


5.0.0 (2022-03-25)
==================
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/pure-python
[bdist_wheel]
universal = 1
universal = 0

[flake8]
doctests = 1
Expand Down
4 changes: 0 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,7 @@ def read(*rnames):
"Intended Audience :: Developers",
"License :: OSI Approved :: Zope Public License",
"Programming Language :: Python",
"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",
Expand Down
2 changes: 1 addition & 1 deletion src/zope/keyreference/persistent.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@


@zope.interface.implementer(zope.keyreference.interfaces.IKeyReference)
class KeyReferenceToPersistent(object):
class KeyReferenceToPersistent:
"""An IKeyReference for persistent objects which is comparable.
These references compare by database name and _p_oids of the objects they
Expand Down
2 changes: 1 addition & 1 deletion src/zope/keyreference/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

@zope.component.adapter(zope.interface.Interface)
@zope.interface.implementer(zope.keyreference.interfaces.IKeyReference)
class SimpleKeyReference(object):
class SimpleKeyReference:
"""An IReference for all objects. This implementation is *not*
ZODB safe.
Expand Down
10 changes: 3 additions & 7 deletions src/zope/keyreference/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@
import doctest
import unittest

from zope.testing import renormalizing


class MockDatabase(object):
class MockDatabase:
database_name = ''


class MockJar(object):
class MockJar:

def __init__(self):
self._db = MockDatabase()
Expand All @@ -32,7 +30,7 @@ def db(self):
return self._db


class MockPersistent(object):
class MockPersistent:
_p_oid = 1
_p_jar = MockJar()

Expand Down Expand Up @@ -122,13 +120,11 @@ def test_suite():
doctest_flags = (
doctest.NORMALIZE_WHITESPACE
| doctest.ELLIPSIS
| renormalizing.IGNORE_EXCEPTION_MODULE_IN_PYTHON2
)
return unittest.TestSuite((
doctest.DocFileSuite(
'persistent.txt',
optionflags=doctest_flags,
checker=renormalizing.RENormalizing(),
),
unittest.defaultTestLoader.loadTestsFromName(__name__),
))
6 changes: 0 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,11 @@
minversion = 3.18
envlist =
lint
py27
py35
py36
py37
py38
py39
py310
py311
pypy
pypy3
docs
coverage
Expand Down Expand Up @@ -64,7 +60,6 @@ allowlist_externals =
mkdir
deps =
coverage
coverage-python-version
commands =
mkdir -p {toxinidir}/parts/htmlcov
coverage run -m zope.testrunner --test-path=src {posargs:-vc}
Expand All @@ -73,7 +68,6 @@ commands =

[coverage:run]
branch = True
plugins = coverage_python_version
source = zope.keyreference

[coverage:report]
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.0.1.dev0
6.0.dev0

0 comments on commit 3939030

Please sign in to comment.