Skip to content

Commit 650a728

Browse files
authored
Modernize package (#28)
* Modernize codebase according to the latest cookieplone templates. * Increate test coverage. * Test on Plone 6.2 * Update changelog * GHa: Update Python to version 3.13 * Fix typo in the description of an attribute of the behavior * Remove requirements.txt from repository * Restore images used in the readme file
1 parent ab9af47 commit 650a728

Some content is hidden

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

68 files changed

+1991
-971
lines changed

.editorconfig

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
# Generated from:
2-
# https://github.com/plone/meta/tree/master/config/default
3-
# See the inline comments on how to expand/tweak this configuration file
4-
#
1+
52
# EditorConfig Configuration file, for more details see:
6-
# http://EditorConfig.org
3+
# https://EditorConfig.org
74
# EditorConfig is a convention description, that could be interpreted
85
# by multiple editors to enforce common coding conventions for specific
96
# file types
@@ -22,33 +19,17 @@ trim_trailing_whitespace = true
2219
charset = utf-8
2320
# Indent style default
2421
indent_style = space
25-
# Max Line Length - a hard line wrap, should be disabled
26-
max_line_length = off
2722

2823
[*.{py,cfg,ini}]
2924
# 4 space indentation
3025
indent_size = 4
3126

32-
[*.{yml,zpt,pt,dtml,zcml}]
33-
# 2 space indentation
34-
indent_size = 2
35-
36-
[*.{json,jsonl,js,jsx,ts,tsx,css,less,scss,html}] # Frontend development
27+
[*.{html,dtml,pt,zpt,xml,zcml,js,json,ts,less,scss,css,sass,yml,yaml}]
3728
# 2 space indentation
3829
indent_size = 2
39-
max_line_length = 80
4030

4131
[{Makefile,.gitmodules}]
4232
# Tab indentation (no size specified, but view as 4 spaces)
4333
indent_style = tab
4434
indent_size = unset
4535
tab_width = unset
46-
47-
48-
##
49-
# Add extra configuration options in .meta.toml:
50-
# [editorconfig]
51-
# extra_lines = """
52-
# _your own configuration lines_
53-
# """
54-
##

.github/workflows/changelog.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Change log check
2+
on:
3+
pull_request:
4+
types: [assigned, opened, synchronize, reopened, labeled, unlabeled]
5+
branches:
6+
- main
7+
8+
env:
9+
python-version: 3.13
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v5
16+
with:
17+
# Fetch all history
18+
fetch-depth: '0'
19+
20+
- name: Setup uv
21+
uses: plone/meta/.github/actions/setup_uv@2.x
22+
with:
23+
python-version: ${{ env.python-version }}
24+
- name: Check for presence of a Change Log fragment (only pull requests)
25+
if: github.event_name == 'pull_request'
26+
run: |
27+
git fetch --no-tags origin ${{ github.base_ref }}
28+
uvx towncrier check --compare-with origin/${{ github.base_ref }} --config pyproject.toml --dir .

.github/workflows/config.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: 'Compute Config variables'
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
python-version:
7+
required: false
8+
type: string
9+
default: "3.13"
10+
plone-version:
11+
required: false
12+
type: string
13+
default: "6.1.4"
14+
outputs:
15+
backend:
16+
description: "Flag reporting if we should run the backend jobs"
17+
value: ${{ jobs.config.outputs.backend }}
18+
docs:
19+
description: "Flag reporting if we should run the docs jobs"
20+
value: ${{ jobs.config.outputs.docs }}
21+
base-tag:
22+
description: "Base tag to be used when creating container images"
23+
value: ${{ jobs.config.outputs.base-tag }}
24+
python-version:
25+
description: "Python version to be used"
26+
value: ${{ inputs.python-version }}
27+
plone-version:
28+
description: "Plone version to be used"
29+
value: ${{ inputs.plone-version }}
30+
31+
jobs:
32+
config:
33+
runs-on: ubuntu-latest
34+
outputs:
35+
backend: ${{ steps.filter.outputs.backend }}
36+
docs: ${{ steps.filter.outputs.docs }}
37+
base-tag: ${{ steps.vars.outputs.BASE_TAG }}
38+
plone-version: ${{ steps.vars.outputs.plone-version }}
39+
40+
steps:
41+
- name: Checkout
42+
uses: actions/checkout@v5
43+
44+
- name: Compute several vars needed for the CI
45+
id: vars
46+
run: |
47+
echo "base-tag=sha-$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
48+
echo "plone-version=${{ inputs.plone-version }}" >> $GITHUB_OUTPUT
49+
50+
- uses: dorny/paths-filter@v3.0.2
51+
id: filter
52+
with:
53+
filters: |
54+
backend:
55+
- '**'
56+
- '.github/workflows/config.yml'
57+
- '.github/workflows/main.yml'
58+
docs:
59+
- '.readthedocs.yaml'
60+
- 'docs/**'
61+
- '.github/workflows/docs.yaml'
62+
63+
- name: Test vars
64+
run: |
65+
echo "base-tag: ${{ steps.vars.outputs.base-tag }}"
66+
echo 'plone-version: ${{ steps.vars.outputs.plone-version }}'
67+
echo 'event-name: ${{ github.event_name }}'
68+
echo "ref-name: ${{ github.ref_name }}"
69+
echo 'Paths - backend: ${{ steps.filter.outputs.backend }}'
70+
echo 'Paths - docs: ${{ steps.filter.outputs.docs }}'

.github/workflows/main.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: kitconcept.seo CI
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
8+
config:
9+
name: "Compute configuration values"
10+
uses: ./.github/workflows/config.yml
11+
lint:
12+
name: "Lint codebase"
13+
uses: plone/meta/.github/workflows/backend-lint.yml@2.x
14+
needs:
15+
- config
16+
with:
17+
python-version: ${{ needs.config.outputs.python-version }}
18+
plone-version: ${{ needs.config.outputs.plone-version }}
19+
test:
20+
name: "Test codebase"
21+
uses: plone/meta/.github/workflows/backend-pytest.yml@2.x
22+
needs:
23+
- config
24+
strategy:
25+
matrix:
26+
python-version: ["3.13", "3.12", "3.11", "3.10"]
27+
plone-version: ["6.2-latest", "6.1-latest", "6.0-latest"]
28+
with:
29+
python-version: ${{ matrix.python-version }}
30+
plone-version: ${{ matrix.plone-version }}
31+
32+
coverage:
33+
name: "Backend: Coverage"
34+
uses: plone/meta/.github/workflows/backend-pytest-coverage.yml@2.x
35+
needs:
36+
- config
37+
- test
38+
with:
39+
python-version: ${{ needs.config.outputs.python-version }}
40+
plone-version: ${{ needs.config.outputs.plone-version }}
41+
42+
report:
43+
name: "Final report"
44+
if: ${{ always() }}
45+
runs-on: ubuntu-latest
46+
needs:
47+
- config
48+
- lint
49+
- test
50+
- coverage
51+
steps:
52+
- name: Report
53+
shell: bash
54+
run: |
55+
echo '# Workflow Report' >> $GITHUB_STEP_SUMMARY
56+
echo '| Job ID | Conclusion |' >> $GITHUB_STEP_SUMMARY
57+
echo '| --- | --- |' >> $GITHUB_STEP_SUMMARY
58+
echo '| Config | ${{ needs.config.result }} |' >> $GITHUB_STEP_SUMMARY
59+
echo '| Lint | ${{ needs.coverage.result }} |' >> $GITHUB_STEP_SUMMARY
60+
echo '| Test | ${{ needs.coverage.result }} |' >> $GITHUB_STEP_SUMMARY
61+
echo '| Coverage | ${{ needs.coverage.result }} |' >> $GITHUB_STEP_SUMMARY

.github/workflows/meta.yml

Lines changed: 0 additions & 65 deletions
This file was deleted.

.gitignore

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,45 @@
1-
# Generated from:
2-
# https://github.com/plone/meta/tree/master/config/default
3-
# See the inline comments on how to expand/tweak this configuration file
41
# python related
52
*.egg-info
63
*.pyc
74
*.pyo
85

96
# tools related
10-
build/
7+
__pycache__/
118
.coverage
9+
.mypy_cache
10+
.pytest_cache
11+
.ruff_cache
12+
/build/
1213
coverage.xml
1314
dist/
1415
docs/_build
15-
__pycache__/
16-
.tox
17-
.vscode/
1816
node_modules/
1917

2018
# venv / buildout related
19+
.eggs/
20+
.installed.cfg
21+
.mr.developer.cfg
22+
.venv/
2123
bin/
2224
develop-eggs/
2325
eggs/
24-
.eggs/
2526
etc/
26-
.installed.cfg
2727
include/
2828
lib/
2929
lib64
30-
.mr.developer.cfg
3130
parts/
3231
pyvenv.cfg
3332
var/
3433

3534
# mxdev
36-
/instance/
35+
.installed.txt
36+
.lock
37+
/.mxdev_cache/
3738
/.make-sentinels/
3839
/*-mxdev.txt
40+
/instance/
3941
/reports/
4042
/sources/
4143
/venv/
42-
.installed.txt
43-
*.mo
44-
45-
# pipforester
46-
forest.dot
47-
forest.json
48-
49-
##
50-
# Add extra configuration options in .meta.toml:
51-
# [gitignore]
52-
# extra_lines = """
53-
# _your own configuration lines_
54-
# """
55-
##
44+
constraints*.txt
45+
requirements*.txt

.meta.toml

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)