diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index deb6535..2e30321 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,28 +17,29 @@ jobs: fail-fast: false matrix: os: - - ["ubuntu", "ubuntu-20.04"] + - ["ubuntu", "ubuntu-latest"] config: # [Python version, tox env] - - ["3.9", "lint"] - - ["3.7", "py37"] + - ["3.11", "release-check"] + - ["3.11", "lint"] - ["3.8", "py38"] - ["3.9", "py39"] - ["3.10", "py310"] - ["3.11", "py311"] - - ["3.9", "coverage"] + - ["3.12", "py312"] + - ["3.11", "coverage"] 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@v3 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.config[0] }} - name: Pip cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ matrix.config[0] }}-${{ hashFiles('setup.*', 'tox.ini') }} @@ -50,7 +51,11 @@ jobs: python -m pip install --upgrade pip pip install tox - name: Test + if: ${{ !startsWith(runner.os, 'Mac') }} run: tox -e ${{ matrix.config[1] }} + - name: Test (macOS) + if: ${{ startsWith(runner.os, 'Mac') }} + run: tox -e ${{ matrix.config[1] }}-universal2 - name: Coverage if: matrix.config[1] == 'coverage' run: | diff --git a/.meta.toml b/.meta.toml index c924fdd..71baa3e 100644 --- a/.meta.toml +++ b/.meta.toml @@ -2,7 +2,7 @@ # https://github.com/zopefoundation/meta/tree/master/config/zope-product [meta] template = "zope-product" -commit-id = "e5c611fb" +commit-id = "b1221c3c" [python] with-pypy = false @@ -10,6 +10,7 @@ with-sphinx-doctests = false with-windows = false with-future-python = false with-macos = false +with-docs = false [tox] use-flake8 = true diff --git a/CHANGES.rst b/CHANGES.rst index d11a5f4..f815d35 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,10 +1,14 @@ Changelog ========= -4.1 (unreleased) +5.0 (unreleased) ---------------- +* Add support for Python 3.12. + +* Drop support for Python 3.7. + 4.0 (2023-02-01) ---------------- diff --git a/setup.cfg b/setup.cfg index 66b1ca8..a7bfdb4 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,7 +1,5 @@ # Generated from: # https://github.com/zopefoundation/meta/tree/master/config/zope-product -[bdist_wheel] -universal = 0 [flake8] doctests = 1 @@ -17,7 +15,7 @@ ignore = force_single_line = True combine_as_imports = True sections = FUTURE,STDLIB,THIRDPARTY,ZOPE,FIRSTPARTY,LOCALFOLDER -known_third_party = six, docutils, pkg_resources, pytz +known_third_party = docutils, pkg_resources, pytz known_zope = known_first_party = default_section = ZOPE diff --git a/setup.py b/setup.py index bf1ae70..dd7c557 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ setup( name='five.localsitemanager', - version='4.1.dev0', + version='5.0.dev0', url='https://github.com/zopefoundation/five.localsitemanager', project_urls={ 'Issue Tracker': ('https://github.com/zopefoundation/' @@ -24,11 +24,11 @@ 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 3', - '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 :: 3.12', 'Programming Language :: Python :: Implementation :: CPython', 'Topic :: Internet :: WWW/HTTP :: Site Management', ], @@ -37,7 +37,7 @@ package_dir={'': 'src'}, namespace_packages=['five'], include_package_data=True, - python_requires='>=3.7', + python_requires='>=3.8', install_requires=[ 'Acquisition', 'persistent', diff --git a/src/five/localsitemanager/registry.py b/src/five/localsitemanager/registry.py index d18e6ac..406faae 100644 --- a/src/five/localsitemanager/registry.py +++ b/src/five/localsitemanager/registry.py @@ -231,7 +231,7 @@ def __repr__(self): path = getattr(site, 'getPhysicalPath', None) if path is not None and callable(path): url = '/'.join(path()) - return "<{} {}>".format(self.__class__.__name__, url) + return f"<{self.__class__.__name__} {url}>" def registeredUtilities(self): for reg in super().registeredUtilities(): diff --git a/tox.ini b/tox.ini index 7a15909..4a3a438 100644 --- a/tox.ini +++ b/tox.ini @@ -3,23 +3,45 @@ [tox] minversion = 3.18 envlist = + release-check lint - py37 py38 py39 py310 py311 + py312 coverage [testenv] skip_install = true deps = + setuptools < 69 zc.buildout >= 3.0.1 wheel > 0.37 +setenv = + py312: VIRTUALENV_PIP=23.1.2 + py312: PIP_REQUIRE_VIRTUALENV=0 commands_pre = {envbindir}/buildout -nc {toxinidir}/buildout.cfg buildout:directory={envdir} buildout:develop={toxinidir} install test commands = - {envdir}/bin/test {posargs:-cv} + {envbindir}/test {posargs:-cv} + +[testenv:release-check] +description = ensure that the distribution is ready to release +basepython = python3 +skip_install = true +deps = + twine + build + check-manifest + check-python-versions >= 0.20.0 + wheel +commands_pre = +commands = + check-manifest + check-python-versions --only setup.py,tox.ini,.github/workflows/tests.yml + python -m build --sdist --no-isolation + twine check dist/* [testenv:lint] basepython = python3 @@ -30,11 +52,7 @@ allowlist_externals = commands = isort --check-only --diff {toxinidir}/src {toxinidir}/setup.py flake8 {toxinidir}/src {toxinidir}/setup.py - check-manifest - check-python-versions deps = - check-manifest - check-python-versions flake8 isort # Useful flake8 plugins that are Python and Plone specific: @@ -54,13 +72,14 @@ commands = basepython = python3 skip_install = true allowlist_externals = + {[testenv]allowlist_externals} mkdir deps = {[testenv]deps} coverage commands = mkdir -p {toxinidir}/parts/htmlcov - coverage run {envdir}/bin/test {posargs:-cv} + coverage run {envbindir}/test {posargs:-cv} coverage html coverage report -m --fail-under=89 @@ -70,6 +89,7 @@ source = five.localsitemanager [coverage:report] precision = 2 +ignore_errors = True exclude_lines = pragma: no cover pragma: nocover