Skip to content

Commit fa58628

Browse files
committed
configure with plone/meta 2.x
1 parent 408838a commit fa58628

File tree

6 files changed

+129
-81
lines changed

6 files changed

+129
-81
lines changed
File renamed without changes.

.github/workflows/meta.yml

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,21 @@ on:
2525

2626
jobs:
2727
qa:
28-
uses: plone/meta/.github/workflows/qa.yml@main
29-
test:
30-
uses: plone/meta/.github/workflows/test.yml@main
31-
with:
32-
33-
py-versions: '["3.12", "3.10"]'
28+
uses: plone/meta/.github/workflows/[email protected]
3429
coverage:
35-
uses: plone/meta/.github/workflows/coverage.yml@main
30+
uses: plone/meta/.github/workflows/[email protected]
31+
dependencies:
32+
uses: plone/meta/.github/workflows/[email protected]
3633
release_ready:
37-
uses: plone/meta/.github/workflows/release_ready.yml@main
34+
uses: plone/meta/.github/workflows/[email protected]
35+
circular:
36+
uses: plone/meta/.github/workflows/[email protected]
3837

3938
##
4039
# To modify the list of default jobs being created add in .meta.toml:
4140
# [github]
4241
# jobs = [
4342
# "qa",
44-
# "test",
4543
# "coverage",
4644
# "dependencies",
4745
# "release_ready",
@@ -56,13 +54,6 @@ jobs:
5654
# os_dependencies = "git libxml2 libxslt"
5755
##
5856

59-
##
60-
# To test against a specific matrix of python versions
61-
# when running tests jobs, add in .meta.toml:
62-
# [github]
63-
# py_versions = "['3.12', '3.11']"
64-
##
65-
6657

6758
##
6859
# Specify additional jobs in .meta.toml:

.github/workflows/test-matrix.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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.1 on py3.10", "py310-plone61"]
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@v4
30+
with:
31+
persist-credentials: false
32+
- name: Set up Python
33+
uses: actions/setup-python@v5
34+
with:
35+
python-version: ${{ matrix.config[0] }}
36+
allow-prereleases: true
37+
- name: Pip cache
38+
uses: actions/cache@v4
39+
with:
40+
path: ~/.cache/pip
41+
key: ${{ runner.os }}-pip-${{ matrix.config[0] }}-${{ hashFiles('setup.*', 'tox.ini') }}
42+
restore-keys: |
43+
${{ runner.os }}-pip-${{ matrix.config[0] }}-
44+
${{ runner.os }}-pip-
45+
- name: Install dependencies
46+
run: |
47+
python -m pip install --upgrade pip
48+
pip install tox
49+
- name: Test
50+
run: tox -e ${{ matrix.config[2] }}

.meta.toml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,10 @@
33
# See the inline comments on how to expand/tweak this configuration file
44
[meta]
55
template = "default"
6-
commit-id = "50e16ae1"
6+
commit-id = "2.0.1.dev0"
77

88
[pyproject]
99
codespell_skip = "*.min.js,*.min.js.map,*.svg,yarn.lock,*.json,*/icons_country_flags.xml"
1010

1111
[tox]
12-
constraints_file = "https://dist.plone.org/release/6.1-latest/constraints.txt"
13-
14-
[github]
15-
py_versions = "[\"3.12\", \"3.10\"]"
16-
jobs = [
17-
"qa",
18-
"test",
19-
"coverage",
20-
"release_ready",
21-
]
12+
test_matrix = {"6.2" = ["3.13"], "6.1" = ["3.10"]}

pyproject.toml

Lines changed: 1 addition & 1 deletion
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,<77", "wheel"]
66

77
[tool.towncrier]
88
directory = "news/"

tox.ini

Lines changed: 69 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,18 @@ min_version = 4.4.0
77
envlist =
88
lint
99
test
10+
py313-plone62
11+
py310-plone61
1012
dependencies
1113

1214

1315
##
1416
# Add extra configuration options in .meta.toml:
17+
# - to specify a custom testing combination of Plone and python versions, use `test_matrix`
18+
# - to specify extra custom environments, use `envlist_lines`
19+
# - to specify extra `tox` top-level options, use `config_lines`
1520
# [tox]
21+
# test_matrix = {"6.2" = ["3.13", "3.12"], "6.1" = ["3.10", "3.9"]}
1622
# envlist_lines = """
1723
# my_other_environment
1824
# """
@@ -21,32 +27,14 @@ envlist =
2127
# """
2228
##
2329

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-
4330
[testenv:init]
4431
description = Prepare environment
4532
skip_install = true
33+
allowlist_externals =
34+
echo
4635
commands =
4736
echo "Initial setup complete"
4837

49-
5038
[testenv:format]
5139
description = automatically reformat code
5240
skip_install = true
@@ -87,8 +75,19 @@ deps =
8775
commands =
8876
sh -c 'pipdeptree --exclude setuptools,wheel,pipdeptree,zope.interface,zope.component --graph-output svg > dependencies.svg'
8977

