Skip to content

Commit 91a1e89

Browse files
authored
Merge pull request #67 from collective/plone6
Plone6
2 parents 24df5b5 + 75496c5 commit 91a1e89

21 files changed

+232
-84
lines changed

.github/workflows/python-package.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010

1111
jobs:
1212
test:
13-
runs-on: ubuntu-22.04
13+
runs-on: ubuntu-24.04
1414
strategy:
1515
fail-fast: false
1616
matrix:
@@ -21,6 +21,8 @@ jobs:
2121
plone: 5.2
2222
- python: 3.10.11
2323
plone: "6.0"
24+
- python: 3.12.7
25+
plone: "6.1"
2426
services:
2527
libreoffice:
2628
image: harbor.imio.be/library/libreoffice:7.3
@@ -31,30 +33,29 @@ jobs:
3133
- /var/tmp:/var/tmp
3234
steps:
3335
- name: Checkout
34-
uses: actions/checkout@v3
36+
uses: actions/checkout@v4
3537
- name: Setup Env
3638
run: |
3739
mkdir -p -m 777 /tmp/appy/
3840
sudo add-apt-repository ppa:libreoffice/ppa -y
3941
sudo apt update -qq -y
40-
sudo apt-get install -qq -y libreoffice libreoffice-script-provider-python
42+
sudo apt-get install -qq -y libreoffice libreoffice-script-provider-python libjpeg62 libjpeg62-dev libbz2-dev
4143
mkdir -p buildout-cache/{eggs,downloads}
4244
- name: Set up pyenv and Python
43-
uses: "gabrielfalcao/pyenv-action@v14"
45+
uses: "gabrielfalcao/pyenv-action@v18"
4446
with:
4547
default: "${{ matrix.python }}"
4648
- name: Setup Python env
4749
run: |
4850
pip install --upgrade pip
4951
pip install -r requirements-${{ matrix.plone }}.txt
5052
- name: Cache eggs
51-
uses: actions/cache@v2
53+
uses: actions/cache@v4
5254
env:
5355
cache-name: cache-eggs
5456
with:
5557
path: ~/buildout-cache/eggs
56-
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ matrix.plone }}
57-
restore-keys: ${{ runner.os }}-test-${{ env.cache-name }}-${{ matrix.plone }}
58+
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ matrix.python }}-${{ matrix.plone }}
5859
- name: buildout
5960
run: |
6061
sed -ie "s#test.cfg#test-${{matrix.plone}}.cfg#" gha.cfg
@@ -64,13 +65,13 @@ jobs:
6465
run: |
6566
bin/test -t !robot
6667
coverage:
67-
runs-on: ubuntu-22.04
68+
runs-on: ubuntu-24.04
6869
strategy:
6970
fail-fast: false
7071
matrix:
7172
include:
72-
- python: 3.10.11
73-
plone: "6.0"
73+
- python: 3.13.1
74+
plone: "6.1"
7475
services:
7576
libreoffice:
7677
image: harbor.imio.be/library/libreoffice:7.3
@@ -81,7 +82,7 @@ jobs:
8182
- /var/tmp:/var/tmp
8283
steps:
8384
- name: Checkout
84-
uses: actions/checkout@v3
85+
uses: actions/checkout@v4
8586
- name: Setup Env
8687
run: |
8788
mkdir -p -m 777 /tmp/appy/
@@ -90,7 +91,7 @@ jobs:
9091
sudo apt-get install -qq -y libreoffice libreoffice-script-provider-python
9192
mkdir -p buildout-cache/{eggs,downloads}
9293
- name: Set up pyenv and Python
93-
uses: "gabrielfalcao/pyenv-action@v14"
94+
uses: "gabrielfalcao/pyenv-action@v18"
9495
with:
9596
default: "${{ matrix.python }}"
9697
- name: Setup Python env
@@ -99,13 +100,12 @@ jobs:
99100
pip install -r requirements-${{ matrix.plone }}.txt
100101
pip install -U coveralls
101102
- name: Cache eggs
102-
uses: actions/cache@v2
103+
uses: actions/cache@v4
103104
env:
104105
cache-name: cache-eggs
105106
with:
106107
path: ~/buildout-cache/eggs
107-
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ matrix.plone }}
108-
restore-keys: ${{ runner.os }}-test-${{ env.cache-name }}-${{ matrix.plone }}
108+
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ matrix.python }}-${{ matrix.plone }}
109109
- name: buildout
110110
run: |
111111
sed -ie "s#test.cfg#test-${{matrix.plone}}.cfg#" gha.cfg

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,5 @@ nosetests.xml
4949
# Pycharm
5050
/.idea/
5151
/pip-selfcheck.json
52+
53+
CACHEDIR.TAG

CHANGES.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@ Changelog
44
4.0 (unreleased)
55
----------------
66

