Skip to content

Commit 218f765

Browse files
committed
Merge branch 'master' of github.com:wolbernd/plone.restapi
2 parents 9e0407f + 553a4bb commit 218f765

19 files changed

Lines changed: 347 additions & 31 deletions

File tree

.github/workflows/flake8.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
2929
# install flake8
3030
- name: install flake8
31-
run: pip install flake8
31+
run: pip install flake8==$(awk '/^flake8 =/{print $NF}' versions.cfg)
3232

3333
# run black
3434
- name: run flake8

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ jobs:
6464

6565
# test no uncommited changes
6666
- name: test no uncommited changes
67-
run: bin/test-no-uncommitted-doc-changes
67+
run: ./test-no-uncommitted-doc-changes
6868
env:
6969
PYTHON_VERSION: ${{ matrix.python-version }}
7070
PLONE_VERSION: ${{ matrix.plone-version }}
7171

7272
# test for broken links
7373
- name: linkcheck
74-
run: if [ "${{ matrix.plone-version }}" == "6.0" ] && [ ${{ matrix.python-version }} == '3.9' ]; then make docs-linkcheckbroken; fi
74+
run: if [ "${{ matrix.plone-version }}" == "6.0" ] && [ ${{ matrix.python-version }} == '3.9' ]; then make docs-linkcheckbroken; fi

base.cfg

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ parts =
55
instance
66
test
77
test-coverage
8-
test-no-uncommitted-doc-changes
9-
test-no-sphinx-warnings
108
code-analysis
119
dependencychecker
1210
dependencies
@@ -87,18 +85,6 @@ input = inline:
8785
output = ${buildout:directory}/bin/test-coverage
8886
mode = 755
8987

90-
[test-no-uncommitted-doc-changes]
91-
recipe = collective.recipe.template
92-
input = test-no-uncommitted-doc-changes.in
93-
output = bin/test-no-uncommitted-doc-changes
94-
mode = 755
95-
96-
[test-no-sphinx-warnings]
97-
recipe = collective.recipe.template
98-
input = test-no-sphinx-warnings.in
99-
output = bin/test-no-sphinx-warnings
100-
mode = 755
101-
10288
[code-analysis]
10389
recipe = plone.recipe.codeanalysis
10490
directory = ${buildout:directory}/src

news/1414.feature

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Move caching rulesets to the ZCML where the endpoints are defined.
2+
[jensens]

setup.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33

44
version = "8.22.1.dev0"
55

6-
assert sys.version_info >= (3, 6, 0), "plone.restapi 8 requires Python 3.6.0+. Please downgrade to plone.restapi 7 for Python 2 and Plone 4.3/5.1."
6+
assert sys.version_info >= (
7+
3,
8+
6,
9+
0,
10+
), "plone.restapi 8 requires Python 3.6.0+. Please downgrade to plone.restapi 7 for Python 2 and Plone 4.3/5.1."
711

812

913
def read(filename):
@@ -34,6 +38,7 @@ def read(filename):
3438

3539
TEST_REQUIRES = [
3640
"collective.MockMailHost",
41+
"plone.app.caching",
3742
"plone.app.contenttypes",
3843
"plone.app.robotframework",
3944
"plone.app.testing [robot] >= 4.2.2", # ROBOT_TEST_LEVEL added
@@ -82,9 +87,9 @@ def read(filename):
8287
"setuptools",
8388
"importlib-metadata; python_version<'3.8'",
8489
"python-dateutil",
85-
"plone.behavior>=1.1", # adds name to behavior directive
86-
"plone.rest >= 1.0a6", # json renderer moved to plone.restapi
87-
"plone.schema >= 1.2.1", # new/fixed json field
90+
"plone.rest", # json renderer moved to plone.restapi
91+
"plone.schema>=1.2.1", # new/fixed json field
92+
"Products.CMFPlone>=5.2",
8893
"PyJWT>=1.7.0",
8994
"pytz",
9095
],

src/plone/restapi/configure.zcml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
<include package="plone.behavior" />
2323
<include package="plone.rest" />
2424
<include package="plone.schema" />
25+
26+
<include
27+
package="plone.app.caching"
28+
zcml:condition="installed plone.app.caching"
29+
/>
30+
2531
<include file="indexers.zcml" />
2632

2733
<five:registerPackage

src/plone/restapi/services/actions/configure.zcml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<configure
22
xmlns="http://namespaces.zope.org/zope"
3+
xmlns:cache="http://namespaces.zope.org/cache"
34
xmlns:plone="http://namespaces.plone.org/plone"
5+
xmlns:zcml="http://namespaces.zope.org/zcml"
46
>
57

68
<adapter
@@ -15,5 +17,10 @@
1517
permission="zope2.View"
1618
name="@actions"
1719
/>
20+
<cache:ruleset
21+
for=".get.ActionsGet"
22+
ruleset="plone.content.dynamic"
23+
zcml:condition="have plone-app-caching-3"
24+
/>
1825

1926
</configure>

src/plone/restapi/services/breadcrumbs/configure.zcml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<configure
22
xmlns="http://namespaces.zope.org/zope"
3+
xmlns:cache="http://namespaces.zope.org/cache"
34
xmlns:plone="http://namespaces.plone.org/plone"
5+
xmlns:zcml="http://namespaces.zope.org/zcml"
46
>
57

68
<adapter
@@ -15,5 +17,10 @@
1517
permission="zope2.View"
1618
name="@breadcrumbs"
1719
/>
20+
<cache:ruleset
21+
for=".get.BreadcrumbsGet"
22+
ruleset="plone.content.dynamic"
23+
zcml:condition="have plone-app-caching-3"
24+
/>
1825

1926
</configure>

src/plone/restapi/services/content/configure.zcml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<configure
22
xmlns="http://namespaces.zope.org/zope"
3+
xmlns:cache="http://namespaces.zope.org/cache"
34
xmlns:plone="http://namespaces.plone.org/plone"
45
xmlns:zcml="http://namespaces.zope.org/zcml"
56
>
@@ -17,6 +18,11 @@
1718
for="Products.CMFCore.interfaces.IContentish"
1819
permission="zope2.View"
1920
/>
21+
<cache:ruleset
22+
for=".get.ContentGet"
23+
ruleset="plone.content.dynamic"
24+
zcml:condition="have plone-app-caching-3"
25+
/>
2026

2127
<plone:service
2228
method="PATCH"

src/plone/restapi/services/discussion/configure.zcml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<configure
22
xmlns="http://namespaces.zope.org/zope"
3+
xmlns:cache="http://namespaces.zope.org/cache"
34
xmlns:plone="http://namespaces.plone.org/plone"
45
xmlns:zcml="http://namespaces.zope.org/zcml"
56
>
@@ -16,6 +17,11 @@
1617
permission="zope2.View"
1718
name="@comments"
1819
/>
20+
<cache:ruleset
21+
for=".conversation.CommentsGet"
22+
ruleset="plone.content.itemView"
23+
zcml:condition="have plone-app-caching-3"
24+
/>
1925

2026
<plone:service
2127
method="POST"

0 commit comments

Comments
 (0)