Skip to content

Commit c0b91a0

Browse files
committed
Added plone 6.1 gha
1 parent 71297e1 commit c0b91a0

13 files changed

+127
-87
lines changed

.github/workflows/main.yml

+12-26
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010

1111
jobs:
1212
test:
13-
runs-on: ubuntu-20.04
13+
runs-on: ubuntu-24.04
1414
strategy:
1515
fail-fast: false
1616
matrix:
@@ -21,28 +21,23 @@ jobs:
2121
plone: 5.2
2222
- python: 3.10.11
2323
plone: "6.0"
24+
- python: 3.12.7
25+
plone: "6.1"
2426
steps:
2527
- name: Checkout
26-
uses: actions/checkout@v3
28+
uses: actions/checkout@v4
2729
- name: Set up pyenv and Python
28-
uses: "gabrielfalcao/pyenv-action@v14"
30+
uses: "gabrielfalcao/pyenv-action@v18"
2931
with:
3032
default: "${{ matrix.python }}"
3133
- name: Setup Env
3234
run: |
3335
sudo apt-get update -qqy
34-
sudo apt-get install -qqy g++ libpng-dev cmake libqt5widgets5 qttools5-dev
35-
wget -t 3 -T 60 --waitretry 5 -O zint-2.8.0.tar.gz https://sourceforge.net/projects/zint/files/zint/2.8.0/zint-2.8.0.tar.gz/download
36-
tar -xf zint-2.8.0.tar.gz
37-
cd zint-2.8.0
38-
sudo cmake .
39-
sudo make
40-
sudo make install
41-
cd ..
36+
sudo apt-get install -qqy g++ libpng-dev cmake libqt5widgets5 qttools5-dev zint
4237
pip install --upgrade pip
4338
pip install -r requirements-${{ matrix.plone }}.txt
4439
- name: Cache eggs
45-
uses: actions/cache@v3
40+
uses: actions/cache@v4
4641
env:
4742
cache-name: cache-eggs
4843
with:
@@ -70,7 +65,7 @@ jobs:
7065
run: |
7166
bin/test -t !robot
7267
coverage:
73-
runs-on: ubuntu-20.04
68+
runs-on: ubuntu-24.04
7469
strategy:
7570
fail-fast: false
7671
matrix:
@@ -79,29 +74,20 @@ jobs:
7974
plone: "4.3"
8075
steps:
8176
- name: Checkout
82-
uses: actions/checkout@v3
77+
uses: actions/checkout@v4
8378
- name: Set up pyenv and Python
84-
uses: "gabrielfalcao/pyenv-action@v14"
79+
uses: "gabrielfalcao/pyenv-action@v18"
8580
with:
8681
default: "${{ matrix.python }}"
8782
- name: Setup Env
8883
run: |
8984
sudo apt-get update -qqy
90-
sudo apt-get install -qqy g++ libpng-dev cmake libqt5widgets5 qttools5-dev
91-
wget -t 3 -T 60 --waitretry 5 -O zint-2.8.0.tar.gz https://sourceforge.net/projects/zint/files/zint/2.8.0/zint-2.8.0.tar.gz/download
92-
tar -xf zint-2.8.0.tar.gz
93-
cd zint-2.8.0
94-
sudo cmake .
95-
sudo make
96-
sudo make install
97-
cd ..
85+
sudo apt-get install -qqy g++ libpng-dev cmake libqt5widgets5 qttools5-dev zint
9886
pip install --upgrade pip
9987
pip install -r requirements-${{ matrix.plone }}.txt
100-
pip install --upgrade pip
101-
pip install -r requirements-${{matrix.plone}}.txt
10288
pip install -U coveralls coverage
10389
- name: Cache eggs
104-
uses: actions/cache@v3
90+
uses: actions/cache@v4
10591
env:
10692
cache-name: cache-eggs
10793
with:

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
.settings/
1111
bin/
1212
buildout-cache/
13+
CACHEDIR.TAG
1314
checkversion*.html
1415
develop-eggs/
1516
htmlcov/

CHANGES.rst

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ Changelog
1515
- Fixed `content.base_getattr` that was not returning the `default` if attribute
1616
not existing.
1717
[gbastien]
18+
- Added Plone 6.1 version in buildout.
19+
[chris-adam]
1820

