Skip to content

Commit

Permalink
Drop Python 3.7 support and update meta templates (#1214)
Browse files Browse the repository at this point in the history
* - drop Python 3.7 compatibility and document it

* - run pyupgrade

* - fix Python version used for coverage test and try to fix macOS issues

* - experiment: use macos-13 runners that are supposedly x86_64 based

* - revert experiment

* - experiment: Try to set up Python for macOS for a specific architecture

* - use macOS specific architecture

* - last try avoiding universal2

* - using the architecture flag doesn't help

* - use custom test configurations for macOS / universal2

* - remove macOS-specific Python version restrictions

* Update src/Zope2/utilities/mkwsgiinstance.py

Co-authored-by: Michael Howitz <[email protected]>

* - reinstate Python 3.8 pin for Chameleon

* - move zope.container pin so it doesn't get installed twice

* - move pins for new c-code package releases

---------

Co-authored-by: Michael Howitz <[email protected]>
  • Loading branch information
dataflake and icemac authored May 30, 2024
1 parent 0b5b83d commit cb1a4fb
Show file tree
Hide file tree
Showing 23 changed files with 113 additions and 136 deletions.
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
23 changes: 20 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,21 @@ 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: -c {toxinidir}/constraints.txt",
"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",
]
additional-envlist = [
"pre-commit",
Expand All @@ -39,11 +54,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",
"# 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}",
]
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
34 changes: 14 additions & 20 deletions constraints.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
AccessControl==6.3
Acquisition==5.2
AccessControl==7.0
Acquisition==6.0
AuthEncoding==5.0
BTrees==5.2
Chameleon==4.2.0; python_version == '3.7'
BTrees==6.0
Chameleon==4.4.4; python_version == '3.8'
Chameleon==4.4.4; python_version > '3.8'
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'
Persistence==4.1
PasteDeploy==3.1.0
Persistence==5.0
RestrictedPython==7.1
WSGIProxy2==0.5.1
WebOb==1.8.7
Expand All @@ -21,26 +19,22 @@ 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'
persistent==6.0
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
zc.recipe.egg==2.0.7
zodbpickle==3.3
zodbpickle==4.0
zope.annotation==5.0
zope.browser==3.0
zope.browsermenu==5.0
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 All @@ -72,7 +66,7 @@ zope.proxy==5.2
zope.ptresource==5.0
zope.publisher==7.0
zope.schema==7.0.1
zope.security==6.2
zope.security==7.0
zope.sequencesort==5.0
zope.site==5.0
zope.size==5.0
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
34 changes: 14 additions & 20 deletions requirements-full.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
-e git+https://github.com/zopefoundation/Zope.git@master#egg=Zope
AccessControl==6.3
Acquisition==5.2
AccessControl==7.0
Acquisition==6.0
AuthEncoding==5.0
BTrees==5.2
Chameleon==4.2.0; python_version == '3.7'
BTrees==6.0
Chameleon==4.4.4; python_version == '3.8'
Chameleon==4.4.4; python_version > '3.8'
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'
Persistence==4.1
PasteDeploy==3.1.0
Persistence==5.0
RestrictedPython==7.1
WSGIProxy2==0.5.1
WebOb==1.8.7
Expand All @@ -22,26 +20,22 @@ 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'
persistent==6.0
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
zc.recipe.egg==2.0.7
zodbpickle==3.3
zodbpickle==4.0
zope.annotation==5.0
zope.browser==3.0
zope.browsermenu==5.0
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 All @@ -73,7 +67,7 @@ zope.proxy==5.2
zope.ptresource==5.0
zope.publisher==7.0
zope.schema==7.0.1
zope.security==6.2
zope.security==7.0
zope.sequencesort==5.0
zope.site==5.0
zope.size==5.0
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
Loading

0 comments on commit cb1a4fb

Please sign in to comment.