Skip to content

Commit 68e4eb2

Browse files
committed
Configuring with plone.meta
1 parent 82c0080 commit 68e4eb2

File tree

6 files changed

+155
-70
lines changed

6 files changed

+155
-70
lines changed
File renamed without changes.

.github/workflows/meta.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,17 @@ on:
2525

2626
jobs:
2727
qa:
28-
uses: plone/meta/.github/workflows/qa.yml@main
28+
uses: plone/meta/.github/workflows/qa.yml@2.x
2929
dependencies:
30-
uses: plone/meta/.github/workflows/dependencies.yml@main
30+
uses: plone/meta/.github/workflows/dependencies.yml@2.x
3131
release_ready:
32-
uses: plone/meta/.github/workflows/release_ready.yml@main
32+
uses: plone/meta/.github/workflows/release_ready.yml@2.x
3333

3434
##
3535
# To modify the list of default jobs being created add in .meta.toml:
3636
# [github]
3737
# jobs = [
3838
# "qa",
39-
# "test",
4039
# "coverage",
4140
# "dependencies",
4241
# "release_ready",
@@ -51,13 +50,6 @@ jobs:
5150
# os_dependencies = "git libxml2 libxslt"
5251
##
5352

54-
##
55-
# To test against a specific matrix of python versions
56-
# when running tests jobs, add in .meta.toml:
57-
# [github]
58-
# py_versions = "['3.12', '3.11']"
59-
##
60-
6153

6254
##
6355
# Specify additional jobs in .meta.toml:

.github/workflows/test-matrix.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Generated from:
2+
# https://github.com/plone/meta/tree/main/src/plone/meta/default
3+
# See the inline comments on how to expand/tweak this configuration file
4+
name: Tests
5+
6+
on:
7+
push:
8+
9+
jobs:
10+
build:
11+
permissions:
12+
contents: read
13+
pull-requests: write
14+
strategy:
15+
# We want to see all failures:
16+
fail-fast: false
17+
matrix:
18+
os:
19+
- ["ubuntu", "ubuntu-latest"]
20+
config:
21+
# [Python version, visual name, tox env]
22+
- ["3.13", "6.2 on py3.13", "py313-plone62"]
23+
- ["3.10", "6.2 on py3.10", "py310-plone62"]
24+
25+
runs-on: ${{ matrix.os[1] }}
26+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
27+
name: ${{ matrix.config[1] }}
28+
steps:
29+
- uses: actions/checkout@v5
30+
with:
31+
persist-credentials: false
32+
- name: Set up Python
33+
uses: actions/setup-python@v6
34+
with:
35+
python-version: ${{ matrix.config[0] }}
36+
allow-prereleases: true
37+
38+
##
39+
# Add extra configuration options in .meta.toml:
40+
# [github]
41+
# extra_lines_after_os_dependencies = """
42+
# _your own configuration lines_
43+
# """
44+
##
45+
- name: Pip cache
46+
uses: actions/cache@v4
47+
with:
48+
path: ~/.cache/pip
49+
key: ${{ runner.os }}-pip-${{ matrix.config[0] }}-${{ hashFiles('setup.*', 'tox.ini') }}
50+
restore-keys: |
51+
${{ runner.os }}-pip-${{ matrix.config[0] }}-
52+
${{ runner.os }}-pip-
53+
- name: Install dependencies
54+
run: |
55+
python -m pip install --upgrade pip
56+
pip install tox
57+
- name: Initialize tox
58+
# the bash one-liner below does not work on Windows
59+
if: contains(matrix.os, 'ubuntu')
60+
run: |
61+
if [ `tox list --no-desc -f init|wc -l` = 1 ]; then tox -e init;else true; fi
62+
- name: Test
63+
run: tox -e ${{ matrix.config[2] }}
64+
65+
66+
##
67+
# Add extra configuration options in .meta.toml:
68+
# [github]
69+
# extra_lines = """
70+
# _your own configuration lines_
71+
# """
72+
##