90-
[testenv:test]
91-
description = run the distribution tests
78+
79+
[test_runner]
80+
deps = zope.testrunner
81+
test =
82+
zope-testrunner --all --test-path={toxinidir}/src -s plone.staticresources {posargs}
83+
coverage =
84+
coverage run --branch --source plone.staticresources {envbindir}/zope-testrunner --quiet --all --test-path={toxinidir}/src -s plone.staticresources {posargs}
85+
coverage report -m --format markdown
86+
coverage xml
87+
coverage html
88+
89+
[base]
90+
description = shared configuration for tests and coverage
9291
use_develop = true
9392
skip_install = false
9493
constrain_package_deps = true
@@ -104,62 +103,79 @@ set_env =
104103
#
105104
# Set constrain_package_deps .meta.toml:
106105
# [tox]
107-
# constrain_package_deps = "false"
106+
# constrain_package_deps = false
108107
##
109108
deps =
110-
zope.testrunner
111-
-c https://dist.plone.org/release/6.1-latest/constraints.txt
109+
{[test_runner]deps}
110+
plone62: -c https://dist.plone.org/release/6.2-dev/constraints.txt
111+
plone61: -c https://dist.plone.org/release/6.1-dev/constraints.txt
112112

113113
##
114114
# Specify additional deps in .meta.toml:
115115
# [tox]
116-
# test_deps_additional = "-esources/plonegovbr.portal_base[test]"
116+
# test_deps_additional = """
117+
# -esources/plonegovbr.portal_base[test]
118+
# """
117119
#
118120
# Specify a custom constraints file in .meta.toml:
119121
# [tox]
120122
# constraints_file = "https://my-server.com/constraints.txt"
121123
##
122-
commands =
123-
zope-testrunner --all --test-path={toxinidir}/src -s plone.staticresources {posargs}
124124
extras =
125125
test
126126

127+
127128
##
128129
# Add extra configuration options in .meta.toml:
129130
# [tox]
130131
# test_extras = """
131132
# tests
132133
# widgets
133134
# """
135+
#
136+
# Add extra configuration options in .meta.toml:
137+
# [tox]
138+
# testenv_options = """
139+
# basepython = /usr/bin/python3.8
140+
# """
134141
##
135142

143+
[testenv:test]
144+
description = run the distribution tests
145+
use_develop = {[base]use_develop}
146+
skip_install = {[base]skip_install}
147+
constrain_package_deps = {[base]constrain_package_deps}
148+
set_env = {[base]set_env}
149+
deps =
150+
{[test_runner]deps}
151+
-c https://dist.plone.org/release/6.2-dev/constraints.txt
152+
commands = {[test_runner]test}
153+
extras = {[base]extras}
154+
155+
156+
[testenv]
157+
description = run the distribution tests (generative environments)
158+
use_develop = {[base]use_develop}
159+
skip_install = {[base]skip_install}
160+
constrain_package_deps = {[base]constrain_package_deps}
161+
set_env = {[base]set_env}
162+
deps = {[base]deps}
163+
commands = {[test_runner]test}
164+
extras = {[base]extras}
165+
166+
136167
[testenv:coverage]
137168
description = get a test coverage report
138-
use_develop = true
139-
skip_install = false
140-
constrain_package_deps = true
141-
set_env =
142-
ROBOT_BROWSER=headlesschrome
143-
144-
##
145-
# Specify extra test environment variables in .meta.toml:
146-
# [tox]
147-
# test_environment_variables = """
148-
# PIP_EXTRA_INDEX_URL=https://my-pypi.my-server.com/
149-
# """
150-
##
169+
use_develop = {[base]use_develop}
170+
skip_install = {[base]skip_install}
171+
constrain_package_deps = {[base]constrain_package_deps}
172+
set_env = {[base]set_env}
151173
deps =
174+
{[test_runner]deps}
152175
coverage
153-
zope.testrunner
154-
-c https://dist.plone.org/release/6.1-latest/constraints.txt
155-
156-
commands =
157-
coverage run --branch --source plone.staticresources {envbindir}/zope-testrunner --quiet --all --test-path={toxinidir}/src -s plone.staticresources {posargs}
158-
coverage report -m --format markdown
159-
coverage xml
160-
coverage html
161-
extras =
162-
test
176+
-c https://dist.plone.org/release/6.2-dev/constraints.txt
177+
commands = {[test_runner]coverage}
178+
extras = {[base]extras}
163179

164180

165181
[testenv:release-check]
@@ -169,7 +185,7 @@ deps =
169185
twine
170186
build
171187
towncrier
172-
-c https://dist.plone.org/release/6.1-latest/constraints.txt
188+
-c https://dist.plone.org/release/6.2-dev/constraints.txt
173189

174190
commands =
175191
# fake version to not have to install the package
@@ -200,7 +216,7 @@ allowlist_externals =
200216
deps =
201217
pipdeptree
202218
pipforester
203-
-c https://dist.plone.org/release/6.1-latest/constraints.txt
219+
-c https://dist.plone.org/release/6.2-dev/constraints.txt
204220

205221
commands =
206222
# Generate the full dependency tree

0 commit comments

Comments
 (0)