1921
0.80 (2023-12-11)
2022
-----------------

Makefile

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/usr/bin/make
2-
# pyenv is a requirement, with 2.7, 3.7 and 3.10 python versions, and virtualenv installed in each version
2+
# pyenv is a requirement, with 2.7, 3.7, 3.10 and 3.12 python versions, and virtualenv installed in each version
33
# plone parameter must be passed to create environment 'make setup plone=6.0' or after a make cleanall
44
# The original Makefile can be found on https://github.com/IMIO/scripts-buildout
55

66
SHELL=/bin/bash
7-
plones=4.3 5.2 6.0
7+
plones=4.3 5.2 6.0 6.1
88
b_o=
99
old_plone=$(shell [ -e .plone-version ] && cat .plone-version)
1010

@@ -15,10 +15,13 @@ endif
1515
ifndef plone
1616
ifeq (,$(filter setup,$(MAKECMDGOALS)))
1717
plone=$(old_plone)
18-
b_o=-N
1918
endif
2019
endif
2120

21+
ifneq ($(wildcard bin/instance),)
22+
b_o=-N
23+
endif
24+
2225
ifndef python
2326
ifeq ($(plone),4.3)
2427
python=2.7
@@ -29,6 +32,9 @@ endif
2932
ifeq ($(plone),6.0)
3033
python=3.10
3134
endif
35+
ifeq ($(plone),6.1)
36+
python=3.12
37+
endif
3238
endif
3339

3440
all: buildout

requirements-6.1.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
-c https://dist.plone.org/release/6.1-latest/requirements.txt
2+
setuptools
3+
zc.buildout

setup.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,15 @@
2121
"Framework :: Plone :: 4.3",
2222
"Framework :: Plone :: 5.2",
2323
"Framework :: Plone :: 6.0",
24+
"Framework :: Plone :: 6.1",
2425
"License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
2526
"Operating System :: OS Independent",
2627
"Programming Language :: Python",
2728
"Programming Language :: Python :: 2.7",
2829
"Programming Language :: Python :: 3.7",
2930
"Programming Language :: Python :: 3.8",
3031
"Programming Language :: Python :: 3.10",
32+
"Programming Language :: Python :: 3.12",
3133
],
3234
keywords='plone helpers utils dev imio',
3335
author='Simon Delcourt',
@@ -45,7 +47,7 @@
4547
'collective.monkeypatcher',
4648
'future>=0.18.2',
4749
'imio.pyutils>=1.0.0a0',
48-
'natsort<7',
50+
'natsort',
4951
"pathlib2;python_version<'3'",
5052
'plone.api>1.9.1',
5153
'plone.app.intid',

src/imio/helpers/tests/test_appy_pod.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ def test_load_appy_pod_sample_archetypes(self):
1919
# does not break if called on an unexisting field or
2020
# not RichText field, just do nothing and display a portal_message
2121
view(field_name='title')
22-
self.assertEquals(doc.Title(), 'Original title')
22+
self.assertEqual(doc.Title(), 'Original title')
2323
view(field_name='unexisting_field_name')
2424
# call it on a real RichText field_name
25-
self.assertEquals(doc.getText(), '')
25+
self.assertEqual(doc.getText(), '')
2626
view(field_name='text')
2727
self.assertNotEquals(doc.getText(), '')
2828

@@ -36,9 +36,9 @@ def test_load_appy_pod_sample_dexterity(self):
3636
# does not break if called on an unexisting field or
3737
# not RichText field, just do nothing and display a portal_message
3838
view(field_name='title')
39-
self.assertEquals(doc.Title(), 'Original title')
39+
self.assertEqual(doc.Title(), 'Original title')
4040
view(field_name='unexisting_field_name')
4141
# call it on a real RichText field_name
42-
self.assertEquals(doc.text, None)
42+
self.assertEqual(doc.text, None)
4343
view(field_name='text')
4444
self.assertTrue(isinstance(doc.text, RichTextValue))

src/imio/helpers/tests/test_barcode.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@
33
from imio.helpers import barcode
44

