diff --git a/.editorconfig b/.editorconfig index d054af1..55bfb6d 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,5 +1,5 @@ # Generated from: -# https://github.com/plone/meta/tree/main/src/plone/meta/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: diff --git a/.flake8 b/.flake8 index 3e2d35f..ff17672 100644 --- a/.flake8 +++ b/.flake8 @@ -1,5 +1,5 @@ # Generated from: -# https://github.com/plone/meta/tree/main/src/plone/meta/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/dependabot.yml b/.github/dependabot.yml similarity index 80% rename from dependabot.yml rename to .github/dependabot.yml index e5e4522..8da3888 100644 --- a/dependabot.yml +++ b/.github/dependabot.yml @@ -1,5 +1,5 @@ # Generated from: -# https://github.com/plone/meta/tree/main/src/plone/meta/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 version: 2 updates: diff --git a/.github/workflows/meta.yml b/.github/workflows/meta.yml index 667d046..a25ff2f 100644 --- a/.github/workflows/meta.yml +++ b/.github/workflows/meta.yml @@ -1,16 +1,10 @@ # Generated from: -# https://github.com/plone/meta/tree/main/src/plone/meta/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 + on: push: - branches: - - master - - main - pull_request: - branches: - - master - - main workflow_dispatch: ## @@ -25,24 +19,19 @@ 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 - circular: - uses: plone/meta/.github/workflows/circular.yml@main + uses: plone/meta/.github/workflows/release_ready.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 +46,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..ed8b515 --- /dev/null +++ b/.github/workflows/test-matrix.yml @@ -0,0 +1,67 @@ +# 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.9", "6.0 on py3.9", "py39-plone60"] + - ["3.13", "6.0 on py3.13", "py313-plone60"] + - ["3.13", "6.1 on py3.13", "py313-plone61"] + - ["3.10", "6.1 on py3.10", "py310-plone61"] + + 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@v6 + with: + persist-credentials: false + - name: Install uv + caching + uses: astral-sh/setup-uv@v8.1.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 a602abe..70377bd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ # Generated from: -# https://github.com/plone/meta/tree/main/src/plone/meta/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 diff --git a/.meta.toml b/.meta.toml index a41e421..c863410 100644 --- a/.meta.toml +++ b/.meta.toml @@ -1,11 +1,24 @@ # Generated from: -# https://github.com/plone/meta/tree/main/src/plone/meta/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 = "ab485d6f" +commit-id = "2.8.1.dev0" + +[github] +# No 'circular' as it fails on 6.0 for plone.api and Products.CMFPlone. +jobs = [ + "qa", + "coverage", + "dependencies", + "release_ready", + ] [pyproject] dependencies_mappings = [ "'Products.ZCatalog' = ['Products.PluginIndexes']", ] +dependencies_ignores = "['setuptools']" + +[tox] +test_matrix = {"6.0" = ["3.9", "3.10", "3.11", "3.12", "3.13"], "6.1" = ["*"]} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0b63ae5..b0784d9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,5 @@ # Generated from: -# https://github.com/plone/meta/tree/main/src/plone/meta/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.21.0 + rev: v3.21.2 hooks: - id: pyupgrade - args: [--py38-plus] + args: [--py39-plus] - repo: https://github.com/pycqa/isort - rev: 7.0.0 + rev: 8.0.1 hooks: - id: isort - repo: https://github.com/psf/black-pre-commit-mirror - rev: 25.9.0 + rev: 26.3.1 hooks: - id: black - repo: https://github.com/collective/zpretty - rev: 3.1.1 + rev: 4.0.0 hooks: - id: zpretty @@ -44,7 +44,7 @@ repos: # """ ## - repo: https://github.com/codespell-project/codespell - rev: v2.4.1 + rev: v2.4.2 hooks: - id: codespell additional_dependencies: @@ -62,16 +62,16 @@ repos: hooks: - id: check-manifest - repo: https://github.com/regebro/pyroma - rev: "5.0" + rev: "5.0.1" hooks: - id: pyroma - repo: https://github.com/mgedmin/check-python-versions - rev: "0.23.0" + rev: "0.24.2" hooks: - id: check-python-versions - args: ['--only', 'setup.py,pyproject.toml'] + args: ['--only', 'setup.py,tox.ini'] - repo: https://github.com/collective/i18ndude - rev: "6.2.1" + rev: "6.3.0" hooks: - id: i18ndude diff --git a/news/+meta.internal b/news/+meta.internal new file mode 100644 index 0000000..c08f539 --- /dev/null +++ b/news/+meta.internal @@ -0,0 +1,2 @@ +Update configuration files. +[plone devs] diff --git a/pyproject.toml b/pyproject.toml index 3cd1a8a..c474c90 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,10 @@ # Generated from: -# https://github.com/plone/meta/tree/main/src/plone/meta/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>=68.2"] +requires = ["setuptools>=68.2,<82", "wheel"] + + [tool.towncrier] directory = "news/" @@ -37,7 +39,7 @@ showcontent = true [[tool.towncrier.type]] directory = "tests" -name = "Tests" +name = "Tests:" showcontent = true ## @@ -60,7 +62,7 @@ profile = "plone" ## [tool.black] -target-version = ["py38"] +target-version = ["py39"] ## # Add extra configuration options in .meta.toml: @@ -120,6 +122,7 @@ Zope = [ ] python-dateutil = ['dateutil'] pytest-plone = ['pytest', 'zope.pytestlayer', 'plone.testing', 'plone.app.testing'] +ignore-packages = ['setuptools'] 'Products.ZCatalog' = ['Products.PluginIndexes'] ## diff --git a/setup.py b/setup.py index 37179cc..1f84f4f 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,6 @@ from setuptools import find_packages from setuptools import setup - version = "4.0.2.dev0" long_description = ( @@ -31,10 +30,11 @@ "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", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", ], keywords="folder btree order", author="Plone Foundation", @@ -47,7 +47,7 @@ include_package_data=True, platforms="Any", zip_safe=False, - python_requires=">=3.8", + python_requires=">=3.9", install_requires=[ "setuptools", "Products.CMFCore", diff --git a/src/plone/folder/nogopip.py b/src/plone/folder/nogopip.py index d8b25f4..1b03f32 100644 --- a/src/plone/folder/nogopip.py +++ b/src/plone/folder/nogopip.py @@ -9,7 +9,6 @@ from zope.component import getUtility from zope.interface import implementer - logger = getLogger(__name__) diff --git a/src/plone/folder/ordered.py b/src/plone/folder/ordered.py index 72edf91..e8cd91f 100644 --- a/src/plone/folder/ordered.py +++ b/src/plone/folder/ordered.py @@ -14,7 +14,6 @@ from zope.component import queryAdapter from zope.interface import implementer - try: from ZTUtils.Lazy import LazyMap except ImportError: diff --git a/src/plone/folder/partial.py b/src/plone/folder/partial.py index d1ab5d0..5d4a0e7 100644 --- a/src/plone/folder/partial.py +++ b/src/plone/folder/partial.py @@ -6,7 +6,6 @@ from zope.container.contained import notifyContainerModified from zope.interface import implementer - ORDER_ATTR = "_objectordering" diff --git a/src/plone/folder/tests/test_webdav.py b/src/plone/folder/tests/test_webdav.py index d4a9637..2ac06f3 100644 --- a/src/plone/folder/tests/test_webdav.py +++ b/src/plone/folder/tests/test_webdav.py @@ -6,7 +6,6 @@ import unittest - HAS_WEBDAV = True try: from webdav.NullResource import NullResource diff --git a/tox.ini b/tox.ini index 4d30bcd..8319494 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ # Generated from: -# https://github.com/plone/meta/tree/main/src/plone/meta/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,27 @@ min_version = 4.4.0 envlist = lint test + py39-plone60 + py310-plone60 + py311-plone60 + py312-plone60 + py313-plone60 + py313-plone61 + py312-plone61 + py311-plone61 + py310-plone61 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,32 +36,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 @@ -71,9 +68,9 @@ description = check if the package defines all its dependencies skip_install = true deps = build - z3c.dependencychecker==2.14.3 + z3c.dependencychecker==3.0 commands = - python -m build --sdist + python -m build --wheel dependencychecker [testenv:dependencies-graph] @@ -87,8 +84,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,62 +112,82 @@ 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} + plone60: -c https://dist.plone.org/release/6.0-dev/constraints.txt + plone61: -c https://dist.plone.org/release/6.1-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] +# skip_test_extra = true # test_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.0-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 -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] @@ -170,7 +198,6 @@ deps = build towncrier -c https://dist.plone.org/release/6.0-dev/constraints.txt - commands = # fake version to not have to install the package # we build the change log as news entries might break @@ -201,7 +228,6 @@ deps = pipdeptree pipforester -c https://dist.plone.org/release/6.0-dev/constraints.txt - commands = # Generate the full dependency tree sh -c 'pipdeptree -j > forest.json'