Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated to python3.7 and Plone 5.2.0 #35

Merged
merged 17 commits into from
Oct 24, 2019
Merged
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,4 @@ Gruntfile.js
node_modules/
package.json
temp_resources
/pyvenv.cfg
32 changes: 21 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
dist: trusty
dist: bionic
services:
- xvfb
addons:
apt:
packages:
- libgtk-3-dev
language: python
sudo: false
cache:
Expand All @@ -7,24 +13,28 @@ cache:
- eggs
- downloads
python:
- '2.7'
- '3.7'
matrix:
fast_finish: true
before_install:
- firefox -v
- virtualenv .
- bin/pip install pathlib2
- bin/pip3 install -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-18.04/wxPython-4.0.6-cp37-cp37m-linux_x86_64.whl -vvv wxPython
- bin/pip install --upgrade -r requirements.txt
install:
- virtualenv -p $(which python) .
- bin/pip install -r requirements.txt
- bin/buildout -N buildout:download-cache=downloads code-analysis:return-status-codes=True annotate
- bin/buildout -N buildout:download-cache=downloads code-analysis:return-status-codes=True
- bin/buildout -c development.cfg -N buildout:download-cache=downloads code-analysis:return-status-codes=True annotate
- bin/buildout -c development.cfg -N buildout:download-cache=downloads code-analysis:return-status-codes=True
- wget https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-linux64.tar.gz
- tar -xzf geckodriver-v0.26.0-linux64.tar.gz -C bin
- export PATH=$(pwd)/bin:$PATH

script:
- bin/code-analysis
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- firefox -v
- wget https://github.com/mozilla/geckodriver/releases/download/v0.20.1/geckodriver-v0.20.1-linux64.tar.gz
- tar -xzf geckodriver-v0.20.1-linux64.tar.gz -C bin
- export PATH=$(pwd)/bin:$PATH
- bin/test --all
- bin/test
- export ROBOTSUITE_PREFIX=ONLYROBOT && bin/test -t ONLYROBOT --all

after_success:
- bin/createcoverage
Expand Down
2 changes: 1 addition & 1 deletion DEVELOP.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Using the development buildout

Create a virtualenv in the package::

$ virtualenv --clear .
$ python3.7 -m venv --clear .

Install requirements with pip::

Expand Down
14 changes: 2 additions & 12 deletions buildout.cfg
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
[buildout]
extends =
http://dist.plone.org/release/5.1/versions.cfg
http://dist.plone.org/release/5.2.0/versions.cfg
versions.cfg
show-picked-versions = false
extensions = mr.developer

parts =
code-analysis
coverage
createcoverage
i18ndude
i18nize-webapp
instance
omelette
releaser
robot
test
test-coverage

develop = .
languages = de
Expand Down Expand Up @@ -51,7 +41,7 @@ i18ndude-bin = ${buildout:bin-directory}/i18ndude

# Flake8
flake8 = True
flake8-ignore = E123, C815, P001, W503, Q000, I001
flake8-ignore = E123, C815, P001, W503, Q000, I001, C812
flake8-exclude = bootstrap.py,bootstrap-buildout.py,docs,*.egg,*.cpy,*.vpy,overrides,omelette

flake8-max-complexity = 15
Expand Down
11 changes: 11 additions & 0 deletions development.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
[buildout]
extends = buildout.cfg

parts +=
code-analysis
coverage
createcoverage
i18ndude
i18nize-webapp
omelette
releaser
robot
test
test-coverage

[instance]
eggs +=
Expand Down
5 changes: 5 additions & 0 deletions development_python2.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[buildout]
extends = development.cfg

parts -=
robot
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
setuptools==38.2.4
zc.buildout==2.11.4
setuptools==41.0.1
zc.buildout==2.13.2
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"Framework :: Plone :: 5.1",
"Programming Language :: Python",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.7",
"Operating System :: OS Independent",
"License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
],
Expand Down
5 changes: 3 additions & 2 deletions src/collective/frontpage/tests/test_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from plone import api
from plone.app.testing import setRoles
from plone.app.testing import TEST_USER_ID
from Products.CMFPlone.utils import get_installer

import unittest

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

def test_product_installed(self):
"""Test if collective.frontpage is installed."""
Expand All @@ -42,7 +43,7 @@ class TestUninstall(unittest.TestCase):

