Skip to content

Commit 735493a

Browse files
authored
Merge pull request #1 from codesyntax/tests
Tests
2 parents 0fc80f1 + 2a6a7a6 commit 735493a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+1087
-507
lines changed

CONTRIBUTORS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Contributors
22

3-
- Lur Ibargutxi [libargutxi@codesyntax.com]
3+
- Plone Community [collective@plone.org]

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cs_dynamicpages Copyright 2025, Lur Ibargutxi
1+
cs_dynamicpages Copyright 2025, Plone Community
22

33
This program is free software; you can redistribute it and/or
44
modify it under the terms of the GNU General Public License version 2

Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ requirements-mxdev.txt: pyproject.toml mx.ini ## Generate constraints file
5454

5555
$(VENV_FOLDER): requirements-mxdev.txt ## Install dependencies
5656
@echo "$(GREEN)==> Install environment$(RESET)"
57-
@uv venv --python=3.10 $(VENV_FOLDER)
57+
@uv venv $(VENV_FOLDER)
5858
@uv pip install -r requirements-mxdev.txt
5959

6060
.PHONY: sync
@@ -131,4 +131,10 @@ test-coverage: $(VENV_FOLDER) ## run tests with coverage
131131

132132
## Add bobtemplates features (check bobtemplates.plone's documentation to get the list of available features)
133133
add: $(VENV_FOLDER)
134-
/home/lur/plonecli_azkena/bin/plonecli add $(filter-out $@,$(MAKECMDGOALS))
134+
@uvx plonecli add -b .mrbob.ini $(filter-out $@,$(MAKECMDGOALS))
135+
136+
.PHONY: release
137+
release: $(VENV_FOLDER) ## Create a release
138+
@echo "$(GREEN)==> Create a release$(RESET)"
139+
@uv pip install -e ".[release]"
140+
@uv run fullrelease

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# cs_dynamicpages
22

3-
An addon to create dynamic pages for Plone
3+
A new addon for Plone
44

55
## Features
66

@@ -22,8 +22,8 @@ make create-site
2222

2323
## Contribute
2424

