Skip to content

Commit

Permalink
Update isort to version 5 (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
dataflake committed Oct 27, 2020
1 parent 5640419 commit 54217c1
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Changelog
3.4 (unreleased)
----------------

- Update `isort` to version 5.

- Make ``ustr.ustr`` Python 3 compatible
(`Zope#921 <https://github.com/zopefoundation/Zope/issues/921>`_)

Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ force_single_line = True
combine_as_imports = True
sections = FUTURE,STDLIB,THIRDPARTY,ZOPE,FIRSTPARTY,LOCALFOLDER
known_third_party = six
known_zope =
default_section = ZOPE
line_length = 79
lines_after_imports = 2
Expand Down
3 changes: 2 additions & 1 deletion src/DocumentTemplate/DT_String.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@

import six

import DocumentTemplate as _dt
from AccessControl.class_init import InitializeClass
from AccessControl.SecurityInfo import ClassSecurityInfo

import DocumentTemplate as _dt

from ._DocumentTemplate import InstanceDict
from ._DocumentTemplate import TemplateDict
from ._DocumentTemplate import render_blocks
Expand Down
3 changes: 2 additions & 1 deletion src/DocumentTemplate/_DocumentTemplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,12 @@

import six

import DocumentTemplate as _dt
from Acquisition import aq_base
from ExtensionClass import Base
from zExceptions import HTTPException

import DocumentTemplate as _dt

from .html_quote import html_quote
from .ustr import ustr

Expand Down
1 change: 1 addition & 0 deletions src/DocumentTemplate/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from AccessControl.SimpleObjectPolicies import ContainerAssertions
from AccessControl.ZopeGuards import guarded_getitem
from AccessControl.ZopeGuards import safe_builtins

from DocumentTemplate import DT_Util


Expand Down
2 changes: 2 additions & 0 deletions src/DocumentTemplate/tests/testDTML.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ def testSyntaxErrorHandling(self):

def testStringDateFormatting(self):
import DateTime

from DocumentTemplate.DT_HTML import String
html = String("%(name capitalize spacify)s is "
"%(date fmt=year)s/%(date fmt=month)s/%(date fmt=day)s")
Expand Down Expand Up @@ -596,6 +597,7 @@ def test_fmt_reST_raw_directive_url_option_raises(self):

def read_file(name):
import os

from DocumentTemplate import tests
here = tests.__path__[0]
with open(os.path.join(here, name), 'r') as fd:
Expand Down
6 changes: 4 additions & 2 deletions src/DocumentTemplate/tests/test_DT_Raise.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ def test_render_w_type_builtin_exception(self):
self.assertRaises(SyntaxError, raiser.render, TemplateDict())

def test_render_w_type_zExceptions_exception(self):
from DocumentTemplate.DT_Util import TemplateDict
from zExceptions import Redirect

from DocumentTemplate.DT_Util import TemplateDict
raiser = self._makeOne(type='Redirect')
self.assertRaises(Redirect, raiser.render, TemplateDict())

Expand All @@ -52,8 +53,9 @@ def test_render_w_expr_builtin_exception(self):
self.assertRaises(SyntaxError, raiser.render, TemplateDict())

def test_render_w_expr_zExceptions_exception(self):
from DocumentTemplate.DT_Util import TemplateDict
from zExceptions import Redirect

from DocumentTemplate.DT_Util import TemplateDict
raiser = self._makeOne(expr='Redirect')
self.assertRaises(Redirect, raiser.render, TemplateDict())

Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ basepython = python3
commands_pre =
mkdir -p {toxinidir}/parts/flake8
commands =
- isort --check-only --diff --recursive {toxinidir}/src setup.py
isort --check-only --diff {toxinidir}/src setup.py
flake8 src setup.py {posargs}
deps =
isort <5
isort
flake8
# helper to generate HTML reports:
flake8-html
Expand Down

0 comments on commit 54217c1

Please sign in to comment.