From 64f51e6ef894f54aa3a9fa0408b494fbb92126bf Mon Sep 17 00:00:00 2001 From: Gil Forcada Codinachs Date: Fri, 21 Nov 2025 23:32:42 +0100 Subject: [PATCH 1/3] Bumped version for breaking release. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 37179cc..70b214b 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from setuptools import setup -version = "4.0.2.dev0" +version = "5.0.0.dev0" long_description = ( f"{Path('README.rst').read_text()}\n{Path('CHANGES.rst').read_text()}" From bc16f733dffc0ea6f777c0af446f817567894659 Mon Sep 17 00:00:00 2001 From: Gil Forcada Codinachs Date: Fri, 21 Nov 2025 23:32:42 +0100 Subject: [PATCH 2/3] Switch to PEP 420 native namespace. --- news/3928.breaking | 2 ++ setup.py | 11 ++--------- src/plone/__init__.py | 1 - 3 files changed, 4 insertions(+), 10 deletions(-) create mode 100644 news/3928.breaking delete mode 100644 src/plone/__init__.py diff --git a/news/3928.breaking b/news/3928.breaking new file mode 100644 index 0000000..4fb7ad4 --- /dev/null +++ b/news/3928.breaking @@ -0,0 +1,2 @@ +Replace ``pkg_resources`` namespace with PEP 420 native namespace. +Support only Plone 6.2 and Python 3.10+. diff --git a/setup.py b/setup.py index 70b214b..7047024 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,4 @@ from pathlib import Path -from setuptools import find_packages from setuptools import setup @@ -21,7 +20,7 @@ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Plone", - "Framework :: Plone :: 6.0", + "Framework :: Plone :: 6.2", "Framework :: Plone :: Core", "Framework :: Zope2", "Framework :: Zope :: 4", @@ -31,8 +30,6 @@ "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", "Operating System :: OS Independent", "Programming Language :: Python", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", ], @@ -41,15 +38,11 @@ author_email="plone-developers@lists.sourceforge.net", url="https://pypi.org/project/plone.folder", license="GPL version 2", - packages=find_packages("src"), - package_dir={"": "src"}, - namespace_packages=["plone"], include_package_data=True, platforms="Any", zip_safe=False, - python_requires=">=3.8", + python_requires=">=3.10", install_requires=[ - "setuptools", "Products.CMFCore", "Products.ZCatalog", "Zope", diff --git a/src/plone/__init__.py b/src/plone/__init__.py deleted file mode 100644 index 5284146..0000000 --- a/src/plone/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__("pkg_resources").declare_namespace(__name__) From 325a8d2fc13294af40ddae6c48074cb3a8123820 Mon Sep 17 00:00:00 2001 From: Gil Forcada Codinachs Date: Fri, 21 Nov 2025 23:32:51 +0100 Subject: [PATCH 3/3] Configuring with plone.meta --- .github/dependabot.yml | 11 +++ .github/workflows/meta.yml | 20 ++--- .github/workflows/test-matrix.yml | 72 +++++++++++++++++ .meta.toml | 5 +- pyproject.toml | 4 +- tox.ini | 126 +++++++++++++++++------------- 6 files changed, 166 insertions(+), 72 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/test-matrix.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..e5e4522 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +# Generated from: +# https://github.com/plone/meta/tree/main/src/plone/meta/default +# See the inline comments on how to expand/tweak this configuration file +version: 2 +updates: + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + # Check for updates to GitHub Actions every week + interval: "weekly" diff --git a/.github/workflows/meta.yml b/.github/workflows/meta.yml index 667d046..f9a346f 100644 --- a/.github/workflows/meta.yml +++ b/.github/workflows/meta.yml @@ -25,24 +25,21 @@ on: jobs: qa: - uses: plone/meta/.github/workflows/qa.yml@main - test: - uses: plone/meta/.github/workflows/test.yml@main + uses: plone/meta/.github/workflows/qa.yml@2.x coverage: - uses: plone/meta/.github/workflows/coverage.yml@main + uses: plone/meta/.github/workflows/coverage.yml@2.x dependencies: - uses: plone/meta/.github/workflows/dependencies.yml@main + uses: plone/meta/.github/workflows/dependencies.yml@2.x release_ready: - uses: plone/meta/.github/workflows/release_ready.yml@main + uses: plone/meta/.github/workflows/release_ready.yml@2.x circular: - uses: plone/meta/.github/workflows/circular.yml@main + uses: plone/meta/.github/workflows/circular.yml@2.x ## # To modify the list of default jobs being created add in .meta.toml: # [github] # jobs = [ # "qa", -# "test", # "coverage", # "dependencies", # "release_ready", @@ -57,13 +54,6 @@ jobs: # os_dependencies = "git libxml2 libxslt" ## -## -# To test against a specific matrix of python versions -# when running tests jobs, add in .meta.toml: -# [github] -# py_versions = "['3.12', '3.11']" -## - ## # Specify additional jobs in .meta.toml: diff --git a/.github/workflows/test-matrix.yml b/.github/workflows/test-matrix.yml new file mode 100644 index 0000000..8596af2 --- /dev/null +++ b/.github/workflows/test-matrix.yml @@ -0,0 +1,72 @@ +# Generated from: +# https://github.com/plone/meta/tree/main/src/plone/meta/default +# See the inline comments on how to expand/tweak this configuration file +name: Tests + +on: + push: + +jobs: + build: + permissions: + contents: read + pull-requests: write + strategy: + # We want to see all failures: + fail-fast: false + matrix: + os: + - ["ubuntu", "ubuntu-latest"] + config: + # [Python version, visual name, tox env] + - ["3.13", "6.2 on py3.13", "py313-plone62"] + - ["3.10", "6.2 on py3.10", "py310-plone62"] + + 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@v5 + with: + persist-credentials: false + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.config[0] }} + allow-prereleases: true + +## +# Add extra configuration options in .meta.toml: +# [github] +# extra_lines_after_os_dependencies = """ +# _your own configuration lines_ +# """ +## + - name: Pip cache + uses: actions/cache@v4 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ matrix.config[0] }}-${{ hashFiles('setup.*', 'tox.ini') }} + restore-keys: | + ${{ runner.os }}-pip-${{ matrix.config[0] }}- + ${{ runner.os }}-pip- + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install tox + - name: Initialize tox + # the bash one-liner below does not work on Windows + if: contains(matrix.os, 'ubuntu') + run: | + if [ `tox list --no-desc -f init|wc -l` = 1 ]; then tox -e init;else true; fi + - name: Test + run: tox -e ${{ matrix.config[2] }} + + +## +# Add extra configuration options in .meta.toml: +# [github] +# extra_lines = """ +# _your own configuration lines_ +# """ +## diff --git a/.meta.toml b/.meta.toml index a41e421..28d6bbd 100644 --- a/.meta.toml +++ b/.meta.toml @@ -3,7 +3,10 @@ # See the inline comments on how to expand/tweak this configuration file [meta] template = "default" -commit-id = "ab485d6f" +commit-id = "2.2.2" + +[tox] +test_matrix = {"6.2" = ["*"]} [pyproject] dependencies_mappings = [ diff --git a/pyproject.toml b/pyproject.toml index 3cd1a8a..bd4b004 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ # https://github.com/plone/meta/tree/main/src/plone/meta/default # See the inline comments on how to expand/tweak this configuration file [build-system] -requires = ["setuptools>=68.2"] +requires = ["setuptools>=68.2,<80", "wheel"] [tool.towncrier] directory = "news/" @@ -37,7 +37,7 @@ showcontent = true [[tool.towncrier.type]] directory = "tests" -name = "Tests" +name = "Tests:" showcontent = true ## diff --git a/tox.ini b/tox.ini index 4d30bcd..81af7eb 100644 --- a/tox.ini +++ b/tox.ini @@ -7,12 +7,21 @@ min_version = 4.4.0 envlist = lint test + py313-plone62 + py312-plone62 + py311-plone62 + py310-plone62 dependencies ## # Add extra configuration options in .meta.toml: +# - to specify a custom testing combination of Plone and python versions, use `test_matrix` +# Use ["*"] to use all supported Python versions for this Plone version. +# - to specify extra custom environments, use `envlist_lines` +# - to specify extra `tox` top-level options, use `config_lines` # [tox] +# test_matrix = {"6.2" = ["3.13", "3.12"], "6.1" = ["*"]} # envlist_lines = """ # my_other_environment # """ @@ -21,32 +30,14 @@ envlist = # """ ## -[testenv] -skip_install = true -allowlist_externals = - echo - false -# Make sure typos like `tox -e formaat` are caught instead of silently doing nothing. -# See https://github.com/tox-dev/tox/issues/2858. -commands = - echo "Unrecognized environment name {envname}" - false - -## -# Add extra configuration options in .meta.toml: -# [tox] -# testenv_options = """ -# basepython = /usr/bin/python3.8 -# """ -## - [testenv:init] description = Prepare environment skip_install = true +allowlist_externals = + echo commands = echo "Initial setup complete" - [testenv:format] description = automatically reformat code skip_install = true @@ -87,8 +78,19 @@ deps = commands = sh -c 'pipdeptree --exclude setuptools,wheel,pipdeptree,zope.interface,zope.component --graph-output svg > dependencies.svg' -[testenv:test] -description = run the distribution tests + +[test_runner] +deps = zope.testrunner +test = + zope-testrunner --all --test-path={toxinidir}/src -s plone.folder {posargs} +coverage = + coverage run --branch --source plone.folder {envbindir}/zope-testrunner --quiet --all --test-path={toxinidir}/src -s plone.folder {posargs} + coverage report -m --format markdown + coverage xml + coverage html + +[base] +description = shared configuration for tests and coverage use_develop = true skip_install = false constrain_package_deps = true @@ -104,26 +106,27 @@ set_env = # # Set constrain_package_deps .meta.toml: # [tox] -# constrain_package_deps = "false" +# constrain_package_deps = false ## deps = - zope.testrunner - -c https://dist.plone.org/release/6.0-dev/constraints.txt + {[test_runner]deps} + plone62: -c https://dist.plone.org/release/6.2-dev/constraints.txt ## # Specify additional deps in .meta.toml: # [tox] -# test_deps_additional = "-esources/plonegovbr.portal_base[test]" +# test_deps_additional = """ +# -esources/plonegovbr.portal_base[test] +# """ # # Specify a custom constraints file in .meta.toml: # [tox] # constraints_file = "https://my-server.com/constraints.txt" ## -commands = - zope-testrunner --all --test-path={toxinidir}/src -s plone.folder {posargs} extras = test + ## # Add extra configuration options in .meta.toml: # [tox] @@ -131,35 +134,52 @@ extras = # tests # widgets # """ +# +# Add extra configuration options in .meta.toml: +# [tox] +# testenv_options = """ +# basepython = /usr/bin/python3.8 +# """ ## +[testenv:test] +description = run the distribution tests +use_develop = {[base]use_develop} +skip_install = {[base]skip_install} +constrain_package_deps = {[base]constrain_package_deps} +set_env = {[base]set_env} +deps = + {[test_runner]deps} + -c https://dist.plone.org/release/6.2-dev/constraints.txt + +commands = {[test_runner]test} +extras = {[base]extras} + + +[testenv] +description = run the distribution tests (generative environments) +use_develop = {[base]use_develop} +skip_install = {[base]skip_install} +constrain_package_deps = {[base]constrain_package_deps} +set_env = {[base]set_env} +deps = {[base]deps} +commands = {[test_runner]test} +extras = {[base]extras} + + [testenv:coverage] description = get a test coverage report -use_develop = true -skip_install = false -constrain_package_deps = true -set_env = - ROBOT_BROWSER=headlesschrome - -## -# Specify extra test environment variables in .meta.toml: -# [tox] -# test_environment_variables = """ -# PIP_EXTRA_INDEX_URL=https://my-pypi.my-server.com/ -# """ -## +use_develop = {[base]use_develop} +skip_install = {[base]skip_install} +constrain_package_deps = {[base]constrain_package_deps} +set_env = {[base]set_env} deps = + {[test_runner]deps} coverage - zope.testrunner - -c https://dist.plone.org/release/6.0-dev/constraints.txt + -c https://dist.plone.org/release/6.2-dev/constraints.txt -commands = - coverage run --branch --source plone.folder {envbindir}/zope-testrunner --quiet --all --test-path={toxinidir}/src -s plone.folder {posargs} - coverage report -m --format markdown - coverage xml - coverage html -extras = - test +commands = {[test_runner]coverage} +extras = {[base]extras} [testenv:release-check] @@ -169,8 +189,7 @@ deps = twine build towncrier - -c https://dist.plone.org/release/6.0-dev/constraints.txt - + -c https://dist.plone.org/release/6.2-dev/constraints.txt commands = # fake version to not have to install the package # we build the change log as news entries might break @@ -200,8 +219,7 @@ allowlist_externals = deps = pipdeptree pipforester - -c https://dist.plone.org/release/6.0-dev/constraints.txt - + -c https://dist.plone.org/release/6.2-dev/constraints.txt commands = # Generate the full dependency tree sh -c 'pipdeptree -j > forest.json'