Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/test-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
- ["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"]

Expand Down
4 changes: 2 additions & 2 deletions .meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
# See the inline comments on how to expand/tweak this configuration file
[meta]
template = "default"
commit-id = "2.8.0"
commit-id = "2.9.1.dev0"

[tox]
test_matrix = {"6.2" = ["*"]}
test_matrix = {"6.3" = ["*"], "6.2" = ["*"]}

[flake8]
extra_lines = """
Expand Down
2 changes: 2 additions & 0 deletions news/+meta.internal
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Update configuration files.
[plone devs]
3 changes: 3 additions & 0 deletions news/3176.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Remove deprecation warning for `Batch.__len__` again.
Calling this method is simply unavoidable.
[maurits]
10 changes: 8 additions & 2 deletions src/plone/base/batch.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from plone.batching.batch import QuantumBatch
from plone.batching.utils import calculate_pagerange
from zope.deprecation import deprecate
from ZTUtils import make_query


Expand All @@ -24,7 +23,6 @@ def __init__(
)
self.b_start_str = b_start_str

@deprecate("Use length attribute instead of __len__")
def __len__(self):
# Note: Using len() was deprecated for several years.
# It was recommended to explicitly either use the `length` attribute
Expand All @@ -36,6 +34,14 @@ def __len__(self):
# on batches, making the deprecation warning unavoidable
# and thus unnecessary.
# See https://github.com/plone/Products.CMFPlone/issues/3176
# That same Products.PageTemplate code also calls `list` on batches,
# and apparently this automatically invokes `__len__`, making it even
# more unavoidable.
# The deprecation was inadvertently added again during the move to
# plone.base in Plone 6.0. Compare:
# https://github.com/plone/Products.CMFPlone/commit/2cc25159443759573360af51216bcb9253cc87c1#diff-fa1e7e5e81879e8c4f4485cf8d8204eba6f2677cb9f4e29de4776b0c1f0d4d93L21
# with
# https://github.com/plone/plone.base/commit/6e26a377f7153ea6631a6ad58b7a9008fd3d6e53#diff-316da888fe8d39c68d5e0aee055b3bbfa95d522b4b09fe56b7edb1289bd72f9fR28
return self.length

def __bool__(self):
Expand Down
14 changes: 10 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ min_version = 4.4.0
envlist =
lint
test
py314-plone63
py313-plone63
py312-plone63
py311-plone63
py310-plone63
py314-plone62
py313-plone62
py312-plone62
Expand Down Expand Up @@ -112,6 +117,7 @@ set_env =
##
deps =
{[test_runner]deps}
plone63: -c https://dist.plone.org/release/6.3-dev/constraints.txt
plone62: -c https://dist.plone.org/release/6.2-dev/constraints.txt

##
Expand Down Expand Up @@ -153,7 +159,7 @@ 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
-c https://dist.plone.org/release/6.3-dev/constraints.txt

commands = {[test_runner]test}
extras = {[base]extras}
Expand All @@ -179,7 +185,7 @@ set_env = {[base]set_env}
deps =
{[test_runner]deps}
coverage
-c https://dist.plone.org/release/6.2-dev/constraints.txt
-c https://dist.plone.org/release/6.3-dev/constraints.txt

commands = {[test_runner]coverage}
extras = {[base]extras}
Expand All @@ -192,7 +198,7 @@ deps =
twine
build
towncrier
-c https://dist.plone.org/release/6.2-dev/constraints.txt
-c https://dist.plone.org/release/6.3-dev/constraints.txt
commands =
# fake version to not have to install the package
# we build the change log as news entries might break
Expand Down Expand Up @@ -222,7 +228,7 @@ allowlist_externals =
deps =
pipdeptree
pipforester
-c https://dist.plone.org/release/6.2-dev/constraints.txt
-c https://dist.plone.org/release/6.3-dev/constraints.txt
commands =
# Generate the full dependency tree
sh -c 'pipdeptree -j > forest.json'
Expand Down
Loading