plone.batching 2.0.6__tar.gz → 2.0.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. {plone.batching-2.0.6 → plone_batching-2.0.8}/CHANGES.rst +21 -0
  2. {plone.batching-2.0.6 → plone_batching-2.0.8}/MANIFEST.in +1 -1
  3. {plone.batching-2.0.6/plone.batching.egg-info → plone_batching-2.0.8}/PKG-INFO +42 -2
  4. {plone.batching-2.0.6 → plone_batching-2.0.8}/pyproject.toml +40 -6
  5. {plone.batching-2.0.6 → plone_batching-2.0.8}/setup.py +3 -2
  6. plone_batching-2.0.8/src/plone/batching/__init__.py +10 -0
  7. {plone.batching-2.0.6 → plone_batching-2.0.8/src}/plone/batching/batch.py +0 -1
  8. plone_batching-2.0.8/src/plone/batching/tests/test_security.py +50 -0
  9. {plone.batching-2.0.6 → plone_batching-2.0.8/src/plone.batching.egg-info}/PKG-INFO +42 -2
  10. plone_batching-2.0.8/src/plone.batching.egg-info/SOURCES.txt +31 -0
  11. plone.batching-2.0.6/plone/batching/__init__.py +0 -7
  12. plone.batching-2.0.6/plone.batching.egg-info/SOURCES.txt +0 -30
  13. {plone.batching-2.0.6 → plone_batching-2.0.8}/CONTRIBUTING.rst +0 -0
  14. {plone.batching-2.0.6 → plone_batching-2.0.8}/README.rst +0 -0
  15. {plone.batching-2.0.6 → plone_batching-2.0.8}/docs/LICENSE.txt +0 -0
  16. {plone.batching-2.0.6 → plone_batching-2.0.8}/docs/index.rst +0 -0
  17. {plone.batching-2.0.6 → plone_batching-2.0.8}/docs/usage.rst +0 -0
  18. {plone.batching-2.0.6 → plone_batching-2.0.8}/setup.cfg +0 -0
  19. {plone.batching-2.0.6 → plone_batching-2.0.8/src}/plone/__init__.py +0 -0
  20. {plone.batching-2.0.6 → plone_batching-2.0.8/src}/plone/batching/batch_macros.pt +0 -0
  21. {plone.batching-2.0.6 → plone_batching-2.0.8/src}/plone/batching/batching.rst +0 -0
  22. {plone.batching-2.0.6 → plone_batching-2.0.8/src}/plone/batching/batchnavigation.pt +0 -0
  23. {plone.batching-2.0.6 → plone_batching-2.0.8/src}/plone/batching/batchnavigation_bootstrap.pt +0 -0
  24. {plone.batching-2.0.6 → plone_batching-2.0.8/src}/plone/batching/browser.py +0 -0
  25. {plone.batching-2.0.6 → plone_batching-2.0.8/src}/plone/batching/configure.zcml +0 -0
  26. {plone.batching-2.0.6 → plone_batching-2.0.8/src}/plone/batching/interfaces.py +0 -0
  27. {plone.batching-2.0.6 → plone_batching-2.0.8/src}/plone/batching/tests/__init__.py +0 -0
  28. {plone.batching-2.0.6 → plone_batching-2.0.8/src}/plone/batching/tests/test_batching.py +0 -0
  29. {plone.batching-2.0.6 → plone_batching-2.0.8/src}/plone/batching/utils.py +0 -0
  30. {plone.batching-2.0.6 → plone_batching-2.0.8/src}/plone.batching.egg-info/dependency_links.txt +0 -0
  31. {plone.batching-2.0.6 → plone_batching-2.0.8/src}/plone.batching.egg-info/entry_points.txt +0 -0
  32. {plone.batching-2.0.6 → plone_batching-2.0.8/src}/plone.batching.egg-info/namespace_packages.txt +0 -0
  33. {plone.batching-2.0.6 → plone_batching-2.0.8/src}/plone.batching.egg-info/not-zip-safe +0 -0
  34. {plone.batching-2.0.6 → plone_batching-2.0.8/src}/plone.batching.egg-info/requires.txt +0 -0
  35. {plone.batching-2.0.6 → plone_batching-2.0.8/src}/plone.batching.egg-info/top_level.txt +0 -0