55
import os
6+
import six
67
import unittest
78

89

910
class TestBarcode(unittest.TestCase):
1011

1112
def test_generate_barcode(self):
1213
current_dir = os.path.dirname(os.path.abspath(__file__))
13-
barcode_resource = "barcode_python2_zint_60x60_278bytes.png"
14+
if six.PY3:
15+
barcode_resource = "barcode_python3_zint_60x60_156bytes.png"
16+
else:
17+
barcode_resource = "barcode_python2_zint_60x60_278bytes.png"
1418
with open(os.path.join(current_dir, barcode_resource), 'rb') as barcode_file:
1519
bc = barcode_file.read()
1620
result = barcode.generate_barcode('123')

src/imio/helpers/tests/test_cache.py

+18-18
Original file line numberDiff line numberDiff line change
@@ -93,69 +93,69 @@ def test_cleanVocabularyCacheFor(self):
9393
# once get, it is cached
9494
vocab(self.portal)
9595
self.assertTrue(getattr(vocab, memPropName))
96-
self.assertEquals([term.token for term in vocab(self.portal)._terms],
96+
self.assertEqual([term.token for term in vocab(self.portal)._terms],
9797
['1', '2'])
9898

9999
# change value but do not clean cache
100100
self.request.set('vocab_values', ('1', '2', '3'))
101-
self.assertEquals([term.token for term in vocab(self.portal)._terms],
101+
self.assertEqual([term.token for term in vocab(self.portal)._terms],
102102
['1', '2'])
103103
# clean vocabulary cache
104104
cleanVocabularyCacheFor("imio.helpers.testing.testingvocabulary")
105-
self.assertEquals([term.token for term in vocab(self.portal)._terms],
105+
self.assertEqual([term.token for term in vocab(self.portal)._terms],
106106
['1', '2', '3'])
107107

108108
# every existing vocabularies can also be cleaned if nothing passed to cleanVocabularyCacheFor
109109
self.request.set('vocab_values', ('1', '2', '3', '4'))
110-
self.assertEquals([term.token for term in vocab(self.portal)._terms],
110+
self.assertEqual([term.token for term in vocab(self.portal)._terms],
111111
['1', '2', '3'])
112112
# clean vocabulary cache
113113
cleanVocabularyCacheFor("imio.helpers.testing.testingvocabulary")
114-
self.assertEquals([term.token for term in vocab(self.portal)._terms],
114+
self.assertEqual([term.token for term in vocab(self.portal)._terms],
115115
['1', '2', '3', '4'])
116116

117117
# if cleanVocabularyCacheFor is called without parameter,
118118
# every registered vocabularies cache is cleaned
119119
self.request.set('vocab_values', ('1', '2', '3', '4', '5'))
120-
self.assertEquals([term.token for term in vocab(self.portal)._terms],
120+
self.assertEqual([term.token for term in vocab(self.portal)._terms],
121121
['1', '2', '3', '4'])
122122
cleanVocabularyCacheFor()
123-
self.assertEquals([term.token for term in vocab(self.portal)._terms],
123+
self.assertEqual([term.token for term in vocab(self.portal)._terms],
124124
['1', '2', '3', '4', '5'])
125125

126126
def test_cleanRamCache(self):
127127
"""
128128
This helper method invalidates all ram.cache.
129129
"""
130130
self.request.set('ramcached', 'a')
131-
self.assertEquals(ramCachedMethod(self.portal, param='1'), 'a')
131+
self.assertEqual(ramCachedMethod(self.portal, param='1'), 'a')
132132
# change value in REQUEST, as it is ram cached, it will still return 'a'
133133
self.request.set('ramcached', 'b')
134-
self.assertEquals(ramCachedMethod(self.portal, param='1'), 'a')
134+
self.assertEqual(ramCachedMethod(self.portal, param='1'), 'a')
135135
# ram.cache works as expected if param changes
136-
self.assertEquals(ramCachedMethod(self.portal, param='2'), 'b')
136+
self.assertEqual(ramCachedMethod(self.portal, param='2'), 'b')
137137
# try again
138-
self.assertEquals(ramCachedMethod(self.portal, param='1'), 'a')
138+
self.assertEqual(ramCachedMethod(self.portal, param='1'), 'a')
139139
# now clean all caches, it will returns 'b'
140140
cleanRamCache()
141-
self.assertEquals(ramCachedMethod(self.portal, param='1'), 'b')
141+
self.assertEqual(ramCachedMethod(self.portal, param='1'), 'b')
142142

143143
def test_cleanRamCacheFor(self):
144144
"""
145145
This helper method invalidates ram.cache for given method.
146146
"""
147147
self.request.set('ramcached', 'a')
148-
self.assertEquals(ramCachedMethod(self.portal, param='1'), 'a')
148+
self.assertEqual(ramCachedMethod(self.portal, param='1'), 'a')
149149
# change value in REQUEST, as it is ram cached, it will still return 'a'
150150
self.request.set('ramcached', 'b')
151-
self.assertEquals(ramCachedMethod(self.portal, param='1'), 'a')
151+
self.assertEqual(ramCachedMethod(self.portal, param='1'), 'a')
152152
# ram.cache works as expected if param changes
153-
self.assertEquals(ramCachedMethod(self.portal, param='2'), 'b')
153+
self.assertEqual(ramCachedMethod(self.portal, param='2'), 'b')
154154
# try again
155-
self.assertEquals(ramCachedMethod(self.portal, param='1'), 'a')
155+
self.assertEqual(ramCachedMethod(self.portal, param='1'), 'a')
156156
# now clean cache, it will returns 'b'
157157
cleanRamCacheFor('imio.helpers.tests.test_cache.ramCachedMethod')
158-
self.assertEquals(ramCachedMethod(self.portal, param='1'), 'b')
158+
self.assertEqual(ramCachedMethod(self.portal, param='1'), 'b')
159159

160160
def test_cleanForeverCache(self):
161161
"""Test the cache.cleanForeverCache function."""
@@ -179,7 +179,7 @@ def test_get_cachekey_volatile(self):
179179
volatiles = getattr(self.portal, VOLATILE_ATTR, {})
180180
self.assertTrue(isinstance(volatiles.get(volatile_name), datetime))
181181
# calling it again will still return same date
182-
self.assertEquals(date, get_cachekey_volatile(method_name))
182+
self.assertEqual(date, get_cachekey_volatile(method_name))
183183
# volatiles are not removed by tearDown, remove it now to avoid
184184
# test isolation issues with test test_invalidate_cachekey_volatile_for
185185
invalidate_cachekey_volatile_for(method_name)

src/imio/helpers/tests/test_content.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def test_create(self):
178178
ret = create(conf, cids={10: self.portal.folder}, pos=True)
179179
self.assertIn(4, ret)
180180
self.assertIn('doc2', self.portal.folder.objectIds())
181-
self.assertEquals(self.portal.folder.getObjectPosition('doc2'), 0)
181+
self.assertEqual(self.portal.folder.getObjectPosition('doc2'), 0)
182182

183183
def test_get_schema_fields(self):
184184
""" """

src/imio/helpers/tests/test_setup.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from imio.helpers.setup import remove_gs_step
66
from imio.helpers.testing import IntegrationTestCase
77
from plone import api
8+
from Products.CMFPlone.utils import get_installer
89

910
import unittest
1011

@@ -18,13 +19,16 @@ def setUp(self):
1819
self.portal = self.layer['portal']
1920

2021
def test_load_type_from_package(self):
22+
installer = get_installer(self.portal)
23+
installer.install_product("plone.app.discussion")
24+
2125
types_tool = api.portal.get_tool('portal_types')
2226
portal_type = types_tool.get('Discussion Item')
2327
self.assertTrue(portal_type.filter_content_types)
2428
portal_type.filter_content_types = False
2529
self.assertFalse(portal_type.filter_content_types)
2630
self.assertTrue(load_type_from_package(
27-
'Discussion Item', 'profile-Products.CMFPlone:plone'))
31+
'Discussion Item', 'plone.app.discussion:default'))
2832
portal_type = types_tool.get('Discussion Item')
2933
self.assertTrue(portal_type.filter_content_types)
3034
# not found portal_type

0 commit comments

Comments
 (0)