25-
- [Issue tracker](https://github.com/cs/cs_dynamicpages/issues)
26-
- [Source code](https://github.com/cs/cs_dynamicpages/)
25+
- [Issue tracker](https://github.com/collective/cs_dynamicpages/issues)
26+
- [Source code](https://github.com/collective/cs_dynamicpages/)
2727

2828
### Prerequisites ✅
2929

@@ -38,7 +38,7 @@ make create-site
3838
1. Clone this repository, then change your working directory.
3939

4040
```shell
41-
git clone git@github.com:cs/cs_dynamicpages.git
41+
git clone git@github.com:collective/cs_dynamicpages.git
4242
cd cs_dynamicpages
4343
```
4444

@@ -83,4 +83,4 @@ The project is licensed under GPLv2.
8383

8484
## Credits and acknowledgements 🙏
8585

86-
Generated using [Cookieplone (0.9.7)](https://github.com/plone/cookieplone) and [cookieplone-templates (6782781)](https://github.com/plone/cookieplone-templates/commit/6782781dae4bafb227467828066ab16b84c23750) on 2025-07-07 09:25:15.108762. A special thanks to all contributors and supporters!
86+
Generated using [Cookieplone (0.9.7)](https://github.com/plone/cookieplone) and [cookieplone-templates (4d55553)](https://github.com/plone/cookieplone-templates/commit/4d55553d61416df56b3360914b398d675b3f72a6) on 2025-07-17 11:59:12.982862. A special thanks to all contributors and supporters!

pyproject.toml

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,55 @@
11
[project]
22
name = "cs_dynamicpages"
33
dynamic = ["version"]
4-
description = "An addon to create dynamic pages for Plone"
4+
description = "A new addon for Plone"
55
readme = "README.md"
66
license = "GPL-2.0-only"
77
requires-python = ">=3.10"
8-
authors = [
9-
{ name = "Lur Ibargutxi", email = "libargutxi@codesyntax.com" },
10-
]
11-
keywords = [
12-
"CMS",
13-
"Plone",
14-
"Python",
15-
]
8+
authors = [{ name = "Plone Community", email = "collective@plone.org" }]
9+
keywords = ["CMS", "Plone", "Python"]
1610
classifiers = [
1711
"Development Status :: 3 - Alpha",
1812
"Environment :: Web Environment",
19-
"Framework :: Plone","Framework :: Plone :: 6.0","Framework :: Plone :: 6.1",
13+
"Framework :: Plone",
14+
"Framework :: Plone :: 6.0",
15+
"Framework :: Plone :: 6.1",
2016
"Framework :: Plone :: Addon",
2117
"License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
2218
"Operating System :: OS Independent",
23-
"Programming Language :: Python","Programming Language :: Python :: 3.10","Programming Language :: Python :: 3.11","Programming Language :: Python :: 3.12","Programming Language :: Python :: 3.13",
19+
"Programming Language :: Python",
20+
"Programming Language :: Python :: 3.10",
21+
"Programming Language :: Python :: 3.11",
22+
"Programming Language :: Python :: 3.12",
23+
"Programming Language :: Python :: 3.13",
2424
]
2525
dependencies = [
2626
"Products.CMFPlone",
2727
"plone.api",
28-
"z3c.jbot",
2928
"collective.z3cform.datagridfield",
3029
]
3130

3231
[project.optional-dependencies]
3332
test = [
3433
"horse-with-no-namespace",
3534
"plone.app.testing",
36-
"plone.classicui","plone.restapi[test]",
35+
"plone.app.contenttypes[test]",
36+
"plone.classicui",
37+
"plone.restapi[test]",
3738
"pytest",
3839
"pytest-cov",
3940
"pytest-plone>=0.5.0",
4041
]
42+
release = [
43+
"zest.releaser[recommended]",
44+
"zestreleaser.towncrier",
45+
"zest.pocompile",
46+
]
4147

4248
[project.urls]
43-
Homepage = "https://github.com/cs/cs_dynamicpages"
49+
Homepage = "https://github.com/collective/cs_dynamicpages"
4450
PyPI = "https://pypi.org/project/cs_dynamicpages"
45-
Source = "https://github.com/cs/cs_dynamicpages"
46-
Tracker = "https://github.com/cs/cs_dynamicpages/issues"
51+
Source = "https://github.com/collective/cs_dynamicpages"
52+
Tracker = "https://github.com/collective/cs_dynamicpages/issues"
4753

4854

4955
[project.entry-points."plone.autoinclude.plugin"]
@@ -63,9 +69,7 @@ build-backend = "hatchling.build"
6369
strict-naming = true
6470

6571
[tool.hatch.build.targets.sdist]
66-
exclude = [
67-
"/.github",
68-
]
72+
exclude = ["/.github"]
6973

7074
[tool.hatch.build.targets.wheel]
7175
packages = ["src/cs_dynamicpages"]
@@ -76,7 +80,7 @@ filename = "CHANGELOG.md"
7680
start_string = "<!-- towncrier release notes start -->\n"
7781
title_format = "## {version} ({project_date})"
7882
template = "news/.changelog_template.jinja"
79-
issue_format = "[#{issue}](https://github.com/cs/cs_dynamicpages/issues/{issue})"
83+
issue_format = "[#{issue}](https://github.com/collective/cs_dynamicpages/issues/{issue})"
8084
underlines = ["", "", ""]
8185

8286
[[tool.towncrier.type]]
@@ -131,7 +135,8 @@ lint.select = [
131135
# mccabe
132136
"C90",
133137
# pycodestyle
134-
"E", "W",
138+
"E",
139+
"W",
135140
# pyflakes
136141
"F",
137142
# pygrep-hooks
@@ -168,6 +173,8 @@ testpaths = ["tests"]
168173
source_pkgs = ["cs_dynamicpages", "tests"]
169174
branch = true
170175
parallel = true
171-
omit = [
172-
"src/cs_dynamicpages/locales/*.py",
173-
]
176+
omit = ["src/cs_dynamicpages/locales/*.py"]
177+
178+
179+
[tool.zest-releaser]
180+
python-file-with-version = "src/cs_dynamicpages/__init__.py"

src/cs_dynamicpages/behaviors/configure.zcml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313

1414
<!-- -*- extra stuff goes here -*- -->
1515

16-
<plone:behavior
17-
name="cs_dynamicpages.row_columns"
18-
title="RowColumns"
19-
description="This behavior provides..."
20-
provides=".row_columns.IRowColumns"
21-
factory=".row_columns.RowColumns"
22-
marker=".row_columns.IRowColumnsMarker"
23-
/>
16+
<plone:behavior
17+
name="cs_dynamicpages.row_columns"
18+
title="RowColumns"
19+
description="This behavior provides..."
20+
factory=".row_columns.RowColumns"
21+
provides=".row_columns.IRowColumns"
22+
marker=".row_columns.IRowColumnsMarker"
23+
/>
2424

2525

2626
<plone:behavior

src/cs_dynamicpages/behaviors/related_image.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,28 @@
1-
from plone.app.z3cform.widgets.contentbrowser import ContentBrowserFieldWidget
1+
# from plone.app.z3cform.widgets.contentbrowser import ContentBrowserFieldWidget
22
from plone.autoform import directives as form
33
from plone.autoform.interfaces import IFormFieldProvider
44
from plone.supermodel import model
55
from Products.CMFPlone.utils import safe_hasattr
66
from z3c.relationfield.schema import RelationChoice
77
from z3c.relationfield.schema import RelationList
8+
from zope import schema
89
from zope.component import adapter
910
from zope.interface import implementer
1011
from zope.interface import Interface
1112
from zope.interface import provider
12-
from zope import schema
13+
14+
15+
try:
16+
# This is for Plone 6.1
17+
from plone.app.z3cform.widgets.contentbrowser import (
18+
ContentBrowserFieldWidget as RelatedImageFieldWidget,
19+
)
20+
except ImportError:
21+
# This is for previous versions of Plone
22+
from plone.app.z3cform.widgets.relateditems import (
23+
RelatedItemsFieldWidget as RelatedImageFieldWidget,
24+
)
25+
1326

1427
class IRelatedImageMarker(Interface):
1528
pass
@@ -29,7 +42,7 @@ class IRelatedImage(model.Schema):
2942

3043
form.widget(
3144
"related_image",
32-
ContentBrowserFieldWidget,
45+
RelatedImageFieldWidget,
3346
vocabulary="plone.app.vocabularies.Catalog",
3447
pattern_options={
3548
"recentlyUsed": True,
@@ -68,4 +81,4 @@ def image_position(self):
6881

6982
@image_position.setter
7083
def image_position(self, value):
71-
self.context.image_position = value
84+
self.context.image_position = value

src/cs_dynamicpages/behaviors/row_columns.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
# -*- coding: utf-8 -*-
2-
3-
from cs_dynamicpages import _
41
from plone import schema
52
from plone.autoform.interfaces import IFormFieldProvider
63
from plone.supermodel import model
74
from Products.CMFPlone.utils import safe_hasattr
85
from zope.component import adapter
9-
from zope.interface import Interface
106
from zope.interface import implementer
7+
from zope.interface import Interface
118
from zope.interface import provider
129

1310

@@ -17,8 +14,7 @@ class IRowColumnsMarker(Interface):
1714

1815
@provider(IFormFieldProvider)
1916
class IRowColumns(model.Schema):
20-
"""
21-
"""
17+
""" """
2218

2319
columns = schema.Choice(
2420
title="Columns",
@@ -30,13 +26,13 @@ class IRowColumns(model.Schema):
3026

3127
@implementer(IRowColumns)
3228
@adapter(IRowColumnsMarker)
33-
class RowColumns(object):
29+
class RowColumns:
3430
def __init__(self, context):
3531
self.context = context
3632

3733
@property
3834
def columns(self):
39-
if safe_hasattr(self.context, 'columns'):
35+
if safe_hasattr(self.context, "columns"):
4036
return self.context.columns
4137
return None
4238

src/cs_dynamicpages/browser/configure.zcml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,6 @@
77

88

99

10-
<!-- Set overrides folder for Just-a-Bunch-Of-Templates product -->
11-
<include
12-
package="z3c.jbot"
13-
file="meta.zcml"
14-
/>
15-
<browser:jbot
16-
directory="overrides"
17-
layer="cs_dynamicpages.interfaces.IBrowserLayer"
18-
/>
19-
2010
<!-- Publish static files -->
2111
<plone:static
2212
directory="static"

src/cs_dynamicpages/configure.zcml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121

2222
<!-- -*- extra stuff goes here -*- -->
2323

24-
<include package=".vocabularies" />
24+
<include package=".vocabularies" />
2525

2626

27-
<include package=".vocabularies" />
27+
<include package=".vocabularies" />
2828

2929

3030
<include package=".controlpanels" />

0 commit comments

Comments
 (0)