@@ -8,6 +8,27 @@ Changelog
8
8
 
9
9
  .. towncrier release notes start
10
10
 
11
+ 2.0.8 (2026-11-10)
12
+ ------------------
13
+
14
+ Bug fixes:
15
+
16
+
17
+ - Declare only ``Batch`` public in the ``plone.batching`` module instead of opening the whole module to Restricted Python with ``allow_module``.
18
+ [maurits]
19
+
20
+
21
+ 2.0.7 (2025-09-10)
22
+ ------------------
23
+
24
+ Internal:
25
+
26
+
27
+ - Update configuration files.
28
+ [plone devs] (6e36bcc4)
29
+ - Move distribution to src layout [gforcada] (#4217)
30
+
31
+
11
32
  2.0.6 (2023-06-16)
12
33
  ------------------
13
34
 
@@ -1,7 +1,7 @@
1
1
  include *.txt *.rst
2
2
 
3
3
  recursive-include docs *
4
- recursive-include plone *
4
+ recursive-include src *
5
5
 
6
6
  global-exclude *pyc
7
7
  include pyproject.toml
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: plone.batching
3
- Version: 2.0.6
3
+ Version: 2.0.8
4
4
  Summary: Batching facilities used in Plone
5
5
  Home-page: https://pypi.org/project/plone.batching
6
6
  Author: Plone Foundation
@@ -22,7 +22,26 @@ Classifier: Programming Language :: Python :: 3.10
22
22
  Classifier: Programming Language :: Python :: 3.11
23
23
  Requires-Python: >=3.8
24
24
  Description-Content-Type: text/x-rst
25
+ Requires-Dist: AccessControl
26
+ Requires-Dist: setuptools
27
+ Requires-Dist: Zope
28
+ Requires-Dist: zope.interface
29
+ Requires-Dist: zope.schema
25
30
  Provides-Extra: test
31
+ Requires-Dist: zope.component; extra == "test"
32
+ Requires-Dist: zope.publisher; extra == "test"
33
+ Dynamic: author
34
+ Dynamic: author-email
35
+ Dynamic: classifier
36
+ Dynamic: description
37
+ Dynamic: description-content-type
38
+ Dynamic: home-page
39
+ Dynamic: keywords
40
+ Dynamic: license
41
+ Dynamic: provides-extra
42
+ Dynamic: requires-dist
43
+ Dynamic: requires-python
44
+ Dynamic: summary
26
45
 
27
46
  Welcome to Plone batching's documentation!
28
47
  ==========================================
@@ -42,6 +61,27 @@ Changelog
42
61
 
43
62
  .. towncrier release notes start
44
63
 
64
+ 2.0.8 (2026-11-10)
65
+ ------------------
66
+
67
+ Bug fixes:
68
+
69
+
70
+ - Declare only ``Batch`` public in the ``plone.batching`` module instead of opening the whole module to Restricted Python with ``allow_module``.
71
+ [maurits]
72
+
73
+
74
+ 2.0.7 (2025-09-10)
75
+ ------------------
76
+
77
+ Internal:
78
+
79
+
80
+ - Update configuration files.
81
+ [plone devs] (6e36bcc4)
82
+ - Move distribution to src layout [gforcada] (#4217)
83
+
84
+
45
85
  2.0.6 (2023-06-16)
46
86
  ------------------
47
87
 
@@ -1,6 +1,9 @@
1
1
  # Generated from:
2
- # https://github.com/plone/meta/tree/master/config/default
2
+ # https://github.com/plone/meta/tree/main/src/plone/meta/default
3
3
  # See the inline comments on how to expand/tweak this configuration file
4
+ [build-system]
5
+ requires = ["setuptools>=68.2,<80", "wheel"]
6
+
4
7
  [tool.towncrier]
5
8
  directory = "news/"
6
9
  filename = "CHANGES.rst"
@@ -34,17 +37,41 @@ showcontent = true
34
37
 
35
38
  [[tool.towncrier.type]]
36
39
  directory = "tests"
37
- name = "Tests"
40
+ name = "Tests:"
38
41
  showcontent = true
39
42
 
43
+ ##
44
+ # Add extra configuration options in .meta.toml:
45
+ # [pyproject]
46
+ # towncrier_extra_lines = """
47
+ # extra_configuration
48
+ # """
49
+ ##
50
+
40
51
  [tool.isort]
41
52
  profile = "plone"
42
53
 
54
+ ##
55
+ # Add extra configuration options in .meta.toml:
56
+ # [pyproject]
57
+ # isort_extra_lines = """
58
+ # extra_configuration
59
+ # """
60
+ ##
61
+
43
62
  [tool.black]
44
63
  target-version = ["py38"]
45
64
 
65
+ ##
66
+ # Add extra configuration options in .meta.toml:
67
+ # [pyproject]
68
+ # black_extra_lines = """
69
+ # extra_configuration
70
+ # """
71
+ ##
72
+
46
73
  [tool.codespell]
47
- ignore-words-list = "discreet,"
74
+ ignore-words-list = "discreet,assertin,thet,"
48
75
  skip = "*.po,"
49
76
  ##
50
77
  # Add extra configuration options in .meta.toml:
@@ -92,6 +119,7 @@ Zope = [
92
119
  'Products.CMFCore', 'Products.CMFDynamicViewFTI',
93
120
  ]
94
121
  python-dateutil = ['dateutil']
122
+ pytest-plone = ['pytest', 'zope.pytestlayer', 'plone.testing', 'plone.app.testing']
95
123
 
96
124
  ##
97
125
  # Add extra configuration options in .meta.toml:
@@ -101,19 +129,20 @@ python-dateutil = ['dateutil']
101
129
  # "gitpython = ['git']",
102
130
  # "pygithub = ['github']",
103
131
  # ]
104
- # """
105
132
  ##
106
133
 
107
134
  [tool.check-manifest]
108
135
  ignore = [
109
136
  ".editorconfig",
137
+ ".flake8",
110
138
  ".meta.toml",
111
139
  ".pre-commit-config.yaml",
112
- "tox.ini",
113
- ".flake8",
140
+ "dependabot.yml",
114
141
  "mx.ini",
142
+ "tox.ini",
115
143
 
116
144
  ]
145
+
117
146
  ##
118
147
  # Add extra configuration options in .meta.toml:
119
148
  # [pyproject]
@@ -121,6 +150,11 @@ ignore = [
121
150
  # "*.map.js",
122
151
  # "*.pyc",
123
152
  # """
153
+ # check_manifest_extra_lines = """
154
+ # ignore-bad-ideas = [
155
+ # "some/test/file/PKG-INFO",
156
+ # ]
157
+ # """
124
158
  ##
125
159
 
126
160
 
@@ -3,7 +3,7 @@ from setuptools import find_packages
3
3
  from setuptools import setup
4
4
 
5
5
 
6
- version = "2.0.6"
6
+ version = "2.0.8"
7
7
 
8
8
  long_description = (
9
9
  f"{Path('README.rst').read_text()}\n"
@@ -39,8 +39,9 @@ setup(
39
39
  author_email="plone-developers@lists.sourceforge.net",
40
40
  url="https://pypi.org/project/plone.batching",
41
41
  license="GPL",
42
- packages=find_packages(),
42
+ packages=find_packages("src"),
43
43
  namespace_packages=["plone"],
44
+ package_dir={"": "src"},
44
45
  include_package_data=True,
45
46
  zip_safe=False,
46
47
  python_requires=">=3.8",
@@ -0,0 +1,10 @@
1
+ from AccessControl import allow_class
2
+ from AccessControl import ModuleSecurityInfo
3
+ from plone.batching.batch import Batch
4
+
5
+
6
+ # Only declare Batch public. Do not use allow_module here: that would make
7
+ # every name in this module available to restricted code, including
8
+ # imported names like allow_class.
9
+ ModuleSecurityInfo("plone.batching").declarePublic("Batch")
10
+ allow_class(Batch)
@@ -11,7 +11,6 @@ class BaseBatch:
11
11
  """A sequence batch splits up a large number of items over multiple pages"""
12
12
 
13
13
  size = first = start = end = 0
14
- navlist = []
15
14
  numpages = pagenumber = pagerange = pagenumber = 0
16
15
  orphan = overlap = 0
17
16
  b_start_str = "b_start"
@@ -0,0 +1,50 @@
1
+ from AccessControl import Unauthorized
2
+ from AccessControl.ZopeGuards import guarded_getattr
3
+ from AccessControl.ZopeGuards import guarded_import
4
+
5
+ import unittest
6
+
7
+
8
+ class TestModuleSecurity(unittest.TestCase):
9
+ def test_batch_is_public(self):
10
+ from plone.batching import Batch
11
+
12
+ module = guarded_import("plone.batching", fromlist=["Batch"])
13
+ self.assertIs(guarded_getattr(module, "Batch"), Batch)
14
+ batch = Batch(range(10), 3)
15
+ self.assertEqual(guarded_getattr(batch, "pagesize"), 3)
16
+
17
+ def test_other_names_are_not_public(self):
18
+ import plone.batching
19
+
20
+ # Make sure the submodules are attributes of the package.
21
+ import plone.batching.batch # noqa: F401
22
+ import plone.batching.browser # noqa: F401
23
+ import plone.batching.utils # noqa: F401
24
+
25
+ for name in (
26
+ "allow_class",
27
+ "allow_module",
28
+ "ModuleSecurityInfo",
29
+ "batch",
30
+ "browser",
31
+ "utils",
32
+ ):
33
+ if not hasattr(plone.batching, name):
34
+ continue
35
+ with self.subTest(name=name):
36
+ self.assertRaises(Unauthorized, guarded_getattr, plone.batching, name)
37
+ self.assertRaises(
38
+ Unauthorized,
39
+ guarded_import,
40
+ "plone.batching",
41
+ fromlist=[name],
42
+ )
43
+
44
+ def test_submodules_not_importable(self):
45
+ # guarded_import may raise the Unauthorized from zExceptions instead.
46
+ for name in ("plone.batching.batch", "plone.batching.utils"):
47
+ with self.subTest(name=name):
48
+ with self.assertRaises(Exception) as cm:
49
+ guarded_import(name)
50
+ self.assertEqual(type(cm.exception).__name__, "Unauthorized")
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: plone.batching
3
- Version: 2.0.6
3
+ Version: 2.0.8
4
4
  Summary: Batching facilities used in Plone
5
5
  Home-page: https://pypi.org/project/plone.batching
6
6
  Author: Plone Foundation
@@ -22,7 +22,26 @@ Classifier: Programming Language :: Python :: 3.10
22
22
  Classifier: Programming Language :: Python :: 3.11
23
23
  Requires-Python: >=3.8
24
24
  Description-Content-Type: text/x-rst
25
+ Requires-Dist: AccessControl
26
+ Requires-Dist: setuptools
27
+ Requires-Dist: Zope
28
+ Requires-Dist: zope.interface
29
+ Requires-Dist: zope.schema
25
30
  Provides-Extra: test
31
+ Requires-Dist: zope.component; extra == "test"
32
+ Requires-Dist: zope.publisher; extra == "test"
33
+ Dynamic: author
34
+ Dynamic: author-email
35
+ Dynamic: classifier
36
+ Dynamic: description
37
+ Dynamic: description-content-type
38
+ Dynamic: home-page
39
+ Dynamic: keywords
40
+ Dynamic: license
41
+ Dynamic: provides-extra
42
+ Dynamic: requires-dist
43
+ Dynamic: requires-python
44
+ Dynamic: summary
26
45
 
27
46
  Welcome to Plone batching's documentation!
28
47
  ==========================================
@@ -42,6 +61,27 @@ Changelog
42
61
 
43
62
  .. towncrier release notes start
44
63
 
64
+ 2.0.8 (2026-11-10)
65
+ ------------------
66
+
67
+ Bug fixes:
68
+
69
+
70
+ - Declare only ``Batch`` public in the ``plone.batching`` module instead of opening the whole module to Restricted Python with ``allow_module``.
71
+ [maurits]
72
+
73
+
74
+ 2.0.7 (2025-09-10)
75
+ ------------------
76
+
77
+ Internal:
78
+
79
+
80
+ - Update configuration files.
81
+ [plone devs] (6e36bcc4)
82
+ - Move distribution to src layout [gforcada] (#4217)
83
+
84
+
45
85
  2.0.6 (2023-06-16)
46
86
  ------------------
47
87
 
@@ -0,0 +1,31 @@
1
+ CHANGES.rst
2
+ CONTRIBUTING.rst
3
+ MANIFEST.in
4
+ README.rst
5
+ pyproject.toml
6
+ setup.py
7
+ docs/LICENSE.txt
8
+ docs/index.rst
9
+ docs/usage.rst
10
+ src/plone/__init__.py
11
+ src/plone.batching.egg-info/PKG-INFO
12
+ src/plone.batching.egg-info/SOURCES.txt
13
+ src/plone.batching.egg-info/dependency_links.txt
14
+ src/plone.batching.egg-info/entry_points.txt
15
+ src/plone.batching.egg-info/namespace_packages.txt
16
+ src/plone.batching.egg-info/not-zip-safe
17
+ src/plone.batching.egg-info/requires.txt
18
+ src/plone.batching.egg-info/top_level.txt
19
+ src/plone/batching/__init__.py
20
+ src/plone/batching/batch.py
21
+ src/plone/batching/batch_macros.pt
22
+ src/plone/batching/batching.rst
23
+ src/plone/batching/batchnavigation.pt
24
+ src/plone/batching/batchnavigation_bootstrap.pt
25
+ src/plone/batching/browser.py
26
+ src/plone/batching/configure.zcml
27
+ src/plone/batching/interfaces.py
28
+ src/plone/batching/utils.py
29
+ src/plone/batching/tests/__init__.py
30
+ src/plone/batching/tests/test_batching.py
31
+ src/plone/batching/tests/test_security.py
@@ -1,7 +0,0 @@
1
- from AccessControl import allow_class
2
- from AccessControl import allow_module
3
- from plone.batching.batch import Batch
4
-
5
-
6
- allow_module("plone.batching")
7
- allow_class(Batch)
@@ -1,30 +0,0 @@
1
- CHANGES.rst
2
- CONTRIBUTING.rst
3
- MANIFEST.in
4
- README.rst
5
- pyproject.toml
6
- setup.py
7
- docs/LICENSE.txt
8
- docs/index.rst
9
- docs/usage.rst
10
- plone/__init__.py
11
- plone.batching.egg-info/PKG-INFO
12
- plone.batching.egg-info/SOURCES.txt
13
- plone.batching.egg-info/dependency_links.txt
14
- plone.batching.egg-info/entry_points.txt
15
- plone.batching.egg-info/namespace_packages.txt
16
- plone.batching.egg-info/not-zip-safe
17
- plone.batching.egg-info/requires.txt
18
- plone.batching.egg-info/top_level.txt
19
- plone/batching/__init__.py
20
- plone/batching/batch.py
21
- plone/batching/batch_macros.pt
22
- plone/batching/batching.rst
23
- plone/batching/batchnavigation.pt
24
- plone/batching/batchnavigation_bootstrap.pt
25
- plone/batching/browser.py
26
- plone/batching/configure.zcml
27
- plone/batching/interfaces.py
28
- plone/batching/utils.py
29
- plone/batching/tests/__init__.py
30
- plone/batching/tests/test_batching.py
File without changes