Skip to content

Commit 44ee7c5

Browse files
authored
Drop support for Python 3.7. (#16)
1 parent 7a54b4d commit 44ee7c5

File tree

7 files changed

+59
-31
lines changed

7 files changed

+59
-31
lines changed

.github/workflows/tests.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,29 @@ 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", "lint"]
24-
- ["3.7", "py37"]
23+
- ["3.11", "release-check"]
24+
- ["3.11", "lint"]
2525
- ["3.8", "py38"]
2626
- ["3.9", "py39"]
2727
- ["3.10", "py310"]
2828
- ["3.11", "py311"]
29-
- ["3.9", "coverage"]
29+
- ["3.12", "py312"]
30+
- ["3.11", "coverage"]
3031

3132
runs-on: ${{ matrix.os[1] }}
3233
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
3334
name: ${{ matrix.config[1] }}
3435
steps:
35-
- uses: actions/checkout@v3
36+
- uses: actions/checkout@v4
3637
- name: Set up Python
37-
uses: actions/setup-python@v4
38+
uses: actions/setup-python@v5
3839
with:
3940
python-version: ${{ matrix.config[0] }}
4041
- name: Pip cache
41-
uses: actions/cache@v3
42+
uses: actions/cache@v4
4243
with:
4344
path: ~/.cache/pip
4445
key: ${{ runner.os }}-pip-${{ matrix.config[0] }}-${{ hashFiles('setup.*', 'tox.ini') }}
@@ -50,7 +51,11 @@ jobs:
5051
python -m pip install --upgrade pip
5152
pip install tox
5253
- name: Test
54+
if: ${{ !startsWith(runner.os, 'Mac') }}
5355
run: tox -e ${{ matrix.config[1] }}
56+
- name: Test (macOS)
57+
if: ${{ startsWith(runner.os, 'Mac') }}
58+
run: tox -e ${{ matrix.config[1] }}-universal2
5459
- name: Coverage
5560
if: matrix.config[1] == 'coverage'
5661
run: |

.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 = "b1221c3c"
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
[tox]
1516
use-flake8 = true

CHANGES.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
Changelog
22
=========
33

4-
3.1 (unreleased)
4+
4.0 (unreleased)
55
----------------
66

7+
* Add support for Python 3.12.
8+
9+
* Drop support for Python 3.7.
10+
711

812
3.0 (2023-02-01)
913
----------------

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
@@ -19,7 +17,7 @@ ignore-bad-ideas =
1917
force_single_line = True
2018
combine_as_imports = True
2119
sections = FUTURE,STDLIB,THIRDPARTY,ZOPE,FIRSTPARTY,LOCALFOLDER
22-
known_third_party = six, docutils, pkg_resources, pytz
20+
known_third_party = docutils, pkg_resources, pytz
2321
known_zope = AccessControl, Products.Five, Testing, ZPublisher
2422
known_first_party =
2523
default_section = ZOPE

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
setup(
55
name='five.formlib',
6-
version='3.1.dev0',
6+
version='4.0.dev0',
77
url='https://github.com/zopefoundation/five.formlib',
88
license='ZPL 2.1',
99
description='zope.formlib integration for Zope.',
@@ -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.7",
2322
"Programming Language :: Python :: 3.8",
2423
"Programming Language :: Python :: 3.9",
2524
"Programming Language :: Python :: 3.10",
2625
"Programming Language :: Python :: 3.11",
26+
"Programming Language :: Python :: 3.12",
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.7',
37+
python_requires='>=3.8',
3838
install_requires=[
3939
'setuptools',
4040
'transaction',

src/five/formlib/tests/forms.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ An unprotected form can be accessed with anonymously:
4747

4848
We don't have access, we will not be able to get to the protected add form:
4949

50-
>>> browser.open("http://localhost/test_folder_1_/ftf/+/protectedaddform.html")
50+
>>> browser.open("http://localhost/test_folder_1_/ftf/+/protectedaddform.html")
5151
>>> print(browser.headers)
5252
Status: 401 ...
5353
...
@@ -83,7 +83,7 @@ specified attribute is the default value:
8383
>>> edittest = self.folder.ftf.edittest
8484
>>> str(edittest.title)
8585
'title'
86-
>>> edittest.description #XXX shouldn't we get a u'' here???
86+
>>> edittest.description #XXX shouldn't we get a '' here???
8787

8888
We can also verify that the IObjectCreatedEvent was fired, and the test
8989
subscriber we registered set a flag indicating such:
@@ -124,7 +124,7 @@ We will see that nothing has changed:
124124

125125
>>> str(edittest.title)
126126
'title'
127-
>>> edittest.description #XXX shouldn't we get a u'' here???
127+
>>> edittest.description #XXX shouldn't we get a '' here???
128128
>>> getattr(edittest, '_modified_flag', False)
129129
False
130130

@@ -198,12 +198,12 @@ the content, this means that no IObjectModified event should have been fired
198198
Unicode-safety of forms
199199
-----------------------
200200

201-
Automatically generated forms support unicode (native strings
202-
under Python 3). Here we will enter the following two
203-
chinese sequences (How do you do? and I'm doing good) in forms:
201+
Automatically generated forms support native strings (formerly known as
202+
``unicode``). Here we will enter the following two chinese sequences ("How do
203+
you do?" and "I'm doing good.") in forms:
204204

205-
>>> ni_hao = u'\u4f60\u597d'
206-
>>> wo_hen_hao = u'\u6211\u5f88\u597d'
205+
>>> ni_hao = '\u4f60\u597d'
206+
>>> wo_hen_hao = '\u6211\u5f88\u597d'
207207

208208
First, it's imaginable that we make a mistake and enter one of the
209209
phrases in the integer field:
@@ -316,7 +316,7 @@ element to the list:
316316

317317
Now, let's enter some more Chinese:
318318

319-
>>> de_guo = u'\u5fb7\u56fd'
319+
>>> de_guo = '\u5fb7\u56fd'
320320

321321
>>> print(http_request(
322322
... "/test_folder_1_/ftf/unicodetest/@@edit.html", (

tox.ini

Lines changed: 27 additions & 7 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
7-
py37
88
py38
99
py39
1010
py310
1111
py311
12+
py312
1213
coverage
1314

1415
[testenv]
1516
skip_install = true
1617
deps =
18+
setuptools < 69
1719
zc.buildout >= 3.0.1
1820
wheel > 0.37
21+
setenv =
22+
py312: VIRTUALENV_PIP=23.1.2
23+
py312: PIP_REQUIRE_VIRTUALENV=0
1924
commands_pre =
2025
{envbindir}/buildout -nc {toxinidir}/buildout.cfg buildout:directory={envdir} buildout:develop={toxinidir} install test
2126
commands =
22-
{envdir}/bin/test {posargs:-cv}
27+
{envbindir}/test {posargs:-cv}
28+
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=82
6685

@@ -70,6 +89,7 @@ source = five.formlib
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)