Skip to content

Commit

Permalink
Add Python 3.12 support (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
icemac committed Apr 9, 2024
1 parent 9bd86ed commit 3c277e2
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 15 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,27 @@ jobs:
- ["ubuntu", "ubuntu-20.04"]
config:
# [Python version, tox env]
- ["3.9", "release-check"]
- ["3.9", "lint"]
- ["3.7", "py37"]
- ["3.8", "py38"]
- ["3.9", "py39"]
- ["3.10", "py310"]
- ["3.11", "py311"]
- ["3.12", "py312"]
- ["3.9", "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 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/pure-python
[meta]
template = "pure-python"
commit-id = "f6bd0f55"
commit-id = "8daa034c"

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

[tox]
use-flake8 = true
Expand Down
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Change log
2.2 (unreleased)
----------------

- Add support for Python 3.12.

- Partially revert commit fb7d533aae819dc7e1aef8322c2f2d60a9a1b5d0
which caused the sqlalchemy session instance to be persisted as an instance attribute.
(`#21 <https://github.com/zopefoundation/z3c.sqlalchemy/issues/21>`_)
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/pure-python
[bdist_wheel]
universal = 0

[flake8]
doctests = 1
Expand All @@ -15,7 +13,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
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def _read_file(filename):
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
],
packages=find_packages('src'),
package_dir={'': 'src'},
Expand Down
34 changes: 26 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,55 @@
[tox]
minversion = 3.18
envlist =
release-check
lint
py37
py38
py39
py310
py311
py312
coverage

[testenv]
usedevelop = true
package = wheel
wheel_build_env = .pkg
deps =
zope.testrunner
setenv =
py312: VIRTUALENV_PIP=23.1.2
py312: PIP_REQUIRE_VIRTUALENV=0
commands =
zope-testrunner --test-path=src {posargs:-vc}
extras =
test
[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
skip_install = true
deps =
isort
flake8
commands =
isort --check-only --diff {toxinidir}/src {toxinidir}/setup.py
flake8 src setup.py
check-manifest
check-python-versions
deps =
check-manifest
check-python-versions >= 0.19.1
wheel
flake8
isort

[testenv:isort-apply]
basepython = python3
Expand Down

0 comments on commit 3c277e2

Please sign in to comment.