Skip to content

Commit

Permalink
Update isort to version 5
Browse files Browse the repository at this point in the history
modified:   CHANGES.rst
modified:   setup.cfg
modified:   src/DocumentTemplate/DT_String.py
modified:   src/DocumentTemplate/_DocumentTemplate.py
modified:   src/DocumentTemplate/security.py
modified:   src/DocumentTemplate/tests/testDTML.py
modified:   src/DocumentTemplate/tests/test_DT_Raise.py
modified:   tox.ini
  • Loading branch information
jugmac00 committed Oct 7, 2020
1 parent 5e3af05 commit 659582a
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Changelog
- Eventually drop BBB code leading to a deprecation warning in version 3.2+.
(`#42 <https://github.com/zopefoundation/DocumentTemplate/issues/42>`_)

- Update `isort` to version 5.


3.2.2 (2020-02-04)
------------------
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 @@ -15,10 +15,11 @@
import re
from threading import Lock

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 @@ -103,11 +103,12 @@
from a named file.
"""

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 @@ -199,6 +199,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 @@ -583,6 +584,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
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ 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
Expand Down

0 comments on commit 659582a

Please sign in to comment.