.meta.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
# See the inline comments on how to expand/tweak this configuration file
44
[meta]
55
template = "default"
6-
commit-id = "dcdc915a"
6+
commit-id = "2.2.2"
7+
8+
[tox]
9+
test_matrix = {"6.2" = ["*"]}
710

811
[flake8]
912
extra_lines = """

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# https://github.com/plone/meta/tree/main/src/plone/meta/default
33
# See the inline comments on how to expand/tweak this configuration file
44
[build-system]
5-
requires = ["setuptools>=68.2"]
5+
requires = ["setuptools>=68.2,<80", "wheel"]
66

77
[tool.towncrier]
88
directory = "news/"
@@ -37,7 +37,7 @@ showcontent = true
3737

3838
[[tool.towncrier.type]]
3939
directory = "tests"
40-
name = "Tests"
40+
name = "Tests:"
4141
showcontent = true
4242

4343
##

tox.ini

Lines changed: 74 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,21 @@ min_version = 4.4.0
77
envlist =
88
lint
99
test
10+
py313-plone62
11+
py312-plone62
12+
py311-plone62
13+
py310-plone62
1014
dependencies
1115

1216

1317
##
1418
# Add extra configuration options in .meta.toml:
19+
# - to specify a custom testing combination of Plone and python versions, use `test_matrix`
20+
# Use ["*"] to use all supported Python versions for this Plone version.
21+
# - to specify extra custom environments, use `envlist_lines`
22+
# - to specify extra `tox` top-level options, use `config_lines`
1523
# [tox]
24+
# test_matrix = {"6.2" = ["3.13", "3.12"], "6.1" = ["*"]}
1625
# envlist_lines = """
1726
# my_other_environment
1827
# """
@@ -21,32 +30,14 @@ envlist =
2130
# """
2231
##
2332

24-
[testenv]
25-
skip_install = true
26-
allowlist_externals =
27-
echo
28-
false
29-
# Make sure typos like `tox -e formaat` are caught instead of silently doing nothing.
30-
# See https://github.com/tox-dev/tox/issues/2858.
31-
commands =
32-
echo "Unrecognized environment name {envname}"
33-
false
34-
35-
##
36-
# Add extra configuration options in .meta.toml:
37-
# [tox]
38-
# testenv_options = """
39-
# basepython = /usr/bin/python3.8
40-
# """
41-
##
42-
4333
[testenv:init]
4434
description = Prepare environment
4535
skip_install = true
36+
allowlist_externals =
37+
echo
4638
commands =
4739
echo "Initial setup complete"
4840

49-
5041
[testenv:format]
5142
description = automatically reformat code
5243
skip_install = true
@@ -87,8 +78,21 @@ deps =
8778
commands =
8879
sh -c 'pipdeptree --exclude setuptools,wheel,pipdeptree,zope.interface,zope.component --graph-output svg > dependencies.svg'
8980

90-
[testenv:test]
91-
description = run the distribution tests
81+
82+
[test_runner]
83+
deps = zope.testrunner
84+
test =
85+
rfbrowser init
86+
zope-testrunner --all --test-path={toxinidir}/src -s plone.app.robotframework {posargs}
87+
coverage =
88+
rfbrowser init
89+
coverage run --branch --source plone.app.robotframework {envbindir}/zope-testrunner --quiet --all --test-path={toxinidir}/src -s plone.app.robotframework {posargs}
90+
coverage report -m --format markdown
91+
coverage xml
92+
coverage html
93+
94+
[base]
95+
description = shared configuration for tests and coverage
9296
use_develop = true
9397
skip_install = false
9498
constrain_package_deps = true
@@ -104,64 +108,80 @@ set_env =
104108
#
105109
# Set constrain_package_deps .meta.toml:
106110
# [tox]
107-
# constrain_package_deps = "false"
111+
# constrain_package_deps = false
108112
##
109113
deps =
110-
zope.testrunner
111-
-c https://dist.plone.org/release/6.0-dev/constraints.txt
114+
{[test_runner]deps}
115+
plone62: -c https://dist.plone.org/release/6.2-dev/constraints.txt
112116

