Skip to content

Commit

Permalink
* Add support for Python 3.12. * Drop support for Python 3.7. (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
icemac authored Jun 12, 2024
1 parent c69b148 commit 0e4dfdc
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 23 deletions.
19 changes: 12 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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') }}
Expand All @@ -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: |
Expand Down
3 changes: 2 additions & 1 deletion .meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
# https://github.com/zopefoundation/meta/tree/master/config/zope-product
[meta]
template = "zope-product"
commit-id = "e5c611fb"
commit-id = "b1221c3c"

[python]
with-pypy = false
with-sphinx-doctests = false
with-windows = false
with-future-python = false
with-macos = false
with-docs = false

[tox]
use-flake8 = true
Expand Down
6 changes: 5 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
@@ -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)
----------------

Expand Down
4 changes: 1 addition & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/zope-product
[bdist_wheel]
universal = 0

[flake8]
doctests = 1
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/'
Expand All @@ -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',
],
Expand All @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion src/five/localsitemanager/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
34 changes: 27 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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

Expand All @@ -70,6 +89,7 @@ source = five.localsitemanager

[coverage:report]
precision = 2
ignore_errors = True
exclude_lines =
pragma: no cover
pragma: nocover
Expand Down

0 comments on commit 0e4dfdc

Please sign in to comment.