From 0e87eaf25021ec14353a5153da227dcc0a2d4c45 Mon Sep 17 00:00:00 2001 From: Mauro Amico Date: Wed, 12 Aug 2026 15:00:43 +0200 Subject: [PATCH 1/3] upgrade meta --- .editorconfig | 10 +- .flake8 | 2 +- .github/dependabot.yml | 13 ++ .github/workflows/meta.yml | 40 ++--- .github/workflows/test-matrix.yml | 71 +++++++++ .gitignore | 12 +- .meta.toml | 11 +- .pre-commit-config.yaml | 33 ++-- news/+meta.internal | 1 + news/.changelog_template.jinja | 8 +- pyproject.toml | 22 +-- scripts/create_site.py | 1 - setup.py | 1 - src/redturtle/pasldap/__init__.py | 1 - src/redturtle/pasldap/metrics.py | 6 +- src/redturtle/pasldap/resilient.py | 1 - src/redturtle/pasldap/subscribers/startup.py | 1 - tests/conftest.py | 1 - tox.ini | 150 ++++++++++++------- 19 files changed, 256 insertions(+), 129 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/test-matrix.yml create mode 100644 news/+meta.internal diff --git a/.editorconfig b/.editorconfig index 8ae05aa..55bfb6d 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,5 +1,5 @@ # Generated from: -# https://github.com/plone/meta/tree/master/config/default +# https://github.com/plone/meta/tree/2.x/src/plone/meta/default # See the inline comments on how to expand/tweak this configuration file # # EditorConfig Configuration file, for more details see: @@ -13,7 +13,8 @@ root = true -[*] # For All Files +[*] +# Default settings for all files. # Unix-style newlines with a newline ending every file end_of_line = lf insert_final_newline = true @@ -29,11 +30,12 @@ max_line_length = off # 4 space indentation indent_size = 4 -[*.{yml,zpt,pt,dtml,zcml}] +[*.{yml,zpt,pt,dtml,zcml,html,xml}] # 2 space indentation indent_size = 2 -[*.{json,jsonl,js,jsx,ts,tsx,css,less,scss,html}] # Frontend development +[*.{json,jsonl,js,jsx,ts,tsx,css,less,scss}] +# Frontend development # 2 space indentation indent_size = 2 max_line_length = 80 diff --git a/.flake8 b/.flake8 index 7ef4f64..ff17672 100644 --- a/.flake8 +++ b/.flake8 @@ -1,5 +1,5 @@ # Generated from: -# https://github.com/plone/meta/tree/master/config/default +# https://github.com/plone/meta/tree/2.x/src/plone/meta/default # See the inline comments on how to expand/tweak this configuration file [flake8] doctests = 1 diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..676b588 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,13 @@ +# Generated from: +# https://github.com/plone/meta/tree/2.x/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" + cooldown: + default-days: 7 diff --git a/.github/workflows/meta.yml b/.github/workflows/meta.yml index 83870ef..7393be7 100644 --- a/.github/workflows/meta.yml +++ b/.github/workflows/meta.yml @@ -1,19 +1,11 @@ # Generated from: -# https://github.com/plone/meta/tree/main/config/default +# https://github.com/plone/meta/tree/2.x/src/plone/meta/default # See the inline comments on how to expand/tweak this configuration file name: Meta -permissions: - contents: read - pull-requests: write +permissions: {} + on: push: - branches: - - master - - main - pull_request: - branches: - - master - - main workflow_dispatch: ## @@ -28,24 +20,21 @@ on: jobs: qa: - uses: plone/meta/.github/workflows/qa.yml@main -# test: -# uses: plone/meta/.github/workflows/test.yml@main -# with: -# py-versions: '["3.12", "3.11", "3.10"]' -# coverage: -# uses: plone/meta/.github/workflows/coverage.yml@main -# dependencies: -# uses: plone/meta/.github/workflows/dependencies.yml@main + uses: plone/meta/.github/workflows/qa.yml@2.x + coverage: + uses: plone/meta/.github/workflows/coverage.yml@2.x + dependencies: + 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@2.x ## # To modify the list of default jobs being created add in .meta.toml: # [github] # jobs = [ # "qa", -# "test", # "coverage", # "dependencies", # "release_ready", @@ -60,13 +49,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..d38c6f8 --- /dev/null +++ b/.github/workflows/test-matrix.yml @@ -0,0 +1,71 @@ +# Generated from: +# https://github.com/plone/meta/tree/2.x/src/plone/meta/default +# See the inline comments on how to expand/tweak this configuration file +name: Tests + +on: + push: + workflow_dispatch: + +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.14", "6.3 on py3.14", "py314-plone63"] + - ["3.10", "6.3 on py3.10", "py310-plone63"] + - ["3.14", "6.2 on py3.14", "py314-plone62"] + - ["3.10", "6.2 on py3.10", "py310-plone62"] + - ["3.13", "6.1 on py3.13", "py313-plone61"] + - ["3.10", "6.1 on py3.10", "py310-plone61"] + - ["3.9", "6.0 on py3.9", "py39-plone60"] + - ["3.13", "6.0 on py3.13", "py313-plone60"] + + 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@v7 + with: + persist-credentials: false + - name: Install uv + caching + uses: astral-sh/setup-uv@v9.0.0 + with: + enable-cache: true + cache-dependency-glob: | + setup.* + tox.ini + pyproject.toml + python-version: ${{ matrix.config[0] }} + +## +# Add extra configuration options in .meta.toml: +# [github] +# extra_lines_after_os_dependencies = """ +# _your own configuration lines_ +# """ +## + - name: Initialize tox + # the bash one-liner below does not work on Windows + if: contains(matrix.os, 'ubuntu') + run: | + if [ `uvx tox list --no-desc -f init|wc -l` = 1 ]; then uvx --with tox-uv tox -e init;else true; fi + - name: Test + run: uvx --with tox-uv tox -e ${{ matrix.config[2] }} + + +## +# Add extra configuration options in .meta.toml: +# [github] +# extra_lines = """ +# _your own configuration lines_ +# """ +## diff --git a/.gitignore b/.gitignore index 6a1e51f..5b8ff61 100644 --- a/.gitignore +++ b/.gitignore @@ -1,14 +1,18 @@ # Generated from: -# https://github.com/plone/meta/tree/master/config/default +# https://github.com/plone/meta/tree/2.x/src/plone/meta/default # See the inline comments on how to expand/tweak this configuration file # python related *.egg-info *.pyc *.pyo +# translation related +*.mo + # tools related build/ .coverage +.*project coverage.xml dist/ docs/_build @@ -16,6 +20,8 @@ __pycache__/ .tox .vscode/ node_modules/ +forest.dot +forest.json # venv / buildout related bin/ @@ -31,6 +37,7 @@ lib64 parts/ pyvenv.cfg var/ +local.cfg # mxdev /instance/ @@ -40,7 +47,10 @@ var/ /sources/ /venv/ .installed.txt + .lock +.python-version +.venv/ ## # Add extra configuration options in .meta.toml: diff --git a/.meta.toml b/.meta.toml index 6558f60..a701538 100644 --- a/.meta.toml +++ b/.meta.toml @@ -1,21 +1,20 @@ # Generated from: -# https://github.com/plone/meta/tree/main/config/default +# https://github.com/plone/meta/tree/2.x/src/plone/meta/default # See the inline comments on how to expand/tweak this configuration file [meta] template = "default" -commit-id = "71d0218b" +commit-id = "2.11.0" [pyproject] codespell_skip = "*.min.js,*.ldif" codespell_ignores = "vew" -dependencies_mappings = [ - "pytest-plone = ['pytest', 'plone.testing', 'plone.app.testing']", -] dependencies_ignores = "['plone.app.iterate', 'plone.app.upgrade', 'plone.volto', 'zestreleaser.towncrier', 'zest.releaser', 'pytest-cov']" [gitignore] extra_lines = """ .lock +.python-version +.venv/ """ [tox] @@ -28,8 +27,8 @@ test_deps_additional = "" py_versions = "[\"3.12\", \"3.11\", \"3.10\"]" jobs = [ "qa", - "test", "coverage", "dependencies", "release_ready", + "circular", ] diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b6eb043..f57851c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,5 @@ # Generated from: -# https://github.com/plone/meta/tree/master/config/default +# https://github.com/plone/meta/tree/2.x/src/plone/meta/default # See the inline comments on how to expand/tweak this configuration file ci: autofix_prs: false @@ -7,20 +7,20 @@ ci: repos: - repo: https://github.com/asottile/pyupgrade - rev: v3.14.0 + rev: v3.21.2 hooks: - id: pyupgrade - args: [--py38-plus] + args: [--py39-plus] - repo: https://github.com/pycqa/isort - rev: 5.12.0 + rev: 9.0.0b1 hooks: - id: isort -- repo: https://github.com/psf/black - rev: 23.9.1 +- repo: https://github.com/psf/black-pre-commit-mirror + rev: 26.5.1 hooks: - id: black - repo: https://github.com/collective/zpretty - rev: 3.1.0 + rev: 4.0.3 hooks: - id: zpretty @@ -32,7 +32,7 @@ repos: # """ ## - repo: https://github.com/PyCQA/flake8 - rev: 6.1.0 + rev: 7.3.0 hooks: - id: flake8 @@ -44,7 +44,7 @@ repos: # """ ## - repo: https://github.com/codespell-project/codespell - rev: v2.2.6 + rev: v2.4.3 hooks: - id: codespell additional_dependencies: @@ -58,20 +58,25 @@ repos: # """ ## - repo: https://github.com/mgedmin/check-manifest - rev: "0.49" + rev: "0.51" hooks: - id: check-manifest - repo: https://github.com/regebro/pyroma - rev: "4.2" + rev: "5.1b1" hooks: - id: pyroma - repo: https://github.com/mgedmin/check-python-versions - rev: "0.21.3" + rev: "0.24.2" hooks: - id: check-python-versions - args: ['--only', 'setup.py,pyproject.toml'] + # Only check setup.py against itself: tox.ini intentionally drops py3.8 + # (Plone 6.0 itself no longer supports it), but we still declare and + # support py3.8 for consumers not using the tox-driven Plone 6.0 matrix. + # NOTE: this is a manual override of what `plone.meta`'s config-package + # generates (which would use `setup.py,tox.ini`); re-apply after re-running it. + args: ['--only', 'setup.py'] - repo: https://github.com/collective/i18ndude - rev: "6.1.0" + rev: "6.3.0" hooks: - id: i18ndude diff --git a/news/+meta.internal b/news/+meta.internal new file mode 100644 index 0000000..1336cd3 --- /dev/null +++ b/news/+meta.internal @@ -0,0 +1 @@ +Update configuration files @plone diff --git a/news/.changelog_template.jinja b/news/.changelog_template.jinja index 678bfa1..b35bff3 100644 --- a/news/.changelog_template.jinja +++ b/news/.changelog_template.jinja @@ -1,9 +1,9 @@ -{% if sections[] %} -{% for category, val in definitions.items() if category in sections[] %} +{% if sections[""] %} +{% for category, val in definitions.items() if category in sections[""] %} ### {{ definitions[category]['name'] }} -{% for text, values in sections[][category].items() %} +{% for text, values in sections[""][category].items() %} - {{ text }} {{ values|join(', ') }} {% endfor %} @@ -12,4 +12,4 @@ No significant changes. -{% endif %} +{% endif %} \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index e8af3b7..4bce822 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,10 @@ # Generated from: -# https://github.com/plone/meta/tree/main/config/default +# https://github.com/plone/meta/tree/2.x/src/plone/meta/default # See the inline comments on how to expand/tweak this configuration file [build-system] -requires = ["setuptools>=75.1"] +requires = ["setuptools>=68.2,<82", "wheel"] + + [tool.towncrier] directory = "news/" @@ -14,27 +16,27 @@ underlines = ["", "", ""] [[tool.towncrier.type]] directory = "breaking" -name = "Breaking changes:" +name = "Breaking changes" showcontent = true [[tool.towncrier.type]] directory = "feature" -name = "New features:" +name = "New features" showcontent = true [[tool.towncrier.type]] directory = "bugfix" -name = "Bug fixes:" +name = "Bug fixes" showcontent = true [[tool.towncrier.type]] directory = "internal" -name = "Internal:" +name = "Internal" showcontent = true [[tool.towncrier.type]] directory = "documentation" -name = "Documentation:" +name = "Documentation" showcontent = true [[tool.towncrier.type]] @@ -62,7 +64,7 @@ profile = "plone" ## [tool.black] -target-version = ["py38"] +target-version = ["py39"] ## # Add extra configuration options in .meta.toml: @@ -73,7 +75,7 @@ target-version = ["py38"] ## [tool.codespell] -ignore-words-list = "discreet,vew" +ignore-words-list = "discreet,assertin,thet,vew" skip = "*.po,*.min.js,*.ldif" ## # Add extra configuration options in .meta.toml: @@ -121,7 +123,7 @@ Zope = [ 'Products.CMFCore', 'Products.CMFDynamicViewFTI', ] python-dateutil = ['dateutil'] -pytest-plone = ['pytest', 'plone.testing', 'plone.app.testing'] +pytest-plone = ['pytest', 'zope.pytestlayer', 'plone.testing', 'plone.app.testing'] ignore-packages = ['plone.app.iterate', 'plone.app.upgrade', 'plone.volto', 'zestreleaser.towncrier', 'zest.releaser', 'pytest-cov'] ## diff --git a/scripts/create_site.py b/scripts/create_site.py index a5fac7a..5d5bb61 100644 --- a/scripts/create_site.py +++ b/scripts/create_site.py @@ -10,7 +10,6 @@ import os import transaction - truthy = frozenset(("t", "true", "y", "yes", "on", "1")) diff --git a/setup.py b/setup.py index 6b1f758..d7c6a64 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,6 @@ from setuptools import find_packages from setuptools import setup - long_description = f""" {Path("README.md").read_text()}\n {Path("CONTRIBUTORS.md").read_text()}\n diff --git a/src/redturtle/pasldap/__init__.py b/src/redturtle/pasldap/__init__.py index c236236..b187b7d 100644 --- a/src/redturtle/pasldap/__init__.py +++ b/src/redturtle/pasldap/__init__.py @@ -7,7 +7,6 @@ import logging import os - PACKAGE_NAME = "redturtle.pasldap" _ = MessageFactory(PACKAGE_NAME) diff --git a/src/redturtle/pasldap/metrics.py b/src/redturtle/pasldap/metrics.py index cfcc2f9..3f94372 100644 --- a/src/redturtle/pasldap/metrics.py +++ b/src/redturtle/pasldap/metrics.py @@ -9,11 +9,11 @@ def emoji_by_elapsed(elapsed): if elapsed < 20: - return "\U0001F60E" # GOOD + return "\U0001f60e" # GOOD elif elapsed < 100: - return "\U0001F914" # MUMBLE + return "\U0001f914" # MUMBLE else: - return "\U0001F4A9" # SHIT + return "\U0001f4a9" # SHIT def sanitize_kwargs(kwargs): diff --git a/src/redturtle/pasldap/resilient.py b/src/redturtle/pasldap/resilient.py index 49a6410..7394dad 100644 --- a/src/redturtle/pasldap/resilient.py +++ b/src/redturtle/pasldap/resilient.py @@ -5,7 +5,6 @@ from redturtle.pasldap import ldap_readonly from redturtle.pasldap import logger - # potential users in the Zope acl_users RESERVED_IDS = [ "root", diff --git a/src/redturtle/pasldap/subscribers/startup.py b/src/redturtle/pasldap/subscribers/startup.py index 1dd1cbb..98eef3e 100644 --- a/src/redturtle/pasldap/subscribers/startup.py +++ b/src/redturtle/pasldap/subscribers/startup.py @@ -7,7 +7,6 @@ import logging - logger = logging.getLogger(__name__) diff --git a/tests/conftest.py b/tests/conftest.py index 4923a7b..7c55894 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -3,7 +3,6 @@ from redturtle.pasldap.testing import FUNCTIONAL_TESTING from redturtle.pasldap.testing import INTEGRATION_TESTING - pytest_plugins = ["pytest_plone"] diff --git a/tox.ini b/tox.ini index 05f8004..f50a410 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ # Generated from: -# https://github.com/plone/meta/tree/master/config/default +# https://github.com/plone/meta/tree/2.x/src/plone/meta/default # See the inline comments on how to expand/tweak this configuration file [tox] # We need 4.4.0 for constrain_package_deps. @@ -7,12 +7,37 @@ min_version = 4.4.0 envlist = lint test + py314-plone63 + py313-plone63 + py312-plone63 + py311-plone63 + py310-plone63 + py314-plone62 + py313-plone62 + py312-plone62 + py311-plone62 + py310-plone62 + py313-plone61 + py312-plone61 + py311-plone61 + py310-plone61 + py313-plone60 + py312-plone60 + py311-plone60 + py310-plone60 + py39-plone60 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 disable the test matrix entirely, set `use_test_matrix = false` +# - 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,27 +46,17 @@ 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 - [testenv:init] description = Prepare environment skip_install = true +allowlist_externals = + echo deps = mxdev commands = mxdev -c mx.ini echo "Initial setup for mxdev" - [testenv:format] description = automatically reformat code skip_install = true @@ -59,17 +74,16 @@ skip_install = true deps = pre-commit commands = - # Run pre-commit without chdir to the root of the git repository - python -c "from pre_commit import main; main._adjust_args_and_chdir = lambda args: None; raise SystemExit(main.main())" run -a + pre-commit run -a [testenv:dependencies] description = check if the package defines all its dependencies skip_install = true deps = build - z3c.dependencychecker==2.11 + z3c.dependencychecker==3.0 commands = - python -m build --sdist --no-isolation + python -m build --wheel dependencychecker [testenv:dependencies-graph] @@ -83,8 +97,21 @@ 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 = + pytest + pytest-plone +test = + pytest --disable-warnings {posargs} {toxinidir}/tests +coverage = + coverage run --source redturtle.pasldap -m pytest {posargs} --disable-warnings {toxinidir}/tests + 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 @@ -103,9 +130,8 @@ set_env = # constrain_package_deps = false ## deps = - pytest-plone - pytest - -c https://dist.plone.org/release/6.1-dev/constraints.txt + {[test_runner]deps} + -c constraints-mxdev.txt ## # Specify additional deps in .meta.toml: @@ -118,43 +144,64 @@ deps = # [tox] # constraints_file = "https://my-server.com/constraints.txt" ## -commands = - pytest --disable-warnings {posargs} {toxinidir}/tests extras = test -[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: +# Add extra configuration options in .meta.toml: # [tox] -# test_environment_variables = """ -# PIP_EXTRA_INDEX_URL=https://my-pypi.my-server.com/ +# skip_test_extra = true +# test_extras = """ +# tests +# widgets # """ # -# Set constrain_package_deps .meta.toml: +# Add extra configuration options in .meta.toml: # [tox] -# constrain_package_deps = "false" +# 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 = - pytest-plone - pytest + {[test_runner]deps} + -c constraints-mxdev.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 = {[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 - -c https://dist.plone.org/release/6.1-dev/constraints.txt + -c constraints-mxdev.txt -commands = - coverage run --source redturtle.pasldap -m pytest {posargs} --disable-warnings {toxinidir}/tests - coverage report -m --format markdown - coverage xml -extras = - test +commands = {[test_runner]coverage} +extras = {[base]extras} [testenv:release-check] @@ -164,20 +211,22 @@ deps = twine build towncrier - -c https://dist.plone.org/release/6.1-dev/constraints.txt - + -c constraints-mxdev.txt commands = # fake version to not have to install the package # we build the change log as news entries might break # the README that is displayed on PyPI towncrier build --version=100.0.0 --yes - python -m build --sdist --no-isolation + python -m build --sdist twine check dist/* [testenv:circular] description = ensure there are no cyclic dependencies use_develop = true skip_install = false +# Here we must always constrain the package deps to what is already installed, +# otherwise we simply get the latest from PyPI, which may not work. +constrain_package_deps = true set_env = ## @@ -192,8 +241,7 @@ allowlist_externals = deps = pipdeptree pipforester - -c https://dist.plone.org/release/6.1-dev/constraints.txt - + -c constraints-mxdev.txt commands = # Generate the full dependency tree sh -c 'pipdeptree -j > forest.json' From 7a2caf3a8f2b9ff388ddf7012a7a1878daf8c6a9 Mon Sep 17 00:00:00 2001 From: Mauro Amico Date: Wed, 12 Aug 2026 17:19:28 +0200 Subject: [PATCH 2/3] fix CI: install libldap OS deps, drop cosmetic Plone test matrix, fix declared dependencies - os_dependencies (libldap2-dev libsasl2-dev) so python-ldap can build on CI - use_test_matrix=false: with use_mxdev=true the per-Plone-version matrix was cosmetic (every env resolved the same constraints-mxdev.txt), so it never actually tested different Plone versions; revert to the historical single test/coverage env against Plone 6.1-dev - drop the circular job: plone/meta's circular.yml has no os_dependencies hook, so it can never install python-ldap's build deps - declare all directly-imported dependencies in setup.py and drop unused ones (collective.regenv, yafowil.plone, yafowil.bootstrap, plone.restapi) --- .github/workflows/meta.yml | 4 +- .github/workflows/test-matrix.yml | 71 ------------------------------- .meta.toml | 5 ++- .pre-commit-config.yaml | 5 --- news/+dependencies.bugfix | 1 + pyproject.toml | 2 +- setup.py | 16 +++++-- tox.ini | 22 ++-------- 8 files changed, 22 insertions(+), 104 deletions(-) delete mode 100644 .github/workflows/test-matrix.yml create mode 100644 news/+dependencies.bugfix diff --git a/.github/workflows/meta.yml b/.github/workflows/meta.yml index 7393be7..542be81 100644 --- a/.github/workflows/meta.yml +++ b/.github/workflows/meta.yml @@ -23,12 +23,12 @@ jobs: uses: plone/meta/.github/workflows/qa.yml@2.x coverage: uses: plone/meta/.github/workflows/coverage.yml@2.x + with: + os-packages: 'libldap2-dev libsasl2-dev' dependencies: uses: plone/meta/.github/workflows/dependencies.yml@2.x release_ready: uses: plone/meta/.github/workflows/release_ready.yml@2.x - circular: - uses: plone/meta/.github/workflows/circular.yml@2.x ## # To modify the list of default jobs being created add in .meta.toml: diff --git a/.github/workflows/test-matrix.yml b/.github/workflows/test-matrix.yml deleted file mode 100644 index d38c6f8..0000000 --- a/.github/workflows/test-matrix.yml +++ /dev/null @@ -1,71 +0,0 @@ -# Generated from: -# https://github.com/plone/meta/tree/2.x/src/plone/meta/default -# See the inline comments on how to expand/tweak this configuration file -name: Tests - -on: - push: - workflow_dispatch: - -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.14", "6.3 on py3.14", "py314-plone63"] - - ["3.10", "6.3 on py3.10", "py310-plone63"] - - ["3.14", "6.2 on py3.14", "py314-plone62"] - - ["3.10", "6.2 on py3.10", "py310-plone62"] - - ["3.13", "6.1 on py3.13", "py313-plone61"] - - ["3.10", "6.1 on py3.10", "py310-plone61"] - - ["3.9", "6.0 on py3.9", "py39-plone60"] - - ["3.13", "6.0 on py3.13", "py313-plone60"] - - 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@v7 - with: - persist-credentials: false - - name: Install uv + caching - uses: astral-sh/setup-uv@v9.0.0 - with: - enable-cache: true - cache-dependency-glob: | - setup.* - tox.ini - pyproject.toml - python-version: ${{ matrix.config[0] }} - -## -# Add extra configuration options in .meta.toml: -# [github] -# extra_lines_after_os_dependencies = """ -# _your own configuration lines_ -# """ -## - - name: Initialize tox - # the bash one-liner below does not work on Windows - if: contains(matrix.os, 'ubuntu') - run: | - if [ `uvx tox list --no-desc -f init|wc -l` = 1 ]; then uvx --with tox-uv tox -e init;else true; fi - - name: Test - run: uvx --with tox-uv 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 a701538..b71a3ea 100644 --- a/.meta.toml +++ b/.meta.toml @@ -8,7 +8,7 @@ commit-id = "2.11.0" [pyproject] codespell_skip = "*.min.js,*.ldif" codespell_ignores = "vew" -dependencies_ignores = "['plone.app.iterate', 'plone.app.upgrade', 'plone.volto', 'zestreleaser.towncrier', 'zest.releaser', 'pytest-cov']" +dependencies_ignores = "['plone.app.iterate', 'plone.app.upgrade', 'plone.volto', 'zestreleaser.towncrier', 'zest.releaser', 'zest.pocompile', 'pytest-cov', 'setuptools']" [gitignore] extra_lines = """ @@ -21,14 +21,15 @@ extra_lines = """ test_runner = "pytest" test_path = "/tests" use_mxdev = true +use_test_matrix = false test_deps_additional = "" [github] +os_dependencies = "libldap2-dev libsasl2-dev" py_versions = "[\"3.12\", \"3.11\", \"3.10\"]" jobs = [ "qa", "coverage", "dependencies", "release_ready", - "circular", ] diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f57851c..27bcf0c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -69,11 +69,6 @@ repos: rev: "0.24.2" hooks: - id: check-python-versions - # Only check setup.py against itself: tox.ini intentionally drops py3.8 - # (Plone 6.0 itself no longer supports it), but we still declare and - # support py3.8 for consumers not using the tox-driven Plone 6.0 matrix. - # NOTE: this is a manual override of what `plone.meta`'s config-package - # generates (which would use `setup.py,tox.ini`); re-apply after re-running it. args: ['--only', 'setup.py'] - repo: https://github.com/collective/i18ndude rev: "6.3.0" diff --git a/news/+dependencies.bugfix b/news/+dependencies.bugfix new file mode 100644 index 0000000..bea7e4f --- /dev/null +++ b/news/+dependencies.bugfix @@ -0,0 +1 @@ +Declare all directly imported dependencies explicitly and drop unused ones (``collective.regenv``, ``yafowil.plone``, ``yafowil.bootstrap``, ``plone.restapi``) @mamico diff --git a/pyproject.toml b/pyproject.toml index 4bce822..a633c1e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -124,7 +124,7 @@ Zope = [ ] python-dateutil = ['dateutil'] pytest-plone = ['pytest', 'zope.pytestlayer', 'plone.testing', 'plone.app.testing'] -ignore-packages = ['plone.app.iterate', 'plone.app.upgrade', 'plone.volto', 'zestreleaser.towncrier', 'zest.releaser', 'pytest-cov'] +ignore-packages = ['plone.app.iterate', 'plone.app.upgrade', 'plone.volto', 'zestreleaser.towncrier', 'zest.releaser', 'zest.pocompile', 'pytest-cov', 'setuptools'] ## # Add extra configuration options in .meta.toml: diff --git a/setup.py b/setup.py index d7c6a64..d03ced1 100644 --- a/setup.py +++ b/setup.py @@ -50,19 +50,27 @@ python_requires=">=3.8", install_requires=[ "setuptools", + "Products.CMFCore", "Products.CMFPlone", + "Products.PlonePAS", + "Products.PluggableAuthService", + "persistent", "plone.api", - "collective.regenv", + "plone.protect", + "zope.globalrequest", + "zope.i18nmessageid", + "zope.interface", + "zope.processlifetime", + "zope.publisher", "pas.plugins.ldap>=1.8.0", - "yafowil.plone>=5.0.0a1", - "yafowil.bootstrap>=2.0.0a1", ], extras_require={ "test": [ "zest.releaser[recommended]", "zestreleaser.towncrier", + "plone.app.contenttypes", + "plone.app.robotframework", "plone.app.testing", - "plone.restapi[test]", "pytest", "pytest-cov", "pytest-plone>=0.5.0", diff --git a/tox.ini b/tox.ini index f50a410..afd1f7f 100644 --- a/tox.ini +++ b/tox.ini @@ -7,25 +7,7 @@ min_version = 4.4.0 envlist = lint test - py314-plone63 - py313-plone63 - py312-plone63 - py311-plone63 - py310-plone63 - py314-plone62 - py313-plone62 - py312-plone62 - py311-plone62 - py310-plone62 - py313-plone61 - py312-plone61 - py311-plone61 - py310-plone61 - py313-plone60 - py312-plone60 - py311-plone60 - py310-plone60 - py39-plone60 + dependencies @@ -103,8 +85,10 @@ deps = pytest pytest-plone test = + rfbrowser init pytest --disable-warnings {posargs} {toxinidir}/tests coverage = + rfbrowser init coverage run --source redturtle.pasldap -m pytest {posargs} --disable-warnings {toxinidir}/tests coverage report -m --format markdown coverage xml From de97a1f739c8b3e5e05291dcc13e091fb7a59118 Mon Sep 17 00:00:00 2001 From: Mauro Amico Date: Wed, 12 Aug 2026 17:58:45 +0200 Subject: [PATCH 3/3] remove unused install/uninstall profile and its tests profiles.zcml was never included from configure.zcml, so "redturtle.pasldap:default" was never a registered GenericSetup profile: the addon isn't installable through it and never was. Drop the dead profile scaffolding (profiles.zcml, profiles/, setuphandlers/, upgrades/) and the installation tests that assumed it worked, which were the only tests in the repository and the reason tests failed once CI actually started running them. With no tests left, treat pytest's "no tests collected" exit code as success so coverage/test CI jobs don't fail for that reason. --- .meta.toml | 2 +- news/+remove-profiles.breaking | 1 + pyproject.toml | 2 +- setup.py | 1 - src/redturtle/pasldap/configure.zcml | 1 - src/redturtle/pasldap/profiles.zcml | 32 ------------------- .../pasldap/profiles/default/browserlayer.xml | 6 ---- .../pasldap/profiles/default/catalog.xml | 13 -------- .../pasldap/profiles/default/controlpanel.xml | 6 ---- .../pasldap/profiles/default/diff_tool.xml | 6 ---- .../pasldap/profiles/default/metadata.xml | 6 ---- .../profiles/default/registry/main.xml | 8 ----- .../profiles/default/repositorytool.xml | 6 ---- .../pasldap/profiles/default/rolemap.xml | 6 ---- .../pasldap/profiles/default/theme.xml | 5 --- .../pasldap/profiles/default/types.xml | 10 ------ .../pasldap/profiles/default/types/.gitkeep | 0 .../profiles/uninstall/browserlayer.xml | 6 ---- .../pasldap/setuphandlers/__init__.py | 11 ------- src/redturtle/pasldap/testing.py | 4 --- src/redturtle/pasldap/upgrades/__init__.py | 0 src/redturtle/pasldap/upgrades/configure.zcml | 21 ------------ tests/conftest.py | 8 +++++ tests/setup/test_setup_install.py | 17 ---------- tests/setup/test_setup_uninstall.py | 19 ----------- 25 files changed, 11 insertions(+), 186 deletions(-) create mode 100644 news/+remove-profiles.breaking delete mode 100644 src/redturtle/pasldap/profiles.zcml delete mode 100644 src/redturtle/pasldap/profiles/default/browserlayer.xml delete mode 100644 src/redturtle/pasldap/profiles/default/catalog.xml delete mode 100644 src/redturtle/pasldap/profiles/default/controlpanel.xml delete mode 100644 src/redturtle/pasldap/profiles/default/diff_tool.xml delete mode 100644 src/redturtle/pasldap/profiles/default/metadata.xml delete mode 100644 src/redturtle/pasldap/profiles/default/registry/main.xml delete mode 100644 src/redturtle/pasldap/profiles/default/repositorytool.xml delete mode 100644 src/redturtle/pasldap/profiles/default/rolemap.xml delete mode 100644 src/redturtle/pasldap/profiles/default/theme.xml delete mode 100644 src/redturtle/pasldap/profiles/default/types.xml delete mode 100644 src/redturtle/pasldap/profiles/default/types/.gitkeep delete mode 100644 src/redturtle/pasldap/profiles/uninstall/browserlayer.xml delete mode 100644 src/redturtle/pasldap/setuphandlers/__init__.py delete mode 100644 src/redturtle/pasldap/upgrades/__init__.py delete mode 100644 src/redturtle/pasldap/upgrades/configure.zcml delete mode 100644 tests/setup/test_setup_install.py delete mode 100644 tests/setup/test_setup_uninstall.py diff --git a/.meta.toml b/.meta.toml index b71a3ea..72f1914 100644 --- a/.meta.toml +++ b/.meta.toml @@ -8,7 +8,7 @@ commit-id = "2.11.0" [pyproject] codespell_skip = "*.min.js,*.ldif" codespell_ignores = "vew" -dependencies_ignores = "['plone.app.iterate', 'plone.app.upgrade', 'plone.volto', 'zestreleaser.towncrier', 'zest.releaser', 'zest.pocompile', 'pytest-cov', 'setuptools']" +dependencies_ignores = "['plone.app.iterate', 'plone.app.upgrade', 'plone.volto', 'zestreleaser.towncrier', 'zest.releaser', 'zest.pocompile', 'pytest', 'pytest-cov', 'setuptools']" [gitignore] extra_lines = """ diff --git a/news/+remove-profiles.breaking b/news/+remove-profiles.breaking new file mode 100644 index 0000000..f8ed8da --- /dev/null +++ b/news/+remove-profiles.breaking @@ -0,0 +1 @@ +Remove the unused GenericSetup install/uninstall profile scaffolding (it was never wired into ``configure.zcml``, so the addon was never actually installable through it) and the corresponding installation tests @mamico diff --git a/pyproject.toml b/pyproject.toml index a633c1e..7155b7f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -124,7 +124,7 @@ Zope = [ ] python-dateutil = ['dateutil'] pytest-plone = ['pytest', 'zope.pytestlayer', 'plone.testing', 'plone.app.testing'] -ignore-packages = ['plone.app.iterate', 'plone.app.upgrade', 'plone.volto', 'zestreleaser.towncrier', 'zest.releaser', 'zest.pocompile', 'pytest-cov', 'setuptools'] +ignore-packages = ['plone.app.iterate', 'plone.app.upgrade', 'plone.volto', 'zestreleaser.towncrier', 'zest.releaser', 'zest.pocompile', 'pytest', 'pytest-cov', 'setuptools'] ## # Add extra configuration options in .meta.toml: diff --git a/setup.py b/setup.py index d03ced1..bc5fff8 100644 --- a/setup.py +++ b/setup.py @@ -59,7 +59,6 @@ "plone.protect", "zope.globalrequest", "zope.i18nmessageid", - "zope.interface", "zope.processlifetime", "zope.publisher", "pas.plugins.ldap>=1.8.0", diff --git a/src/redturtle/pasldap/configure.zcml b/src/redturtle/pasldap/configure.zcml index 24e217c..ac9efc3 100644 --- a/src/redturtle/pasldap/configure.zcml +++ b/src/redturtle/pasldap/configure.zcml @@ -11,7 +11,6 @@ - diff --git a/src/redturtle/pasldap/profiles.zcml b/src/redturtle/pasldap/profiles.zcml deleted file mode 100644 index 21faf0e..0000000 --- a/src/redturtle/pasldap/profiles.zcml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - diff --git a/src/redturtle/pasldap/profiles/default/browserlayer.xml b/src/redturtle/pasldap/profiles/default/browserlayer.xml deleted file mode 100644 index 1c168cf..0000000 --- a/src/redturtle/pasldap/profiles/default/browserlayer.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - diff --git a/src/redturtle/pasldap/profiles/default/catalog.xml b/src/redturtle/pasldap/profiles/default/catalog.xml deleted file mode 100644 index 9558132..0000000 --- a/src/redturtle/pasldap/profiles/default/catalog.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - diff --git a/src/redturtle/pasldap/profiles/default/controlpanel.xml b/src/redturtle/pasldap/profiles/default/controlpanel.xml deleted file mode 100644 index 75eae58..0000000 --- a/src/redturtle/pasldap/profiles/default/controlpanel.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/src/redturtle/pasldap/profiles/default/diff_tool.xml b/src/redturtle/pasldap/profiles/default/diff_tool.xml deleted file mode 100644 index 6a1c5f4..0000000 --- a/src/redturtle/pasldap/profiles/default/diff_tool.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/src/redturtle/pasldap/profiles/default/metadata.xml b/src/redturtle/pasldap/profiles/default/metadata.xml deleted file mode 100644 index c8c3aca..0000000 --- a/src/redturtle/pasldap/profiles/default/metadata.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - 1000 - - - diff --git a/src/redturtle/pasldap/profiles/default/registry/main.xml b/src/redturtle/pasldap/profiles/default/registry/main.xml deleted file mode 100644 index bc69b04..0000000 --- a/src/redturtle/pasldap/profiles/default/registry/main.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - diff --git a/src/redturtle/pasldap/profiles/default/repositorytool.xml b/src/redturtle/pasldap/profiles/default/repositorytool.xml deleted file mode 100644 index 4f674d6..0000000 --- a/src/redturtle/pasldap/profiles/default/repositorytool.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/src/redturtle/pasldap/profiles/default/rolemap.xml b/src/redturtle/pasldap/profiles/default/rolemap.xml deleted file mode 100644 index a803517..0000000 --- a/src/redturtle/pasldap/profiles/default/rolemap.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/src/redturtle/pasldap/profiles/default/theme.xml b/src/redturtle/pasldap/profiles/default/theme.xml deleted file mode 100644 index 7f916aa..0000000 --- a/src/redturtle/pasldap/profiles/default/theme.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - barceloneta - true - diff --git a/src/redturtle/pasldap/profiles/default/types.xml b/src/redturtle/pasldap/profiles/default/types.xml deleted file mode 100644 index bed2b0d..0000000 --- a/src/redturtle/pasldap/profiles/default/types.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - diff --git a/src/redturtle/pasldap/profiles/default/types/.gitkeep b/src/redturtle/pasldap/profiles/default/types/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/src/redturtle/pasldap/profiles/uninstall/browserlayer.xml b/src/redturtle/pasldap/profiles/uninstall/browserlayer.xml deleted file mode 100644 index 9aeab91..0000000 --- a/src/redturtle/pasldap/profiles/uninstall/browserlayer.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - diff --git a/src/redturtle/pasldap/setuphandlers/__init__.py b/src/redturtle/pasldap/setuphandlers/__init__.py deleted file mode 100644 index e5015f0..0000000 --- a/src/redturtle/pasldap/setuphandlers/__init__.py +++ /dev/null @@ -1,11 +0,0 @@ -from Products.CMFPlone.interfaces import INonInstallable -from zope.interface import implementer - - -@implementer(INonInstallable) -class HiddenProfiles: - def getNonInstallableProfiles(self): - """Hide uninstall profile from site-creation and quickinstaller.""" - return [ - "redturtle.pasldap:uninstall", - ] diff --git a/src/redturtle/pasldap/testing.py b/src/redturtle/pasldap/testing.py index df3654b..2d1e52e 100644 --- a/src/redturtle/pasldap/testing.py +++ b/src/redturtle/pasldap/testing.py @@ -1,6 +1,5 @@ from plone.app.contenttypes.testing import PLONE_APP_CONTENTTYPES_FIXTURE from plone.app.robotframework.testing import REMOTE_LIBRARY_BUNDLE_FIXTURE -from plone.app.testing import applyProfile from plone.app.testing import FunctionalTesting from plone.app.testing import IntegrationTesting from plone.app.testing import PloneSandboxLayer @@ -18,9 +17,6 @@ def setUpZope(self, app, configurationContext): # layer. self.loadZCML(package=redturtle.pasldap) - def setUpPloneSite(self, portal): - applyProfile(portal, "redturtle.pasldap:default") - FIXTURE = Layer() diff --git a/src/redturtle/pasldap/upgrades/__init__.py b/src/redturtle/pasldap/upgrades/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/redturtle/pasldap/upgrades/configure.zcml b/src/redturtle/pasldap/upgrades/configure.zcml deleted file mode 100644 index f51f825..0000000 --- a/src/redturtle/pasldap/upgrades/configure.zcml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/tests/conftest.py b/tests/conftest.py index 7c55894..59c8c46 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -3,9 +3,17 @@ from redturtle.pasldap.testing import FUNCTIONAL_TESTING from redturtle.pasldap.testing import INTEGRATION_TESTING +import pytest + pytest_plugins = ["pytest_plone"] +def pytest_sessionfinish(session, exitstatus): + # There is no test suite yet: don't fail CI because of that. + if exitstatus == pytest.ExitCode.NO_TESTS_COLLECTED: + session.exitstatus = pytest.ExitCode.OK + + globals().update( fixtures_factory( ( diff --git a/tests/setup/test_setup_install.py b/tests/setup/test_setup_install.py deleted file mode 100644 index b4427e0..0000000 --- a/tests/setup/test_setup_install.py +++ /dev/null @@ -1,17 +0,0 @@ -from redturtle.pasldap import PACKAGE_NAME - - -class TestSetupInstall: - def test_addon_installed(self, installer): - """Test if redturtle.pasldap is installed.""" - assert installer.is_product_installed(PACKAGE_NAME) is True - - def test_browserlayer(self, browser_layers): - """Test that IBrowserLayer is registered.""" - from redturtle.pasldap.interfaces import IBrowserLayer - - assert IBrowserLayer in browser_layers - - def test_latest_version(self, profile_last_version): - """Test latest version of default profile.""" - assert profile_last_version(f"{PACKAGE_NAME}:default") == "1000" diff --git a/tests/setup/test_setup_uninstall.py b/tests/setup/test_setup_uninstall.py deleted file mode 100644 index c08704b..0000000 --- a/tests/setup/test_setup_uninstall.py +++ /dev/null @@ -1,19 +0,0 @@ -from redturtle.pasldap import PACKAGE_NAME - -import pytest - - -class TestSetupUninstall: - @pytest.fixture(autouse=True) - def uninstalled(self, installer): - installer.uninstall_product(PACKAGE_NAME) - - def test_addon_uninstalled(self, installer): - """Test if redturtle.pasldap is uninstalled.""" - assert installer.is_product_installed(PACKAGE_NAME) is False - - def test_browserlayer_not_registered(self, browser_layers): - """Test that IBrowserLayer is not registered.""" - from redturtle.pasldap.interfaces import IBrowserLayer - - assert IBrowserLayer not in browser_layers