113117
##
114118
# Specify additional deps in .meta.toml:
115119
# [tox]
116-
# test_deps_additional = "-esources/plonegovbr.portal_base[test]"
120+
# test_deps_additional = """
121+
# -esources/plonegovbr.portal_base[test]
122+
# """
117123
#
118124
# Specify a custom constraints file in .meta.toml:
119125
# [tox]
120126
# constraints_file = "https://my-server.com/constraints.txt"
121127
##
122-
commands =
123-
rfbrowser init
124-
zope-testrunner --all --test-path={toxinidir}/src -s plone.app.robotframework {posargs}
125128
extras =
126129
test
127130

131+
128132
##
129133
# Add extra configuration options in .meta.toml:
130134
# [tox]
131135
# test_extras = """
132136
# tests
133137
# widgets
134138
# """
139+
#
140+
# Add extra configuration options in .meta.toml:
141+
# [tox]
142+
# testenv_options = """
143+
# basepython = /usr/bin/python3.8
144+
# """
135145
##
136146

147+
[testenv:test]
148+
description = run the distribution tests
149+
use_develop = {[base]use_develop}
150+
skip_install = {[base]skip_install}
151+
constrain_package_deps = {[base]constrain_package_deps}
152+
set_env = {[base]set_env}
153+
deps =
154+
{[test_runner]deps}
155+
-c https://dist.plone.org/release/6.2-dev/constraints.txt
156+
157+
commands = {[test_runner]test}
158+
extras = {[base]extras}
159+
160+
161+
[testenv]
162+
description = run the distribution tests (generative environments)
163+
use_develop = {[base]use_develop}
164+
skip_install = {[base]skip_install}
165+
constrain_package_deps = {[base]constrain_package_deps}
166+
set_env = {[base]set_env}
167+
deps = {[base]deps}
168+
commands = {[test_runner]test}
169+
extras = {[base]extras}
170+
171+
137172
[testenv:coverage]
138173
description = get a test coverage report
139-
use_develop = true
140-
skip_install = false
141-
constrain_package_deps = true
142-
set_env =
143-
ROBOT_BROWSER=headlesschrome
144-
145-
##
146-
# Specify extra test environment variables in .meta.toml:
147-
# [tox]
148-
# test_environment_variables = """
149-
# PIP_EXTRA_INDEX_URL=https://my-pypi.my-server.com/
150-
# """
151-
##
174+
use_develop = {[base]use_develop}
175+
skip_install = {[base]skip_install}
176+
constrain_package_deps = {[base]constrain_package_deps}
177+
set_env = {[base]set_env}
152178
deps =
179+
{[test_runner]deps}
153180
coverage
154-
zope.testrunner
155-
-c https://dist.plone.org/release/6.0-dev/constraints.txt
181+
-c https://dist.plone.org/release/6.2-dev/constraints.txt
156182

157-
commands =
158-
rfbrowser init
159-
coverage run --branch --source plone.app.robotframework {envbindir}/zope-testrunner --quiet --all --test-path={toxinidir}/src -s plone.app.robotframework {posargs}
160-
coverage report -m --format markdown
161-
coverage xml
162-
coverage html
163-
extras =
164-
test
183+
commands = {[test_runner]coverage}
184+
extras = {[base]extras}
165185

166186

167187
[testenv:release-check]
@@ -171,8 +191,7 @@ deps =
171191
twine
172192
build
173193
towncrier
174-
-c https://dist.plone.org/release/6.0-dev/constraints.txt
175-
194+
-c https://dist.plone.org/release/6.2-dev/constraints.txt
176195
commands =
177196
# fake version to not have to install the package
178197
# we build the change log as news entries might break
@@ -202,8 +221,7 @@ allowlist_externals =
202221
deps =
203222
pipdeptree
204223
pipforester
205-
-c https://dist.plone.org/release/6.0-dev/constraints.txt
206-
224+
-c https://dist.plone.org/release/6.2-dev/constraints.txt
207225
commands =
208226
# Generate the full dependency tree
209227
sh -c 'pipdeptree -j > forest.json'

0 commit comments

Comments
 (0)