Skip to content

Commit

Permalink
Plone52 (#61)
Browse files Browse the repository at this point in the history
* revert plone 52 support

* revert plone52 support

* isort / remove circular import detection
  • Loading branch information
mamico authored Jul 2, 2024
1 parent c225296 commit bca7ff4
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 11 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/legacy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Legacy tests

on: [push]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.8"]
plone: ["52"]
steps:
- uses: actions/checkout@v4
- name: Cache eggs
uses: actions/cache@v4
with:
path: eggs
key: ${{ runner.OS }}-build-python${{ matrix.python }}-${{ matrix.plone }}
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
pip install -r requirements.txt -c constraints_plone${{ matrix.plone }}.txt
cp test_plone${{ matrix.plone }}.cfg buildout.cfg
- name: Install buildout
run: |
buildout -N -t 3 code-analysis:return-status-codes=True
- name: Run tests
run: |
bin/test
4 changes: 2 additions & 2 deletions .github/workflows/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ jobs:
uses: plone/meta/.github/workflows/dependencies.yml@main
release_ready:
uses: plone/meta/.github/workflows/release_ready.yml@main
circular:
uses: plone/meta/.github/workflows/circular.yml@main
# circular:
# uses: plone/meta/.github/workflows/circular.yml@main

##
# To modify the list of default jobs being created add in .meta.toml:
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,12 @@ python-dateutil = ['dateutil']
'souper.plone' = ['souper', 'repoze.catalog']
# extra packages
ignore-packages = [
# these are packages defined in extras_require
'collective.honeypot', 'plone.formwidget.hcaptcha', 'plone.formwidget.recaptcha',
'collective.volto.blocksfield', 'collective.z3cform.norobots',
'plone.app.iterate',
# XXX: This is a temporary fix for make the package usable with Plone 5.2 and 6.0
'plone.base', 'Products.CMFPlone',
]

##
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@
"plone.i18n",
"plone.memoize",
"plone.protect",
"plone.registry",
"plone.restapi>=8.36.0",
"plone.base",
"plone.schema",
"Products.GenericSetup",
"Products.PortalTransforms",
"souper.plone",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
from collective.volto.formsupport.interfaces import ICaptchaSupport
from collective.volto.formsupport.interfaces import ICollectiveVoltoFormsupportLayer
from plone import api
from plone.base.interfaces import IPloneSiteRoot


try:
from plone.base.interfaces import IPloneSiteRoot
except ImportError:
from Products.CMFPlone.interfaces import IPloneSiteRoot

from plone.restapi.behaviors import IBlocks
from plone.restapi.interfaces import IBlockFieldSerializationTransformer
from zope.component import adapter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@
from email.message import EmailMessage
from io import BytesIO
from plone import api
from plone.base.interfaces.controlpanel import IMailSchema


try:
from plone.base.interfaces.controlpanel import IMailSchema
except ImportError:
from Products.CMFPlone.interfaces.controlpanel import IMailSchema

from plone.protect.interfaces import IDisableCSRFProtection
from plone.registry.interfaces import IRegistry
from plone.restapi.deserializer import json_body
Expand Down
6 changes: 5 additions & 1 deletion src/collective/volto/formsupport/setuphandlers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
from plone.base.interfaces import INonInstallable
try:
from plone.base.interfaces import INonInstallable
except ImportError:
# plone 5.2
from Products.CMFPlone.interfaces import INonInstallable
from zope.interface import implementer


Expand Down
7 changes: 2 additions & 5 deletions src/collective/volto/formsupport/tests/test_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
try:
from plone.base.utils import get_installer
except ImportError:
get_installer = None
from Products.CMFPlone.utils import get_installer


class TestSetup(unittest.TestCase):
Expand All @@ -24,10 +24,7 @@ class TestSetup(unittest.TestCase):
def setUp(self):
"""Custom shared utility setup for tests."""
self.portal = self.layer["portal"]
if get_installer:
self.installer = get_installer(self.portal, self.layer["request"])
else:
self.installer = api.portal.get_tool("portal_quickinstaller")
self.installer = get_installer(self.portal, self.layer["request"])

def test_product_installed(self):
"""Test if collective.volto.formsupport is installed."""
Expand Down
6 changes: 6 additions & 0 deletions test_plone52.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,9 @@ collective.z3cform.norobots = 2.0

# Added by buildout at 2023-09-18 12:59:01.353135
collective.honeypot = 2.1

# Added by buildout at 2024-06-30 04:55:46.545837

# Required by:
# collective.volto.formsupport==3.0.3.dev0
pyotp = 2.9.0

0 comments on commit bca7ff4

Please sign in to comment.