diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1506628..f2d9629 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,32 +17,29 @@ jobs: fail-fast: false matrix: os: - - ubuntu + - ["ubuntu", "ubuntu-20.04"] 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"] - - ["pypy-2.7", "pypy"] + - ["3.11", "py311"] - ["pypy-3.7", "pypy3"] - ["3.9", "coverage"] - 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') }} @@ -58,7 +55,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 }} diff --git a/.meta.toml b/.meta.toml index 139578d..a6e04d5 100644 --- a/.meta.toml +++ b/.meta.toml @@ -2,14 +2,14 @@ # https://github.com/zopefoundation/meta/tree/master/config/pure-python [meta] template = "pure-python" -commit-id = "ae61f414cfef4e129d275679c6a76dc67b1a2c11" +commit-id = "4f0f7596" [python] with-pypy = true -with-legacy-python = true with-sphinx-doctests = false with-windows = false with-future-python = false +with-macos = false [coverage] fail-under = 99 diff --git a/CHANGES.rst b/CHANGES.rst index 25d7dfc..eb65f8c 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -2,10 +2,12 @@ CHANGES ========= -4.1.1 (unreleased) -================== +5.0 (unreleased) +================ + +- Add support for Python 3.11. -- Nothing changed yet. +- Drop support for Python 2.7, 3.5, 3.6. 4.1.0 (2022-08-05) diff --git a/setup.cfg b/setup.cfg index 8e35d5a..87de6bd 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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 diff --git a/setup.py b/setup.py index 6028f36..96337a2 100644 --- a/setup.py +++ b/setup.py @@ -31,7 +31,7 @@ def read(*rnames): setup(name='zope.app.preference', - version='4.1.1.dev0', + version='5.0.dev0', author='Zope Foundation and Contributors', author_email='zope-dev@zope.org', description='User Preferences Framework ZMI UI', @@ -50,15 +50,12 @@ 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', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', 'Natural Language :: English', @@ -71,6 +68,7 @@ def read(*rnames): packages=find_packages('src'), package_dir={'': 'src'}, namespace_packages=['zope', 'zope.app'], + python_requires='>=3.7', extras_require={ 'test': [ 'docutils', diff --git a/src/zope/app/preference/browser.py b/src/zope/app/preference/browser.py index a480f06..1bfdddf 100644 --- a/src/zope/app/preference/browser.py +++ b/src/zope/app/preference/browser.py @@ -42,7 +42,7 @@ class PreferencesMacros(StandardMacros): @zope.interface.implementer(IObjectFindFilter) -class PreferenceGroupFilter(object): +class PreferenceGroupFilter: """A special filter for preferences""" def matches(self, obj): @@ -84,8 +84,8 @@ def __init__(self, context, request): name = translate(context.__title__, context=request, default=context.__title__) - self.label = Message(pref_msg, mapping={u'name': name}) - super(EditPreferenceGroup, self).__init__(context, request) + self.label = Message(pref_msg, mapping={'name': name}) + super().__init__(context, request) self.setPrefix(context.__id__) def getIntroduction(self): @@ -98,7 +98,7 @@ def getIntroduction(self): text = re.sub('\n[ ]{%i}' % cols, '\n', text).strip() if not text: - return u'' + return '' # Render the description as ReST. source = zope.component.createObject('zope.source.rest', text) diff --git a/src/zope/app/preference/tests.py b/src/zope/app/preference/tests.py index 008bda2..f817c30 100644 --- a/src/zope/app/preference/tests.py +++ b/src/zope/app/preference/tests.py @@ -53,7 +53,7 @@ class Source(text_type): @implementer(IFactory) -class SourceFactory(object): +class SourceFactory: """Creates an ISource object.""" def __init__(self, iface, title='', description=''): @@ -68,8 +68,8 @@ def __call__(self, ustr): ReStructuredTextSourceFactory = SourceFactory( - IReStructuredTextSource, u"ReStructured Text (ReST)", - u"ReStructured Text (ReST) Source") + IReStructuredTextSource, "ReStructured Text (ReST)", + "ReStructured Text (ReST) Source") class _ReStructuredTextToHTMLRenderer(BrowserView): @@ -142,7 +142,7 @@ def render(self, settings_overrides={}): writer_name='html', settings_overrides=overrides, ) - return u''.join( + return ''.join( (parts['body_pre_docinfo'], parts['docinfo'], parts['body'])) diff --git a/tox.ini b/tox.ini index e9132a1..1d56da2 100644 --- a/tox.ini +++ b/tox.ini @@ -4,14 +4,11 @@ minversion = 3.18 envlist = lint - py27 - py35 - py36 py37 py38 py39 py310 - pypy + py311 pypy3 coverage @@ -40,6 +37,7 @@ deps = [testenv:isort-apply] basepython = python3 +skip_install = true commands_pre = deps = isort @@ -52,16 +50,14 @@ allowlist_externals = mkdir deps = coverage - coverage-python-version commands = mkdir -p {toxinidir}/parts/htmlcov coverage run -m zope.testrunner --test-path=src {posargs:-vc} - coverage html - coverage report -m --fail-under=99 + coverage html --ignore-errors + coverage report --ignore-errors --show-missing --fail-under=99 [coverage:run] branch = True -plugins = coverage_python_version source = zope.app.preference [coverage:report]