Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop Python 3.7 support and update meta templates #1214

Merged
merged 15 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 13 additions & 14 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@ jobs:
fail-fast: false
matrix:
os:
- ["ubuntu", "ubuntu-20.04"]
- ["ubuntu", "ubuntu-latest"]
- ["windows", "windows-latest"]
- ["macos", "macos-11"]
- ["macos", "macos-latest"]
config:
# [Python version, tox env]
- ["3.9", "release-check"]
- ["3.9", "lint"]
- ["3.7", "py37"]
- ["3.8", "py38"]
- ["3.9", "py39"]
- ["3.10", "py310"]
Expand All @@ -37,26 +36,22 @@ jobs:
- { os: ["windows", "windows-latest"], config: ["3.9", "lint"] }
- { os: ["windows", "windows-latest"], config: ["3.9", "docs"] }
- { os: ["windows", "windows-latest"], config: ["3.9", "coverage"] }
- { os: ["macos", "macos-11"], config: ["3.9", "release-check"] }
- { os: ["macos", "macos-11"], config: ["3.9", "lint"] }
- { os: ["macos", "macos-11"], config: ["3.9", "docs"] }
- { os: ["macos", "macos-11"], config: ["3.9", "coverage"] }
# macOS/Python 3.11+ is set up for universal2 architecture
# which causes build and package selection issues.
- { os: ["macos", "macos-11"], config: ["3.11", "py311"] }
- { os: ["macos", "macos-11"], config: ["3.12", "py312"] }
- { os: ["macos", "macos-latest"], config: ["3.9", "release-check"] }
- { os: ["macos", "macos-latest"], config: ["3.9", "lint"] }
- { os: ["macos", "macos-latest"], config: ["3.9", "docs"] }
- { os: ["macos", "macos-latest"], config: ["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.os[0] }}-${{ 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 @@ -68,7 +63,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
22 changes: 19 additions & 3 deletions .meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# https://github.com/zopefoundation/meta/tree/master/config/zope-product
[meta]
template = "zope-product"
commit-id = "cb0568c7"
commit-id = "8d837c89"

[python]
with-pypy = false
Expand Down Expand Up @@ -31,6 +31,20 @@ additional-config = [
[tox]
testenv-deps = [
"cffi",
"# The universal2 environment is for Python on macOS built with",
"# universal2 mode instead of architecture-specific. These dependencies",
"# must be installed separately, zc.buildout is incompatible with the",
"# universal2 mode and cannot install them itself.",
"universal2: zope.interface",
"universal2: zope.security",
"universal2: zope.container",
"universal2: Persistence",
"universal2: Acquisition",
"universal2: AccessControl",
"universal2: zodbpickle",
"universal2: charset_normalizer",
"universal2: MarkupSafe",
"universal2: zope.testrunner",
dataflake marked this conversation as resolved.
Show resolved Hide resolved
]
additional-envlist = [
"pre-commit",
Expand All @@ -39,11 +53,13 @@ testenv-commands-pre = [
"{envbindir}/buildout -c {toxinidir}/buildout.cfg buildout:directory={envdir} buildout:develop={toxinidir} buildout:root-directory={toxinidir}",
]
testenv-commands = [
"# The universal2 environment only runs Zope's own tests",
"universal2: {envdir}/bin/test {posargs:-vc}",
"# All other environments run the expanded alltests script",
dataflake marked this conversation as resolved.
Show resolved Hide resolved
"# the `layer` argument below suppresses a `ZCatalog` performance test",
"# which occasionally fails on GITHUB",
"{envdir}/bin/alltests --layer '!Products.PluginIndexes' {posargs:-vc}",
"!universal2: {envdir}/bin/alltests --layer '!Products.PluginIndexes' {posargs:-vc}",
d-maurer marked this conversation as resolved.
Show resolved Hide resolved
]
coverage-basepython = "python3.8"
coverage-command = "coverage run {envdir}/bin/alltests {posargs:-vc}"
testenv-additional = [
"allowlist_externals = *",
Expand Down
6 changes: 4 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ since the branch point at Zope 4.1.2.
The change log for the previous version, Zope 4, is at
https://github.com/zopefoundation/Zope/blob/4.x/CHANGES.rst

5.10.1 (unreleased)
-------------------
5.11 (unreleased)
-----------------

- Drop support for Python 3.7.

- Update to newest compatible versions of dependencies.

Expand Down
20 changes: 7 additions & 13 deletions constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@ AccessControl==6.3
Acquisition==5.2
AuthEncoding==5.0
BTrees==5.2
Chameleon==4.2.0; python_version == '3.7'
Chameleon==4.4.4; python_version == '3.8'
Chameleon==4.4.4; python_version > '3.8'
dataflake marked this conversation as resolved.
Show resolved Hide resolved
DateTime==5.5
DocumentTemplate==4.6
ExtensionClass==5.1
MultiMapping==5.0
Paste==3.10.1
PasteDeploy==2.1.1; python_version == '3.7'
PasteDeploy==3.1.0; python_version > '3.7'
PasteDeploy==3.1.0
Persistence==4.1
RestrictedPython==7.1
WSGIProxy2==0.5.1
Expand All @@ -21,21 +19,17 @@ ZConfig==4.1
ZODB==6.0
Zope2==4.0
beautifulsoup4==4.12.3
cffi==1.15.1; python_version == '3.7'
cffi==1.16.0; python_version > '3.7'
cffi==1.16.0
multipart==0.2.4
persistent==5.2
pycparser==2.21; python_version == '3.7'
pycparser==2.22; python_version > '3.7'
pycparser==2.22
python-gettext==5.0
pytz==2024.1
roman==4.2
six==1.16.0
soupsieve==2.4.1; python_version == '3.7'
soupsieve==2.5; python_version > '3.7'
soupsieve==2.5
transaction==4.0
waitress==2.1.2; python_version == '3.7'
waitress==3.0.0; python_version > '3.7'
waitress==3.0.0
z3c.pt==4.3
zExceptions==5.0
zc.lockfile==3.0.post1
Expand All @@ -49,7 +43,7 @@ zope.browserresource==5.1
zope.cachedescriptors==5.0
zope.component==6.0
zope.configuration==5.0.1
zope.container==5.2
zope.container==6.0
zope.contentprovider==5.0
zope.contenttype==5.1
zope.datetime==5.0.0
Expand All @@ -63,7 +57,7 @@ zope.globalrequest==2.0
zope.hookable==6.0
zope.i18n==5.1
zope.i18nmessageid==6.1.0
zope.interface==6.3
zope.interface==6.4.post2
zope.lifecycleevent==5.0
zope.location==5.0
zope.pagetemplate==5.1
Expand Down
2 changes: 1 addition & 1 deletion docs/INSTALL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ available:

- A supported version of Python, including the development support if
installed from system-level packages. Supported versions include
**3.7** up to **3.11**.
**3.8** up to **3.12**.

- Zope needs the Python ``zlib`` module to be importable. If you are
building your own Python from source, please be sure that you have the
Expand Down
2 changes: 1 addition & 1 deletion docs/migrations/zope5.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Prerequisites
-------------

* Update your project to run on the latest version of Zope 4.
* Update your project to run on Python 3.7+.
* Update your project to run on Python 3.8+.
* Make sure no deprecation warnings are emitted when running your tests and
when running the Zope instance

Expand Down
2 changes: 1 addition & 1 deletion docs/operation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ done.
Troubleshooting
---------------

- This version of Zope requires Python 3.7 and later.
- This version of Zope requires Python 3.8 and later.
It will *not* run with any version of PyPy.

- To build Python extensions you need to have Python configuration
Expand Down
2 changes: 1 addition & 1 deletion docs/zdgbook/GettingStarted.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ application.
Prerequisites
=============

Make sure you have Python version 3.7 or higher installed.
Make sure you have Python version 3.8 or higher installed.

Creating and activating a `VirtualEnv <https://pypi.org/project/virtualenv/>`_
is recommended.
Expand Down
2 changes: 1 addition & 1 deletion docs/zdgbook/ObjectPublishing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@ all argument type converts, such as follows::

For a full list of supported encodings, please have a look at:

https://docs.python.org/3.7/library/codecs.html#standard-encodings
https://docs.python.org/3/library/codecs.html#standard-encodings

If your pages all use a character encoding which has ASCII as a subset,
such as Latin-1, UTF-8, etc., then you do not need to specify any
Expand Down
20 changes: 7 additions & 13 deletions requirements-full.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@ AccessControl==6.3
Acquisition==5.2
AuthEncoding==5.0
BTrees==5.2
Chameleon==4.2.0; python_version == '3.7'
Chameleon==4.4.4; python_version == '3.8'
Chameleon==4.4.4; python_version > '3.8'
dataflake marked this conversation as resolved.
Show resolved Hide resolved
DateTime==5.5
DocumentTemplate==4.6
ExtensionClass==5.1
MultiMapping==5.0
Paste==3.10.1
PasteDeploy==2.1.1; python_version == '3.7'
PasteDeploy==3.1.0; python_version > '3.7'
PasteDeploy==3.1.0
Persistence==4.1
RestrictedPython==7.1
WSGIProxy2==0.5.1
Expand All @@ -22,21 +20,17 @@ ZConfig==4.1
ZODB==6.0
Zope2==4.0
beautifulsoup4==4.12.3
cffi==1.15.1; python_version == '3.7'
cffi==1.16.0; python_version > '3.7'
cffi==1.16.0
multipart==0.2.4
persistent==5.2
pycparser==2.21; python_version == '3.7'
pycparser==2.22; python_version > '3.7'
pycparser==2.22
python-gettext==5.0
pytz==2024.1
roman==4.2
six==1.16.0
soupsieve==2.4.1; python_version == '3.7'
soupsieve==2.5; python_version > '3.7'
soupsieve==2.5
transaction==4.0
waitress==2.1.2; python_version == '3.7'
waitress==3.0.0; python_version > '3.7'
waitress==3.0.0
z3c.pt==4.3
zExceptions==5.0
zc.lockfile==3.0.post1
Expand All @@ -50,7 +44,7 @@ zope.browserresource==5.1
zope.cachedescriptors==5.0
zope.component==6.0
zope.configuration==5.0.1
zope.container==5.2
zope.container==6.0
zope.contentprovider==5.0
zope.contenttype==5.1
zope.datetime==5.0.0
Expand All @@ -64,7 +58,7 @@ zope.globalrequest==2.0
zope.hookable==6.0
zope.i18n==5.1
zope.i18nmessageid==6.1.0
zope.interface==6.3
zope.interface==6.4.post2
zope.lifecycleevent==5.0
zope.location==5.0
zope.pagetemplate==5.1
Expand Down
2 changes: 0 additions & 2 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 Down
5 changes: 2 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def _read_file(filename):
README = _read_file('README.rst')
CHANGES = _read_file('CHANGES.rst')

version = '5.10.1.dev0'
version = '5.11.dev0'

setup(
name='Zope',
Expand All @@ -53,7 +53,6 @@ def _read_file(filename):
"License :: OSI Approved :: Zope Public License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
Expand All @@ -67,7 +66,7 @@ def _read_file(filename):
packages=find_packages('src'),
namespace_packages=['Products', 'Shared', 'Shared.DC', 'zmi'],
package_dir={'': 'src'},
python_requires='>= 3.7',
python_requires='>= 3.8',
install_requires=[
'AccessControl >= 5.2',
'Acquisition',
Expand Down
2 changes: 1 addition & 1 deletion src/App/Undo.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def manage_undo_transactions(self, transaction_info=(), REQUEST=None):
raise

ts.abort()
error = '{}: {}'.format(exc.__class__.__name__, str(exc))
error = f'{exc.__class__.__name__}: {str(exc)}'
return self.manage_UndoForm(self, REQUEST,
manage_tabs_message=error,
manage_tabs_type='danger')
Expand Down
2 changes: 1 addition & 1 deletion src/App/ZODBConnectionDebugger.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def get_info(connection):
# output UTC time with the standard Z time zone indicator
open_since = "{}".format(
time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime(opened)))
open_for = "{:.2f}s".format(now - opened)
open_for = f"{now - opened:.2f}s"
else:
open_since = '(closed)'
open_for = ''
Expand Down
4 changes: 2 additions & 2 deletions src/OFS/ObjectManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -788,9 +788,9 @@ def compute_size(self, ob):
if ob_size < 1024:
return '1 KiB'
elif ob_size > 1048576:
return "{:0.02f} MiB".format(ob_size / 1048576.0)
return f"{ob_size / 1048576.0:0.02f} MiB"
else:
return "{:0.0f} KiB".format(ob_size / 1024.0)
return f"{ob_size / 1024.0:0.0f} KiB"

@security.protected(access_contents_information)
def last_modified(self, ob):
Expand Down
2 changes: 1 addition & 1 deletion src/Products/SiteAccess/VirtualHostMonster.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def set_map(self, map_text, RESPONSE=None):
# Drop the protocol, if any
line = line.split('://')[-1]
try:
host, path = [x.strip() for x in line.split('/', 1)]
host, path = (x.strip() for x in line.split('/', 1))
except Exception:
raise ValueError(
'Line needs a slash between host and path: %s' % line)
Expand Down
2 changes: 1 addition & 1 deletion src/ZPublisher/tests/test_xmlrpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def test_setBody(self):
response.setBody(body)

body_str = faux._body
self.assertEqual(type(body_str), type(''))
self.assertEqual(type(body_str), str)

as_set, method = xmlrpc.client.loads(body_str)
as_set = as_set[0]
Expand Down
2 changes: 1 addition & 1 deletion src/ZTUtils/Tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def tree(self, root, expanded=None, subtree=0):
return node


_SIMPLE_TYPES = {type(''), type(b''), type(0), type(0.0), type(None)}
_SIMPLE_TYPES = {str, bytes, int, float, type(None)}


def simple_type(ob):
Expand Down
2 changes: 1 addition & 1 deletion src/Zope2/utilities/mkwsgiinstance.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def get_zope2path(python):
try:
output = subprocess.check_output(
[python, '-c', 'import Zope2; print(Zope2.__file__)'],
universal_newlines=True, # makes Python 3 return text, not bytes
text=True,
stderr=subprocess.PIPE)
zope2file = output.strip()
except subprocess.CalledProcessError:
Expand Down
Loading
Loading