def setUp(self):
self.portal = self.layer["portal"]
self.installer = api.portal.get_tool("portal_quickinstaller")
self.installer = get_installer(self.portal)
roles_before = api.user.get_roles(TEST_USER_ID)
setRoles(self.portal, TEST_USER_ID, ["Manager"])
self.installer.uninstallProducts(["collective.frontpage"])
Expand Down
5 changes: 3 additions & 2 deletions src/collective/frontpage/tests/test_view_frontpage.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from plone.app.testing import SITE_OWNER_PASSWORD
from plone.app.testing import TEST_USER_ID
from plone.testing._z2_testbrowser import Browser
from Products.CMFPlone.utils import get_installer

import transaction
import unittest
Expand Down Expand Up @@ -74,15 +75,15 @@ def _install_tokyo(self):
from Testing.ZopeTestCase import installProduct
installProduct(self.portal.getPhysicalRoot(), 'collective.sidebar')
installProduct(self.portal.getPhysicalRoot(), 'plonetheme.tokyo')
self.installer = api.portal.get_tool('portal_quickinstaller')
self.installer = get_installer(self.portal)
self.installer.installProduct('plonetheme.tokyo')
transaction.commit()

def _login_with_browser(self):
self.browser.open(self.portal.absolute_url() + "/login_form")
self.browser.getControl(name='__ac_name').value = SITE_OWNER_NAME
self.browser.getControl(name='__ac_password').value = SITE_OWNER_PASSWORD
self.browser.getControl(name='submit').click()
self.browser.getControl(name='buttons.login').click()

def _logout_with_browser(self):
self.browser.open(self.portal.absolute_url() + '/' + 'logout')
Expand Down
5 changes: 3 additions & 2 deletions src/collective/frontpage/tests/test_view_section.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
from collective.frontpage.testing import COLLECTIVE_FRONTPAGE_FUNCTIONAL_TESTING # noqa: 501
from collective.frontpage.testing import COLLECTIVE_FRONTPAGE_INTEGRATION_TESTING # noqa: 501
from plone import api
from plone.app.testing import login, SITE_OWNER_PASSWORD
from plone.app.testing import login
from plone.app.testing import logout
from plone.app.testing import setRoles
from plone.app.testing import SITE_OWNER_NAME
from plone.app.testing import SITE_OWNER_PASSWORD
from plone.app.testing import TEST_USER_ID
from plone.testing._z2_testbrowser import Browser

Expand Down Expand Up @@ -83,7 +84,7 @@ def _login_with_browser(self):
self.browser.open(self.portal.absolute_url() + "/login_form")
self.browser.getControl(name='__ac_name').value = SITE_OWNER_NAME
self.browser.getControl(name='__ac_password').value = SITE_OWNER_PASSWORD
self.browser.getControl(name='submit').click()
self.browser.getControl(name='buttons.login').click()

def _logout_with_browser(self):
self.browser.open(self.portal.absolute_url() + '/' + 'logout')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,7 @@ def test_edge_case_names_not_crashing_vocab(self):
self.assertTrue(IVocabularyTokenized.providedBy(vocabulary))
self.assertIn(u"rgba(0,0,0,1)", vocabulary)
self.assertIn(u"rgba(0,0,0,2)", vocabulary)
self.assertEqual(2, len(vocabulary))
# Python2:
# self.assertEqual(2, len(vocabulary))
# Python3:
# self.assertEqual(3, len(vocabulary))
33 changes: 19 additions & 14 deletions src/collective/frontpage/vocabularies/section_colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ def _get_colors_from_registry():
items.append(VocabItem(split[1].strip(), split[0].strip()))
except IndexError:
logger.exception(
"Could not use color {color} -> Please check the settings to make "
"Could not use color {color} -> "
"Please check the settings to make "
"your custom color available! "
"Each line should contain a Pipe Symbol".format(color=color)
"Each line should contain a "
"Pipe Symbol".format(color=color)
)
return items

