diff --git a/.travis.yml b/.travis.yml index eac4509..052619d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,15 +6,21 @@ python: - 3.6 - 3.7 - 3.8 +env: + TOXENV=py +matrix: + include: + - python: "3.8" + name: lint + env: TOXENV=lint + after_success: install: + - pip install -U pip setuptools tox - pip install coveralls coverage - - pip install -U setuptools - - pip install zc.buildout - - buildout bootstrap - - buildout script: - - coverage run bin/test --all -v + - tox after_success: + - coverage combine - coveralls notifications: email: false diff --git a/Products/CMFUid/testing.py b/Products/CMFUid/testing.py index 47a5a5e..506d708 100644 --- a/Products/CMFUid/testing.py +++ b/Products/CMFUid/testing.py @@ -23,8 +23,8 @@ class UidEventZCMLLayer(ZopeLite): @classmethod def testSetUp(cls): - import Products import OFS + import Products zcml.load_config('meta.zcml', Products.Five) zcml.load_config('event.zcml', OFS) diff --git a/Products/CMFUid/tests/test_uidannotation.py b/Products/CMFUid/tests/test_uidannotation.py index f7c39bd..3c10ae2 100644 --- a/Products/CMFUid/tests/test_uidannotation.py +++ b/Products/CMFUid/tests/test_uidannotation.py @@ -70,8 +70,8 @@ class UniqueIdAnnotationToolTests(SecurityTest): layer = UidEventZCMLLayer def _getTargetClass(self): - from Products.CMFUid.UniqueIdAnnotationTool \ - import UniqueIdAnnotationTool + from Products.CMFUid.UniqueIdAnnotationTool import \ + UniqueIdAnnotationTool return UniqueIdAnnotationTool @@ -80,6 +80,7 @@ def _makeOne(self, *args, **kw): def setUp(self): from Products.CMFUid.interfaces import IUniqueIdAnnotationManagement + from Products.CMFCore.utils import registerToolInterface SecurityTest.setUp(self) @@ -117,8 +118,7 @@ def _promiscuous(*args, **kw): def test_interfaces(self): from Products.CMFUid.interfaces import IUniqueIdAnnotation from Products.CMFUid.interfaces import IUniqueIdAnnotationManagement - from Products.CMFUid.UniqueIdAnnotationTool \ - import UniqueIdAnnotation + from Products.CMFUid.UniqueIdAnnotationTool import UniqueIdAnnotation verifyClass(IUniqueIdAnnotationManagement, self._getTargetClass()) verifyClass(IUniqueIdAnnotation, UniqueIdAnnotation) diff --git a/Products/CMFUid/tests/test_uidgeneration.py b/Products/CMFUid/tests/test_uidgeneration.py index 77c32be..be8eb57 100644 --- a/Products/CMFUid/tests/test_uidgeneration.py +++ b/Products/CMFUid/tests/test_uidgeneration.py @@ -24,8 +24,7 @@ class UniqueIdGeneratorToolTests(SecurityTest): def _getTargetClass(self): - from Products.CMFUid.UniqueIdGeneratorTool \ - import UniqueIdGeneratorTool + from Products.CMFUid.UniqueIdGeneratorTool import UniqueIdGeneratorTool return UniqueIdGeneratorTool diff --git a/Products/CMFUid/tests/test_uidhandling.py b/Products/CMFUid/tests/test_uidhandling.py index 59c022c..c2f316a 100644 --- a/Products/CMFUid/tests/test_uidhandling.py +++ b/Products/CMFUid/tests/test_uidhandling.py @@ -58,13 +58,13 @@ def _makeOne(self, *args, **kw): return self._getTargetClass()(*args, **kw) def setUp(self): + from Products.CMFUid.interfaces import IUniqueIdHandler + from Products.CMFUid.UniqueIdAnnotationTool import \ + UniqueIdAnnotationTool + from Products.CMFUid.UniqueIdGeneratorTool import UniqueIdGeneratorTool + from Products.CMFCore.CatalogTool import CatalogTool from Products.CMFCore.utils import registerToolInterface - from Products.CMFUid.interfaces import IUniqueIdHandler - from Products.CMFUid.UniqueIdAnnotationTool \ - import UniqueIdAnnotationTool - from Products.CMFUid.UniqueIdGeneratorTool \ - import UniqueIdGeneratorTool SecurityTest.setUp(self) self.app._setObject('dummy', DummyContent(id='dummy')) diff --git a/setup.cfg b/setup.cfg index 1954a2f..83e601a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -7,11 +7,10 @@ combine_as_imports = True sections = FUTURE,STDLIB,THIRDPARTY,ZOPE,FIRSTPARTY,LOCALFOLDER known_first_party = Products.CMFCore known_third_party = six, docutils +known_zope = OFS, Products default_section = ZOPE line_length = 79 lines_after_imports = 2 -not_skip = - __init__.py [flake8] no-accept-encodings = True diff --git a/tox.ini b/tox.ini index b9c1c8b..9cf2e50 100644 --- a/tox.ini +++ b/tox.ini @@ -44,7 +44,7 @@ basepython = python3 commands_pre = mkdir -p {toxinidir}/parts/flake8 commands = - - isort --check-only --diff --recursive {toxinidir}/Products setup.py + - isort --check-only --diff {toxinidir}/Products setup.py - flake8 --format=html Products setup.py flake8 Products setup.py deps =