7-
- Python 3, Plone 5.2 and Plone 6.0 compatible.
8-
[aduchene]
7+
- Python 3, Plone 5.2, 6.0 and 6.1 compatible.
8+
[aduchene, chris-adam]
99
- Fixed an issue when odt_file.filename could be None when searching and replacing.
1010
[aduchene]
1111
- Fixed an issue with `helper.dexterity.DXDocumentGenerationHelperView.check_permission` raising when it should not.
1212
[aduchene]
1313
- Replaced `six.u()` by safe_unicode() to handle unicode strings.
1414
[sgeulette]
15+
- Updated imio.helpers imports
16+
[sgeulette]
1517

1618
3.43 (2024-04-10)
1719
-----------------

base.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ extensions +=
1515

1616
always-checkout = force
1717
sources = sources
18-
auto-checkout =
1918

2019
sources-dir = devel
2120

buildout.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ auto-checkout +=
1010
collective.excelexport = git ${remotes:collective}/collective.excelexport.git pushurl=${remotes:collective_push}/collective.excelexport.git branch=plone6
1111
appy = git ${remotes:imio}/appy.git pushurl=${remotes:imio_push}/appy.git branch=python3
1212
plone.restapi = git ${remotes:plone}/plone.restapi.git pushurl=${remotes:plone_push}/plone.restapi.git branch=main
13-
imio.helpers = git ${remotes:imio}/imio.helpers.git pushurl=${remotes:imio_push}/imio.helpers.git branch=plone6
1413

1514
[versions]
1615
appy =

development.cfg

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,23 @@ eggs =
9797
[code-analysis]
9898
flake8-max-complexity = 50
9999
flake8-ignore = E501, W503, W504, E203, Q000, C812
100+
directory = ${buildout:directory}/src/collective/documentgenerator
101+
flake8-extensions =
102+
flake8-isort
103+
104+
[coverage]
105+
recipe = zc.recipe.egg
106+
eggs = coverage
107+
108+
[test-coverage]
109+
recipe = collective.recipe.template
110+
input = inline:
111+
#!/bin/bash
112+
export TZ=UTC
113+
${buildout:directory}/bin/coverage run bin/test $*
114+
${buildout:directory}/bin/coverage html
115+
${buildout:directory}/bin/coverage report -m --fail-under=90
116+
# Fail (exit status 1) if coverage returns exit status 2 (this happens
117+
# when test coverage is below 100%.
118+
output = ${buildout:directory}/bin/test-coverage
119+
mode = 755

requirements-6.1.txt

Lines changed: 3 additions & 0 deletions
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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,14 @@
2222
"Framework :: Plone :: 4.3",
2323
"Framework :: Plone :: 5.0",
2424
"Framework :: Plone :: 5.1",
25+
"Framework :: Plone :: 6.0",
26+
"Framework :: Plone :: 6.1",
2527
"Framework :: Plone :: Addon",
2628
"License :: OSI Approved :: GNU General Public License (GPL)",
2729
"Programming Language :: Python",
2830
"Programming Language :: Python :: 2.7",
31+
"Programming Language :: Python :: 3.10",
32+
"Programming Language :: Python :: 3.13",
2933
],
3034
keywords='plone document generation generator odt word pdf libreoffice template',
3135
author='Simon Delcourt',

src/collective/documentgenerator/browser/configure.zcml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,14 +186,14 @@
186186
permission="zope2.View" />
187187

188188
<!-- Override the documentviewer for IConfigurablePODTemplate so it uses ViewConfigurablePodTemplate too -->
189-
<configure package="collective.documentviewer" zcml:condition="installed collective.documentviewer">
189+
<configure package="collective.documentviewer.browser" zcml:condition="installed collective.documentviewer">
190190
<browser:page
191191
name="documentviewer"
192192
for="collective.documentgenerator.content.pod_template.IConfigurablePODTemplate"
193193
class="collective.documentgenerator.browser.overrides.DGDXDocumentViewerView"
194-
template="templates/documentviewerdx.pt"
194+
template="templates/documentviewer.pt"
195195
permission="zope2.View"
196-
layer=".interfaces.ILayer" />
196+
layer="..interfaces.ILayer" />
197197
</configure>
198198

199199
<browser:page
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# -*- coding: utf-8 -*-
22

33
from collective.documentgenerator.browser.views import ViewConfigurablePodTemplate
4-
from collective.documentviewer.views import DXDocumentViewerView
4+
from collective.documentviewer.browser.views import DocumentViewerView
55

66

7-
class DGDXDocumentViewerView(ViewConfigurablePodTemplate, DXDocumentViewerView):
7+
class DGDXDocumentViewerView(ViewConfigurablePodTemplate, DocumentViewerView):
88
"""The documentviewer view from collective.documentviewer overrides the default DX
99
view, so override it again so our own override is taken into account."""

0 commit comments

Comments
 (0)