Expand All @@ -58,24 +60,27 @@ def _create_simple_terms(items):
try:
if item:
if item.token in [x.value for x in terms]:
logger.warning(
"Could not add {color} ({color_hex}), "
"because it is already defined "
"as {duplicate}({duplicate_hex}).".format(
color=item.value,
duplicate=x.title,
color_hex=item.token,
duplicate_hex=x.token
)
logger.warning(
"Could not add {color} ({color_hex}), "
"because it is already defined "
"as {duplicate}({duplicate_hex}).".format(
color=item.value,
duplicate=item.value,
color_hex=item.token,
duplicate_hex=str(item.token)
)
)
else:
term = SimpleTerm(
value=item.token, token=str(item.token), title=item.value
value=item.token,
token=str(item.token),
title=item.value
)
terms.append(term)
except UnicodeEncodeError:
except UnicodeEncodeError: # Only happens in Python2
logger.exception(
"Could not use one of your custom colors -> Please check the "
"Could not use one of your custom colors "
"-> Please check the "
"settings to make your custom color available! "
"Please don't use special characters in RGB-Values!"
)
Expand Down
111 changes: 62 additions & 49 deletions versions.cfg
Original file line number Diff line number Diff line change
@@ -1,60 +1,73 @@
[versions]
collective.frontpage =

setuptools =
zc.buildout =
setuptools = 41.0.1
zc.buildout = 2.13.2

collective.sidebar = 1.0.0b1

robotframework-ride = 1.7.4b2

PyYAML = 5.1.2
Pypubsub = 4.0.3
argh = 0.26.2
args = 0.1.0
check-manifest = 0.35
clint = 0.5.1
colorama = 0.3.7
configparser = 3.5.0
coverage = 3.7.1
bobtemplates.plone = 5.0.1
createcoverage = 1.5
enum34 = 1.1.6
flake8 = 3.3.0
entrypoints = 0.3
fancycompleter = 0.8
flake8 = 3.7.8
flake8-blind-except = 0.1.1
flake8-coding = 1.3.0
flake8-debugger = 1.4.0
flake8-deprecated = 1.1
flake8-isort = 2.1.3
flake8-pep3101 = 1.0
flake8-plone-api = 1.2
flake8-plone-hasattr = 0.1
flake8-polyfill = 1.0.1
flake8-print = 2.0.2
flake8-quotes = 0.9.0
flake8-coding = 1.3.2
flake8-commas = 2.0.0
flake8-debugger = 3.2.0
flake8-deprecated = 1.3
flake8-isort = 2.7.0
flake8-pep3101 = 1.2.1
flake8-plone-api = 1.4
flake8-plone-hasattr = 0.2.post0
flake8-print = 3.1.1
flake8-quotes = 2.1.0
flake8-string-format = 0.2.3
flake8-todo = 0.7
i18ndude = 4.0.1
isort = 4.2.5
isort = 4.3.21
mccabe = 0.6.1
mr.developer = 1.38
mr.bob = 0.1.2
pathtools = 0.1.2
pkginfo = 1.4.1
plone.api = >=1.8.4
plone.recipe.codeanalysis = 2.2
plone.testing = 5.0.0
pycodestyle = 2.3.1
pyflakes = 1.5.0
PyYAML = 3.12
requests-toolbelt = 0.7.1
testfixtures = 4.13.4
twine = 1.8.1
watchdog = 0.8.3
z3c.jbot = 0.7.2
zc.recipe.egg = 2.0.3
zest.releaser = 6.9

# Works with Firefox 55 & Firefox 52
plone.app.robotframework = 1.3.0
prompt-toolkit = 1.0.15
robotframework = 3.0.4
robotframework-debuglibrary = 1.0.1
robotframework-ride = 1.5.2.1
robotframework-selenium2library = 1.8.0
robotframework-selenium2screenshots = 0.7.2
robotsuite = 2.0.0
selenium = 3.14.1
pdbpp = 0.10.2
plone.recipe.codeanalysis = 3.0.1
prompt-toolkit = 1.0.18
pyflakes = 2.1.1
regex = 2019.8.19
watchdog = 0.9.0
zest.pocompile = 1.4

# Required by:
# bobtemplates.plone==5.0.1
case-conversion = 2.1.0

# Required by:
# plone.recipe.codeanalysis==3.0.1
check-manifest = 0.40

# Required by:
# wxPython==4.0.6
numpy = 1.17.3

# Required by:
# flake8-debugger==3.2.0
pycodestyle = 2.5.0

# Required by:
# flake8-isort==2.7.0
testfixtures = 6.10.0

# Required by:
# prompt-toolkit==1.0.18
wcwidth = 0.1.7

# Required by:
# pdbpp==0.10.2
wmctrl = 0.3

# Required by:
# robotframework-ride==1.7.4b2
wxPython = 4.0.6