Skip to content

Commit 3be4b9d

Browse files
Update supported Python versions (#18)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 7f6ed97 commit 3be4b9d

11 files changed

+123
-61
lines changed

.github/workflows/pre-commit.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Generated from:
2+
# https://github.com/zopefoundation/meta/tree/master/config/zope-product
3+
name: pre-commit
4+
5+
on:
6+
pull_request:
7+
push:
8+
branches:
9+
- master
10+
# Allow to run this workflow manually from the Actions tab
11+
workflow_dispatch:
12+
13+
env:
14+
FORCE_COLOR: 1
15+
16+
jobs:
17+
pre-commit:
18+
permissions:
19+
contents: read
20+
pull-requests: write
21+
name: linting
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
- uses: actions/setup-python@v5
26+
with:
27+
python-version: 3.x
28+
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd #v3.0.1
29+
with:
30+
extra_args: --all-files --show-diff-on-failure
31+
env:
32+
PRE_COMMIT_COLOR: always
33+
- uses: pre-commit-ci/lite-action@5d6cc0eb514c891a40562a58a8e71576c5c7fb43 #v1.1.0
34+
if: always()
35+
with:
36+
msg: Apply pre-commit code formatting

.github/workflows/tests.yml

+11-8
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212

1313
jobs:
1414
build:
15+
permissions:
16+
contents: read
17+
pull-requests: write
1518
strategy:
1619
# We want to see all failures:
1720
fail-fast: false
@@ -20,14 +23,13 @@ jobs:
2023
- ["ubuntu", "ubuntu-latest"]
2124
config:
2225
# [Python version, tox env]
23-
- ["3.11", "release-check"]
24-
- ["3.11", "lint"]
25-
- ["3.8", "py38"]
26-
- ["3.9", "py39"]
27-
- ["3.10", "py310"]
28-
- ["3.11", "py311"]
29-
- ["3.12", "py312"]
30-
- ["3.11", "coverage"]
26+
- ["3.11", "release-check"]
27+
- ["3.9", "py39"]
28+
- ["3.10", "py310"]
29+
- ["3.11", "py311"]
30+
- ["3.12", "py312"]
31+
- ["3.13", "py313"]
32+
- ["3.11", "coverage"]
3133

3234
runs-on: ${{ matrix.os[1] }}
3335
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
@@ -38,6 +40,7 @@ jobs:
3840
uses: actions/setup-python@v5
3941
with:
4042
python-version: ${{ matrix.config[0] }}
43+
allow-prereleases: true
4144
- name: Pip cache
4245
uses: actions/cache@v4
4346
with:

.meta.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# https://github.com/zopefoundation/meta/tree/master/config/zope-product
33
[meta]
44
template = "zope-product"
5-
commit-id = "b1221c3c"
5+
commit-id = "55111d56"
66

77
[python]
88
with-pypy = false

.pre-commit-config.yaml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Generated from:
2+
# https://github.com/zopefoundation/meta/tree/master/config/zope-product
3+
minimum_pre_commit_version: '3.6'
4+
repos:
5+
- repo: https://github.com/pycqa/isort
6+
rev: "5.13.2"
7+
hooks:
8+
- id: isort
9+
- repo: https://github.com/hhatto/autopep8
10+
rev: "v2.3.2"
11+
hooks:
12+
- id: autopep8
13+
args: [--in-place, --aggressive, --aggressive]
14+
- repo: https://github.com/asottile/pyupgrade
15+
rev: v3.19.1
16+
hooks:
17+
- id: pyupgrade
18+
args: [--py39-plus]
19+
- repo: https://github.com/isidentical/teyit
20+
rev: 0.4.3
21+
hooks:
22+
- id: teyit
23+
- repo: https://github.com/PyCQA/flake8
24+
rev: "7.1.1"
25+
hooks:
26+
- id: flake8
27+
additional_dependencies:
28+
- flake8-debugger == 4.1.2

CHANGES.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ Changelog
44
4.0 (unreleased)
55
----------------
66

7-
* Add support for Python 3.12.
7+
* Add support for Python 3.12, 3.13.
88

9-
* Drop support for Python 3.7.
9+
* Drop support for Python 3.7, 3.8.
1010

1111
* Adapt tests to ``multipart >= 1.x``.
1212

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!--
22
Generated from:
33
https://github.com/zopefoundation/meta/tree/master/config/zope-product
4-
-->
4+
-->
55
# Contributing to zopefoundation projects
66

77
The projects under the zopefoundation GitHub organization are open source and

MANIFEST.in

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ include *.rst
55
include *.txt
66
include buildout.cfg
77
include tox.ini
8+
include .pre-commit-config.yaml
89

910
recursive-include src *.py
1011
recursive-include src *.po

pyproject.toml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#
2+
# Generated from:
3+
# https://github.com/zopefoundation/meta/tree/master/config/zope-product
4+
5+
[build-system]
6+
requires = ["setuptools <= 75.6.0"]
7+
build-backend = "setuptools.build_meta"
8+
9+
[tool.coverage.run]
10+
branch = true
11+
source = ["five.formlib"]
12+
13+
[tool.coverage.report]
14+
fail_under = 82
15+
precision = 2
16+
ignore_errors = true
17+
show_missing = true
18+
exclude_lines = ["pragma: no cover", "pragma: nocover", "except ImportError:", "raise NotImplementedError", "if __name__ == '__main__':", "self.fail", "raise AssertionError", "raise unittest.Skip"]
19+
20+
[tool.coverage.html]
21+
directory = "parts/htmlcov"

setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
"License :: OSI Approved :: Zope Public License",
2020
"Operating System :: OS Independent",
2121
"Programming Language :: Python :: 3",
22-
"Programming Language :: Python :: 3.8",
2322
"Programming Language :: Python :: 3.9",
2423
"Programming Language :: Python :: 3.10",
2524
"Programming Language :: Python :: 3.11",
2625
"Programming Language :: Python :: 3.12",
26+
"Programming Language :: Python :: 3.13",
2727
"Programming Language :: Python :: Implementation :: CPython",
2828
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
2929
"Topic :: Internet :: WWW/HTTP :: WSGI :: Application",
@@ -34,7 +34,7 @@
3434
package_dir={'': 'src'},
3535
namespace_packages=['five'],
3636
include_package_data=True,
37-
python_requires='>=3.8',
37+
python_requires='>=3.9',
3838
install_requires=[
3939
'setuptools',
4040
'transaction',

src/five/formlib/tests/test_formlib.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ def test_get_widgets_for_schema_fields():
6969

7070

7171
def encodeMultipartFormdata(
72-
fields: typing.List[typing.Tuple[str, str]],
73-
files: typing.Optional[list] = None) -> typing.Tuple[str, str]:
72+
fields: list[tuple[str, str]],
73+
files: typing.Optional[list] = None) -> tuple[str, str]:
7474
"""Encode fields and files to be used in a multipart/form-data request.
7575
7676
Returns a tuple of content-type and content.

tox.ini

+18-45
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,39 @@ minversion = 3.18
55
envlist =
66
release-check
77
lint
8-
py38
98
py39
109
py310
1110
py311
1211
py312
12+
py313
1313
coverage
1414

1515
[testenv]
1616
skip_install = true
1717
deps =
18-
setuptools < 69
19-
zc.buildout >= 3.0.1
18+
setuptools <= 75.6.0
19+
zc.buildout >= 3.1
2020
wheel > 0.37
2121
setenv =
22-
py312: VIRTUALENV_PIP=23.1.2
23-
py312: PIP_REQUIRE_VIRTUALENV=0
2422
commands_pre =
2523
{envbindir}/buildout -nc {toxinidir}/buildout.cfg buildout:directory={envdir} buildout:develop={toxinidir} install test
2624
commands =
2725
{envbindir}/test {posargs:-cv}
2826

27+
[testenv:setuptools-latest]
28+
basepython = python3
29+
deps =
30+
git+https://github.com/pypa/setuptools.git\#egg=setuptools
31+
zc.buildout >= 3.1
32+
wheel > 0.37
33+
34+
2935
[testenv:release-check]
3036
description = ensure that the distribution is ready to release
3137
basepython = python3
3238
skip_install = true
3339
deps =
40+
setuptools <= 75.6.0
3441
twine
3542
build
3643
check-manifest
@@ -44,29 +51,14 @@ commands =
4451
twine check dist/*
4552

4653
[testenv:lint]
54+
description = This env runs all linters configured in .pre-commit-config.yaml
4755
basepython = python3
48-
commands_pre =
49-
mkdir -p {toxinidir}/parts/flake8
50-
allowlist_externals =
51-
mkdir
52-
commands =
53-
isort --check-only --diff {toxinidir}/src {toxinidir}/setup.py
54-
flake8 {toxinidir}/src {toxinidir}/setup.py
56+
skip_install = true
5557
deps =
56-
flake8
57-
isort
58-
# Useful flake8 plugins that are Python and Plone specific:
59-
flake8-coding
60-
flake8-debugger
61-
mccabe
62-
63-
[testenv:isort-apply]
64-
basepython = python3
58+
pre-commit
6559
commands_pre =
66-
deps =
67-
isort
6860
commands =
69-
isort {toxinidir}/src {toxinidir}/setup.py []
61+
pre-commit run --all-files --show-diff-on-failure
7062

7163
[testenv:coverage]
7264
basepython = python3
@@ -76,28 +68,9 @@ allowlist_externals =
7668
mkdir
7769
deps =
7870
{[testenv]deps}
79-
coverage
71+
coverage[toml]
8072
commands =
8173
mkdir -p {toxinidir}/parts/htmlcov
8274
coverage run {envbindir}/test {posargs:-cv}
8375
coverage html
84-
coverage report -m --fail-under=82
85-
86-
[coverage:run]
87-
branch = True
88-
source = five.formlib
89-
90-
[coverage:report]
91-
precision = 2
92-
ignore_errors = True
93-
exclude_lines =
94-
pragma: no cover
95-
pragma: nocover
96-
except ImportError:
97-
raise NotImplementedError
98-
if __name__ == '__main__':
99-
self.fail
100-
raise AssertionError
101-
102-
[coverage:html]
103-
directory = parts/htmlcov
76+
coverage report

0 commit comments

Comments
 (0)