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

Update to isort5. #16

Merged
merged 4 commits into from
Sep 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,21 @@ python:
- 3.6
- 3.7
- 3.8
env:
TOXENV=py
Comment on lines +9 to +10
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never seen it done this way before, interesting.

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
Expand Down
2 changes: 1 addition & 1 deletion Products/CMFUid/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions Products/CMFUid/tests/test_uidannotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions Products/CMFUid/tests/test_uidgeneration.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
class UniqueIdGeneratorToolTests(SecurityTest):

def _getTargetClass(self):
from Products.CMFUid.UniqueIdGeneratorTool \
import UniqueIdGeneratorTool
from Products.CMFUid.UniqueIdGeneratorTool import UniqueIdGeneratorTool

return UniqueIdGeneratorTool

Expand Down
10 changes: 5 additions & 5 deletions Products/CMFUid/tests/test_uidhandling.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down
3 changes: 1 addition & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down