Skip to content

Commit 854d1cc

Browse files
authored
Add support for Python 3.12. (#63)
1 parent f04bbec commit 854d1cc

File tree

6 files changed

+38
-14
lines changed

6 files changed

+38
-14
lines changed

.github/workflows/tests.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,30 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
os:
20-
- ["ubuntu", "ubuntu-20.04"]
20+
- ["ubuntu", "ubuntu-latest"]
2121
config:
2222
# [Python version, tox env]
23+
- ["3.9", "release-check"]
2324
- ["3.9", "lint"]
2425
- ["3.7", "py37"]
2526
- ["3.8", "py38"]
2627
- ["3.9", "py39"]
2728
- ["3.10", "py310"]
2829
- ["3.11", "py311"]
30+
- ["3.12", "py312"]
2931
- ["3.9", "coverage"]
3032

3133
runs-on: ${{ matrix.os[1] }}
3234
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
3335
name: ${{ matrix.config[1] }}
3436
steps:
35-
- uses: actions/checkout@v3
37+
- uses: actions/checkout@v4
3638
- name: Set up Python
37-
uses: actions/setup-python@v4
39+
uses: actions/setup-python@v5
3840
with:
3941
python-version: ${{ matrix.config[0] }}
4042
- name: Pip cache
41-
uses: actions/cache@v3
43+
uses: actions/cache@v4
4244
with:
4345
path: ~/.cache/pip
4446
key: ${{ runner.os }}-pip-${{ matrix.config[0] }}-${{ hashFiles('setup.*', 'tox.ini') }}

.meta.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
# https://github.com/zopefoundation/meta/tree/master/config/zope-product
33
[meta]
44
template = "zope-product"
5-
commit-id = "e5c611fb"
5+
commit-id = "4dc0484e"
66

77
[python]
88
with-pypy = false
99
with-sphinx-doctests = false
1010
with-windows = false
1111
with-future-python = false
1212
with-macos = false
13+
with-docs = false
1314

1415
[coverage]
1516
fail-under = 83

CHANGES.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Changelog
66

77
- Fix behavior when uploading no file in ``Zope >= 5.8.1``.
88

9+
- Add support for Python 3.12.
10+
911

1012
5.0 (2023-02-01)
1113
----------------

setup.cfg

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Generated from:
22
# https://github.com/zopefoundation/meta/tree/master/config/zope-product
3-
[bdist_wheel]
4-
universal = 0
53

64
[flake8]
75
doctests = 1
@@ -17,7 +15,7 @@ ignore =
1715
force_single_line = True
1816
combine_as_imports = True
1917
sections = FUTURE,STDLIB,THIRDPARTY,ZOPE,FIRSTPARTY,LOCALFOLDER
20-
known_third_party = six, docutils, pkg_resources, pytz
18+
known_third_party = docutils, pkg_resources, pytz
2119
known_zope =
2220
known_first_party =
2321
default_section = ZOPE

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
'Programming Language :: Python :: 3.9',
5050
'Programming Language :: Python :: 3.10',
5151
'Programming Language :: Python :: 3.11',
52+
'Programming Language :: Python :: 3.12',
5253
'Programming Language :: Python :: Implementation :: CPython',
5354
],
5455
python_requires='>=3.7',

tox.ini

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,45 @@
33
[tox]
44
minversion = 3.18
55
envlist =
6+
release-check
67
lint
78
py37
89
py38
910
py39
1011
py310
1112
py311
13+
py312
1214
coverage
1315

1416
[testenv]
1517
skip_install = true
1618
deps =
19+
setuptools < 69
1720
zc.buildout >= 3.0.1
1821
wheel > 0.37
22+
setenv =
23+
py312: VIRTUALENV_PIP=23.1.2
24+
py312: PIP_REQUIRE_VIRTUALENV=0
1925
commands_pre =
2026
{envbindir}/buildout -nc {toxinidir}/buildout.cfg buildout:directory={envdir} buildout:develop={toxinidir} install test
2127
commands =
22-
{envdir}/bin/test {posargs:-cv}
28+
{envbindir}/test {posargs:-cv}
29+
[testenv:release-check]
30+
description = ensure that the distribution is ready to release
31+
basepython = python3
32+
skip_install = true
33+
deps =
34+
twine
35+
build
36+
check-manifest
37+
check-python-versions >= 0.20.0
38+
wheel
39+
commands_pre =
40+
commands =
41+
check-manifest
42+
check-python-versions --only setup.py,tox.ini,.github/workflows/tests.yml
43+
python -m build --sdist --no-isolation
44+
twine check dist/*
2345

2446
[testenv:lint]
2547
basepython = python3
@@ -30,11 +52,7 @@ allowlist_externals =
3052
commands =
3153
isort --check-only --diff {toxinidir}/src {toxinidir}/setup.py
3254
flake8 {toxinidir}/src {toxinidir}/setup.py
33-
check-manifest
34-
check-python-versions
3555
deps =
36-
check-manifest
37-
check-python-versions
3856
flake8
3957
isort
4058
# Useful flake8 plugins that are Python and Plone specific:
@@ -54,13 +72,14 @@ commands =
5472
basepython = python3
5573
skip_install = true
5674
allowlist_externals =
75+
{[testenv]allowlist_externals}
5776
mkdir
5877
deps =
5978
{[testenv]deps}
6079
coverage
6180
commands =
6281
mkdir -p {toxinidir}/parts/htmlcov
63-
coverage run {envdir}/bin/test {posargs:-cv}
82+
coverage run {envbindir}/test {posargs:-cv}
6483
coverage html
6584
coverage report -m --fail-under=83
6685

@@ -70,6 +89,7 @@ source = Products.PythonScripts
7089

7190
[coverage:report]
7291
precision = 2
92+
ignore_errors = True
7393
exclude_lines =
7494
pragma: no cover
7595
pragma: nocover

0 commit comments

Comments
 (0)