Skip to content

Commit fba68c2

Browse files
authored
Make ci great again (#175)
1 parent 8c034dc commit fba68c2

File tree

14 files changed

+162
-89
lines changed

14 files changed

+162
-89
lines changed

.coveragerc

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
[run]
2+
relative_files = True
3+
14
[report]
25
include =
3-
src/design/*
6+
*/src/design/*
47
omit =
58
*/test*
69
*/upgrades/*

.github/workflows/black.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
2929
# install black
3030
- name: install black
31-
run: pip install black
31+
run: pip install black==21.12b0 click==8.0.4
3232

3333
# run black
3434
- name: run black

.github/workflows/flake8.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
strategy:
77
fail-fast: false
88
matrix:
9-
python-version: [3.11]
9+
python-version: [3.8]
1010

1111
steps:
1212
# git checkout
@@ -30,6 +30,6 @@ jobs:
3030
- name: install flake8
3131
run: pip install flake8
3232

33-
# run flake8
33+
# run black
3434
- name: run flake8
35-
run: flake8 src/ setup.py --ignore E203,W503
35+
run: flake8 src/ setup.py

.github/workflows/test.yml

-50
This file was deleted.

.github/workflows/tests.yml

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Tests
2+
on:
3+
push:
4+
branches: ["main", "v5.x"]
5+
pull_request:
6+
# Allow to run this workflow manually from the Actions tab
7+
workflow_dispatch:
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
fail-fast: true
13+
matrix:
14+
config:
15+
# [Python version, tox env]
16+
# - ["2.7", "py27-plone52"]
17+
# - ["3.7", "py37-plone52"]
18+
- ["3.8", "py38-plone60"]
19+
- ["3.9", "py39-plone60"]
20+
- ["3.10", "py310-plone60"]
21+
- ["3.11", "py311-plone60"]
22+
name: ${{ matrix.config[1] }}
23+
steps:
24+
- uses: actions/checkout@v3
25+
- name: Set up Python
26+
uses: actions/setup-python@v3
27+
with:
28+
python-version: ${{ matrix.config[0] }}
29+
- name: Pip cache
30+
uses: actions/cache@v3
31+
with:
32+
path: |
33+
~/.cache/pip
34+
eggs
35+
key: ${{ runner.os }}-pip-${{ matrix.config[0] }}-${{ hashFiles('setup.*', 'tox.ini') }}
36+
restore-keys: |
37+
${{ runner.os }}-pip-${{ matrix.config[0] }}-
38+
${{ runner.os }}-pip-
39+
- name: Install dependencies
40+
run: |
41+
python -m pip install --upgrade pip
42+
pip install tox
43+
- name: Test
44+
run: tox -e ${{ matrix.config[1] }}
45+
- name: Upload coverage data to coveralls.io
46+
run: |
47+
pip install coveralls
48+
coveralls --service=github
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
COVERALLS_FLAG_NAME: ${{ matrix.config[1] }}
52+
COVERALLS_PARALLEL: true
53+
54+
coveralls_finish:
55+
needs: build
56+
runs-on: ubuntu-latest
57+
steps:
58+
- name: Finished
59+
run: |
60+
pip install --upgrade coveralls
61+
coveralls --service=github --finish
62+
env:
63+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/toc.yml

-27
This file was deleted.

CHANGES.rst

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Changelog
2828
- Fix check_servizi view and made optional canale_fisico in Servizio
2929
[lucabel]
3030

31+
3132
6.0.6 (2023-04-28)
3233
------------------
3334

requirements-6.0.x.txt

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Keep these the same as in base.cfg please.
2+
pip==22.2.2
3+
setuptools==65.3.0
4+
zc.buildout>=3.0.0rc3
5+
wheel==0.37.1
6+
7+
# Windows specific down here (has to be installed here, fails in buildout)
8+
# Dependency of zope.sendmail:
9+
pywin32 ; platform_system == 'Windows'
10+
# SSL Certs on Windows, because Python is missing them otherwise:
11+
certifi ; platform_system == 'Windows'
12+
# Dependency of collective.recipe.omelette:
13+
ntfsutils ; platform_system == 'Windows' and python_version < '3.0'
14+

setup.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@
2626
"Environment :: Web Environment",
2727
"Framework :: Plone",
2828
"Framework :: Plone :: Addon",
29-
"Framework :: Plone :: 5.2",
29+
"Framework :: Plone :: 6.0",
3030
"Programming Language :: Python",
31-
"Programming Language :: Python :: 2.7",
32-
"Programming Language :: Python :: 3.6",
33-
"Programming Language :: Python :: 3.7",
31+
"Programming Language :: Python :: 3.8",
32+
"Programming Language :: Python :: 3.9",
33+
"Programming Language :: Python :: 3.10",
34+
"Programming Language :: Python :: 3.11",
3435
"Operating System :: OS Independent",
3536
"License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
3637
],
@@ -49,7 +50,7 @@
4950
package_dir={"": "src"},
5051
include_package_data=True,
5152
zip_safe=False,
52-
python_requires=">=3.7",
53+
python_requires=">=3.8",
5354
install_requires=[
5455
"setuptools",
5556
# -*- Extra requirements: -*-

src/design/plone/contenttypes/vocabularies/reference_vocabularies.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
# -*- coding: utf-8 -*-
22

33
from Products.CMFCore.utils import getToolByName
4-
from Products.CMFPlone.utils import safe_unicode
4+
5+
try:
6+
from plone.base.utils import safe_text
7+
except ImportError:
8+
from Products.CMFPlone.utils import safe_unicode as safe_text
59
from zope.interface import implementer
610
from zope.schema.interfaces import IVocabularyFactory
711
from zope.schema.vocabulary import SimpleTerm
@@ -25,7 +29,7 @@ def __call__(self, registry=None):
2529
brains = self.catalog(UID=values)
2630
terms = []
2731
for brain in brains:
28-
terms.append(SimpleTerm(brain.UID, brain.UID, safe_unicode(brain.Title)))
32+
terms.append(SimpleTerm(brain.UID, brain.UID, safe_text(brain.Title)))
2933
return SimpleVocabulary(terms)
3034

3135

test-5.2.x-py27.cfg

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[buildout]
2+
extends = test-5.2.x.cfg
3+
4+
[versions]
5+
# python 2
6+
bravado = 11.0.3
7+
bravado-core = 5.17.0
8+
typing-extensions = 3.10.0.2
9+
jsonref = 0.2
10+
webcolors = 1.10

test-5.2.x.cfg

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[buildout]
2+
extends =
3+
https://raw.githubusercontent.com/collective/buildout.plonetest/master/test-5.2.x.cfg
4+
https://raw.githubusercontent.com/collective/buildout.plonetest/master/qa.cfg
5+
base.cfg
6+
7+
[instance]
8+
eggs +=
9+
collective.dexteritytextindexer
10+
11+
[versions]
12+
collective.z3cform.datagridfield = 2.0
13+
# FIXME: se si rimuove il profilo di caching da qui (perchè c'è?), si può togliere anche questo pin
14+
# 3.0.0a14 e successive richiedono plone.base che è solo su plone 6
15+
plone.app.caching = 3.0.0a13

test-6.0.x.cfg

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[buildout]
2+
extends =
3+
https://raw.githubusercontent.com/collective/buildout.plonetest/master/test-6.0.x.cfg
4+
https://raw.githubusercontent.com/collective/buildout.plonetest/master/qa.cfg
5+
base.cfg
6+
7+
[versions]
8+
zc.buildout = >=3.0.0rc3
9+
pip = 22.2.2
10+
setuptools = 65.3.0
11+
collective.z3cform.datagridfield = >=3.0.0
12+
collective.contentrules.mailfromfield = >=1.1.0

tox.ini

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[tox]
2+
envlist =
3+
py{38,39,310,311}-plone60,
4+
skip_missing_interpreters = True
5+
6+
[coverage:run]
7+
relative_files = True
8+
9+
[testenv]
10+
skip_install = true
11+
extras =
12+
test
13+
commands_pre =
14+
{envbindir}/buildout -c {toxinidir}/{env:version_file} buildout:directory={envdir} buildout:develop={toxinidir} install test coverage
15+
commands =
16+
{envbindir}/coverage run {envbindir}/test
17+
{envbindir}/coverage html
18+
# TODO: increase coverage
19+
# {envbindir}/coverage report -m --fail-under=85
20+
{envbindir}/coverage report -m --fail-under=40
21+
{envbindir}/coverage json -i
22+
setenv =
23+
plone60: version_file=test-6.0.x.cfg
24+
deps =
25+
!plone60: -rrequirements.txt
26+
plone60: -rrequirements-6.0.x.txt
27+

0 commit comments

Comments
 (0)