From 60e30a6afab728ecf63484ce4702eccd8bd88030 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Wed, 18 Feb 2026 08:54:03 +0100 Subject: [PATCH 1/7] Drop support for Python 3.9. --- CHANGES.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index d13a1fa..ceda03c 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,7 +4,7 @@ Changes 5.1 (unreleased) ---------------- -- Nothing changed yet. +- Drop support for Python 3.9. 5.0 (2025-06-18) From 1cb3abc348c930dc0669b6deb409eef90d2563e5 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Wed, 18 Feb 2026 08:54:03 +0100 Subject: [PATCH 2/7] Add support for Python 3.14. --- CHANGES.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index ceda03c..05e614f 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,6 +4,8 @@ Changes 5.1 (unreleased) ---------------- +- Add support for Python 3.14. + - Drop support for Python 3.9. From 1ea4cdf3ba5a1ec35bbd6cda2fd766fa44157ffa Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Wed, 18 Feb 2026 09:12:48 +0100 Subject: [PATCH 3/7] Configuring for pure-python --- .editorconfig | 8 ++++---- .github/workflows/pre-commit.yml | 10 +++++----- .github/workflows/tests.yml | 19 ++++++++----------- .gitignore | 4 ++-- .meta.toml | 6 +++--- .pre-commit-config.yaml | 12 ++++++------ CONTRIBUTING.md | 4 ++-- MANIFEST.in | 4 ++-- pyproject.toml | 4 +++- setup.cfg | 4 ++-- src/grokcore/security/tests/test_base.py | 9 ++++++--- .../security/tests/test_functional.py | 9 ++++++--- tox.ini | 12 ++++++------ 13 files changed, 55 insertions(+), 50 deletions(-) diff --git a/.editorconfig b/.editorconfig index c5508b9..e4b8673 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,8 +1,8 @@ -# Generated from: -# https://github.com/zopefoundation/meta/tree/master/config/pure-python +# Generated with zope.meta (https://zopemeta.readthedocs.io/) from: +# https://github.com/zopefoundation/meta/tree/master/src/zope/meta/pure-python # # EditorConfig Configuration file, for more details see: -# http://EditorConfig.org +# https://EditorConfig.org # EditorConfig is a convention description, that could be interpreted # by multiple editors to enforce common coding conventions for specific # file types @@ -12,7 +12,7 @@ root = true -[*] # For All Files +[*] # Unix-style newlines with a newline ending every file end_of_line = lf insert_final_newline = true diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index ff77ae6..8a1cde6 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -1,5 +1,5 @@ -# Generated from: -# https://github.com/zopefoundation/meta/tree/master/config/pure-python +# Generated with zope.meta (https://zopemeta.readthedocs.io/) from: +# https://github.com/zopefoundation/meta/tree/master/src/zope/meta/pure-python name: pre-commit on: @@ -21,10 +21,10 @@ jobs: name: linting runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - uses: actions/checkout@v6 + - uses: actions/setup-python@v6 with: - python-version: 3.x + python-version: '3.13' - uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd #v3.0.1 with: extra_args: --all-files --show-diff-on-failure diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cfec5c9..2d17fd0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,5 +1,5 @@ -# Generated from: -# https://github.com/zopefoundation/meta/tree/master/config/pure-python +# Generated with zope.meta (https://zopemeta.readthedocs.io/) from: +# https://github.com/zopefoundation/meta/tree/master/src/zope/meta/pure-python name: tests on: @@ -24,36 +24,33 @@ jobs: config: # [Python version, tox env] - ["3.11", "release-check"] - - ["3.9", "py39"] - ["3.10", "py310"] - ["3.11", "py311"] - ["3.12", "py312"] - ["3.13", "py313"] - - ["pypy-3.10", "pypy3"] + - ["3.14", "py314"] + - ["pypy-3.11", "pypy3"] - ["3.11", "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@v4 + - uses: actions/checkout@v6 with: persist-credentials: false - name: Install uv + caching - uses: astral-sh/setup-uv@v6 + # astral/setup-uv@7.3.0 + uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b with: enable-cache: true cache-dependency-glob: | setup.* tox.ini - python-version: ${{ matrix.matrix.config[0] }} + python-version: ${{ matrix.config[0] }} github-token: ${{ secrets.GITHUB_TOKEN }} - name: Test - if: ${{ !startsWith(runner.os, 'Mac') }} run: uvx --with tox-uv tox -e ${{ matrix.config[1] }} - - name: Test (macOS) - if: ${{ startsWith(runner.os, 'Mac') }} - run: uvx --with tox-uv tox -e ${{ matrix.config[1] }}-universal2 - name: Coverage if: matrix.config[1] == 'coverage' run: | diff --git a/.gitignore b/.gitignore index 1f321f5..2596a59 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ -# Generated from: -# https://github.com/zopefoundation/meta/tree/master/config/pure-python +# Generated with zope.meta (https://zopemeta.readthedocs.io/) from: +# https://github.com/zopefoundation/meta/tree/master/src/zope/meta/pure-python *.dll *.egg-info/ *.profraw diff --git a/.meta.toml b/.meta.toml index f942a87..fcdf52b 100644 --- a/.meta.toml +++ b/.meta.toml @@ -1,8 +1,8 @@ -# Generated from: -# https://github.com/zopefoundation/meta/tree/master/config/pure-python +# Generated with zope.meta (https://zopemeta.readthedocs.io/) from: +# https://github.com/zopefoundation/meta/tree/master/src/zope/meta/pure-python [meta] template = "pure-python" -commit-id = "7d59ab0f" +commit-id = "5a7f2bc0" [python] with-pypy = true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b201c4b..56fecdb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,9 +1,9 @@ -# Generated from: -# https://github.com/zopefoundation/meta/tree/master/config/pure-python +# Generated with zope.meta (https://zopemeta.readthedocs.io/) from: +# https://github.com/zopefoundation/meta/tree/master/src/zope/meta/pure-python minimum_pre_commit_version: '3.6' repos: - repo: https://github.com/pycqa/isort - rev: "6.0.1" + rev: "7.0.0" hooks: - id: isort - repo: https://github.com/hhatto/autopep8 @@ -12,16 +12,16 @@ repos: - id: autopep8 args: [--in-place, --aggressive, --aggressive] - repo: https://github.com/asottile/pyupgrade - rev: v3.19.1 + rev: v3.21.2 hooks: - id: pyupgrade - args: [--py39-plus] + args: [--py310-plus] - repo: https://github.com/isidentical/teyit rev: 0.4.3 hooks: - id: teyit - repo: https://github.com/PyCQA/flake8 - rev: "7.2.0" + rev: "7.3.0" hooks: - id: flake8 additional_dependencies: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0ab12fe..ca517f4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contributing to zopefoundation projects diff --git a/MANIFEST.in b/MANIFEST.in index b828f41..7ca42bf 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,5 @@ -# Generated from: -# https://github.com/zopefoundation/meta/tree/master/config/pure-python +# Generated with zope.meta (https://zopemeta.readthedocs.io/) from: +# https://github.com/zopefoundation/meta/tree/master/src/zope/meta/pure-python include *.md include *.rst include *.txt diff --git a/pyproject.toml b/pyproject.toml index 86c3f5f..c8633b2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,9 +1,11 @@ +# Generated with zope.meta (https://zopemeta.readthedocs.io/) from: +# https://github.com/zopefoundation/meta/tree/master/src/zope/meta/pure-python # Generated from: # https://github.com/zopefoundation/meta/tree/master/config/pure-python [build-system] requires = [ - "setuptools == 78.1.1", + "setuptools >= 78.1.1,< 81", "wheel", ] build-backend = "setuptools.build_meta" diff --git a/setup.cfg b/setup.cfg index 1b193ce..af8a719 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ -# Generated from: -# https://github.com/zopefoundation/meta/tree/master/config/pure-python +# Generated with zope.meta (https://zopemeta.readthedocs.io/) from: +# https://github.com/zopefoundation/meta/tree/master/src/zope/meta/pure-python [flake8] doctests = 1 diff --git a/src/grokcore/security/tests/test_base.py b/src/grokcore/security/tests/test_base.py index f94aacb..84118f6 100644 --- a/src/grokcore/security/tests/test_base.py +++ b/src/grokcore/security/tests/test_base.py @@ -1,8 +1,7 @@ import doctest +import importlib.resources import unittest -from pkg_resources import resource_listdir - from zope.testing import cleanup @@ -12,7 +11,11 @@ def cleanUpZope(test): def suiteFromPackage(name): layer_dir = 'base' - files = resource_listdir(__name__, f'{layer_dir}/{name}') + package = __package__ + resource_path = f'{layer_dir}/{name}' + files = [] + files = [entry.name for entry in importlib.resources.files( + package).joinpath(resource_path).iterdir() if entry.is_file()] suite = unittest.TestSuite() for filename in files: if not filename.endswith('.py'): diff --git a/src/grokcore/security/tests/test_functional.py b/src/grokcore/security/tests/test_functional.py index 0e05bc6..eb9c0f4 100644 --- a/src/grokcore/security/tests/test_functional.py +++ b/src/grokcore/security/tests/test_functional.py @@ -1,8 +1,7 @@ import doctest +import importlib.resources import unittest -from pkg_resources import resource_listdir - import zope.app.wsgi.testlayer import zope.testbrowser.wsgi from zope.app.wsgi.testlayer import http @@ -21,7 +20,11 @@ class Layer( def suiteFromPackage(name): layer_dir = 'functional' - files = resource_listdir(__name__, f'{layer_dir}/{name}') + package = __package__ + resource_path = f'{layer_dir}/{name}' + files = [] + files = [entry.name for entry in importlib.resources.files( + package).joinpath(resource_path).iterdir() if entry.is_file()] suite = unittest.TestSuite() for filename in files: if not filename.endswith('.py'): diff --git a/tox.ini b/tox.ini index 12edc3e..ad05529 100644 --- a/tox.ini +++ b/tox.ini @@ -1,15 +1,15 @@ -# Generated from: -# https://github.com/zopefoundation/meta/tree/master/config/pure-python +# Generated with zope.meta (https://zopemeta.readthedocs.io/) from: +# https://github.com/zopefoundation/meta/tree/master/src/zope/meta/pure-python [tox] minversion = 3.18 envlist = release-check lint - py39 py310 py311 py312 py313 + py314 pypy3 coverage @@ -18,7 +18,7 @@ usedevelop = true package = wheel wheel_build_env = .pkg deps = - setuptools == 78.1.1 + setuptools >= 78.1.1,< 81 commands = zope-testrunner --test-path=src {posargs:-vc} extras = @@ -34,7 +34,7 @@ description = ensure that the distribution is ready to release basepython = python3 skip_install = true deps = - setuptools == 78.1.1 + setuptools >= 78.1.1,< 81 wheel twine build @@ -44,7 +44,7 @@ deps = commands_pre = commands = check-manifest - check-python-versions --only setup.py,tox.ini,.github/workflows/tests.yml + check-python-versions --only pyproject.toml,setup.py,tox.ini,.github/workflows/tests.yml python -m build --sdist --no-isolation twine check dist/* From ddff90bbb339e217f6f9330c35b663fb069a0171 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Wed, 18 Feb 2026 09:14:06 +0100 Subject: [PATCH 4/7] Update Python version support. --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index b40ce44..258a55a 100644 --- a/setup.py +++ b/setup.py @@ -36,17 +36,17 @@ def read(*rnames): 'License :: OSI Approved :: Zope Public License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.12', 'Programming Language :: Python :: 3.13', + 'Programming Language :: Python :: 3.14', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', ], include_package_data=True, zip_safe=False, - python_requires='>=3.9', + python_requires='>=3.10', install_requires=[ 'Chameleon >= 2', 'grokcore.component >= 2.1', From 51c81b5e3990f146af961933ccc93d27bc0b18bc Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Wed, 18 Feb 2026 09:14:44 +0100 Subject: [PATCH 5/7] Move package metadata from setup.py to pyproject.toml. --- CHANGES.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index 05e614f..6bdffc0 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,6 +4,8 @@ Changes 5.1 (unreleased) ---------------- +- Move package metadata from setup.py to pyproject.toml. + - Add support for Python 3.14. - Drop support for Python 3.9. From 670b679336ec6bd37a1e41f2565fef8ee2d3afe3 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Wed, 18 Feb 2026 09:16:13 +0100 Subject: [PATCH 6/7] Move package metadata from setup.py to pyproject.toml. --- pyproject.toml | 59 +++++++++++++++++++++++++++++++++++++++++--- setup.py | 66 ++------------------------------------------------ 2 files changed, 58 insertions(+), 67 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c8633b2..d05a9b2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,5 @@ # Generated with zope.meta (https://zopemeta.readthedocs.io/) from: # https://github.com/zopefoundation/meta/tree/master/src/zope/meta/pure-python -# Generated from: -# https://github.com/zopefoundation/meta/tree/master/config/pure-python - [build-system] requires = [ "setuptools >= 78.1.1,< 81", @@ -10,6 +7,58 @@ requires = [ ] build-backend = "setuptools.build_meta" + +[project] +name = "grokcore.security" +version = "5.1.dev0" +description = "Grok-like configuration for Zope security components" +license = "ZPL" +classifiers = [ + "Intended Audience :: Developers", + "Development Status :: 6 - Mature", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", +] +dynamic = ["readme"] +requires-python = ">=3.10" +authors = [ + {name = "Grok Team",email = "zope-dev@zope.dev"}, +] +maintainers = [ + {name = "Plone Foundation and contributors",email = "zope-dev@zope.dev"}, +] +dependencies = [ + "Chameleon >= 2", + "grokcore.component >= 2.1", + "martian >= 0.13", + "zope.component", + "zope.dottedname", + "zope.interface", + "zope.security", +] + +[project.optional-dependencies] +role = ["zope.securitypolicy"] +test = [ + "grokcore.view[test]", + "zope.app.wsgi", + "zope.configuration", + "zope.securitypolicy", + "zope.testing", +] + +[project.urls] +Source = "https://github.com/zopefoundation/grokcore.security" +Issues = "https://github.com/zopefoundation/grokcore.security/issues" +Changelog = "https://raw.githubusercontent.com/zopefoundation/grokcore.security/master/CHANGES.rst" + [tool.coverage.run] branch = true source = ["grokcore.security"] @@ -32,3 +81,7 @@ exclude_lines = [ [tool.coverage.html] directory = "parts/htmlcov" + +[tool.setuptools.dynamic] +readme = {file = ["README.rst", "CHANGES.rst"]} + diff --git a/setup.py b/setup.py index 258a55a..1563808 100644 --- a/setup.py +++ b/setup.py @@ -1,67 +1,5 @@ -import os - from setuptools import setup -def read(*rnames): - return open(os.path.join(os.path.dirname(__file__), *rnames)).read() - - -long_description = ( - read('README.rst') - + '\n' + - read('CHANGES.rst') -) - -tests_require = [ - 'grokcore.view[test]', - 'zope.app.wsgi', - 'zope.configuration', - 'zope.securitypolicy', - 'zope.testing', -] - -setup( - name='grokcore.security', - version='5.1.dev0', - author='Grok Team', - author_email='zope-dev@zope.dev', - url='https://github.com/zopefoundation/grokcore.security', - description='Grok-like configuration for Zope security components', - long_description=long_description, - license='ZPL', - classifiers=[ - 'Intended Audience :: Developers', - 'Development Status :: 6 - Mature', - 'License :: OSI Approved :: Zope Public License', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: 3.14', - 'Programming Language :: Python :: Implementation :: CPython', - 'Programming Language :: Python :: Implementation :: PyPy', - ], - include_package_data=True, - zip_safe=False, - python_requires='>=3.10', - install_requires=[ - 'Chameleon >= 2', - 'grokcore.component >= 2.1', - 'martian >= 0.13', - 'setuptools', - 'zope.component', - 'zope.dottedname', - 'zope.interface', - 'zope.security', - ], - tests_require=tests_require, - extras_require={ - 'role': [ - 'zope.securitypolicy', - ], - 'test': tests_require - }, -) +# See pyproject.toml for package metadata +setup() From 90eb43be698d68ae48948efdce4da77ae0f87486 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Wed, 18 Feb 2026 09:16:25 +0100 Subject: [PATCH 7/7] Fix license. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d05a9b2..f87bd7d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ build-backend = "setuptools.build_meta" name = "grokcore.security" version = "5.1.dev0" description = "Grok-like configuration for Zope security components" -license = "ZPL" +license = "ZPL-2.1" classifiers = [ "Intended Audience :: Developers", "Development Status :: 6 - Mature",