Skip to content

Commit

Permalink
bump black, zimports
Browse files Browse the repository at this point in the history
Change-Id: Id9afb5a6dfd02ce37b11486a046ca522fcd3c91a
  • Loading branch information
zzzeek committed Sep 18, 2023
1 parent 4bb7bb3 commit 893e0a0
Show file tree
Hide file tree
Showing 13 changed files with 5 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/python/black
rev: 22.3.0
rev: 23.9.1
hooks:
- id: black

- repo: https://github.com/sqlalchemyorg/zimports
rev: v0.4.1
rev: v0.6.0
hooks:
- id: zimports

Expand Down
1 change: 0 additions & 1 deletion mako/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def _exit():


def cmdline(argv=None):

parser = ArgumentParser()
parser.add_argument(
"--var",
Expand Down
2 changes: 0 additions & 2 deletions mako/codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,6 @@ def visitExpression(self, node):
)
or len(self.compiler.default_filters)
):

s = self.create_filter_callable(
node.escapes_code.args, "%s" % node.text, True
)
Expand Down Expand Up @@ -1181,7 +1180,6 @@ def visitDefTag(self, node):

def visitBlockTag(self, node):
if node is not self.node and not node.is_anonymous:

if isinstance(self.node, parsetree.DefTag):
raise exceptions.CompileException(
"Named block '%s' not allowed inside of def '%s'"
Expand Down
1 change: 0 additions & 1 deletion mako/lookup.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ def __init__(
lexer_cls=None,
include_error_handler=None,
):

self.directories = [
posixpath.normpath(d) for d in util.to_list(directories, ())
]
Expand Down
3 changes: 0 additions & 3 deletions mako/pyparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ def visit_ClassDef(self, node):
self._add_declared(node.name)

def visit_Assign(self, node):

# flip around the visiting of Assign so the expression gets
# evaluated first, in the case of a clause like "x=x+5" (x
# is undeclared)
Expand Down Expand Up @@ -99,7 +98,6 @@ def _expand_tuples(self, args):
yield arg

def _visit_function(self, node, islambda):

# push function state onto stack. dont log any more
# identifiers as "declared" until outside of the function,
# but keep logging identifiers as "undeclared". track
Expand All @@ -122,7 +120,6 @@ def _visit_function(self, node, islambda):
self.local_ident_stack = local_ident_stack

def visit_For(self, node):

# flip around visit

self.visit(node.iter)
Expand Down
2 changes: 1 addition & 1 deletion mako/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ def include_file(self, uri, **kwargs):
def _populate(self, d, l):
for ident in l:
if ident == "*":
for (k, v) in self._get_star():
for k, v in self._get_star():
d[k] = v
else:
d[ident] = getattr(self, ident)
Expand Down
1 change: 0 additions & 1 deletion mako/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@


class Template:

r"""Represents a compiled template.
:class:`.Template` includes a reference to the original
Expand Down
1 change: 0 additions & 1 deletion mako/testing/assertions.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ def _assert_raises(
check_context=False,
cause_cls=None,
):

with _expect_raises(except_cls, msg, check_context, cause_cls) as ec:
callable_(*args, **kwargs)
return ec.error
Expand Down
1 change: 0 additions & 1 deletion test/ext/test_linguaplugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class MockOptions:
class MakoExtractTest(TemplateTest):
@pytest.fixture(autouse=True)
def register_lingua_extractors(self):

from lingua.extractors import register_extractors

register_extractors()
Expand Down
1 change: 0 additions & 1 deletion test/test_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ def invalidate(self, key, **kw):


class CacheTest:

real_backend = "simple"

def _install_mock_cache(self, template, implname=None):
Expand Down
1 change: 0 additions & 1 deletion test/test_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ def test_utf8_format_exceptions_no_pygments(self):
)

def test_mod_no_encoding(self):

mod = __import__("test.foo.mod_no_encoding").foo.mod_no_encoding
try:
mod.run()
Expand Down
2 changes: 0 additions & 2 deletions test/test_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ def __exit__(self, *arg):

class MiscTest(TemplateTest):
def test_crlf_linebreaks(self):

crlf = r"""
<%
foo = True
Expand Down Expand Up @@ -1164,7 +1163,6 @@ def test_globals(self):

class RichTracebackTest(TemplateTest):
def _do_test_traceback(self, utf8, memory, syntax):

if memory:
if syntax:
source = (
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ deps=
flake8-builtins
flake8-docstrings
flake8-rst-docstrings
pydocstyle<4.0.0
pydocstyle
# used by flake8-rst-docstrings
pygments
black==22.3.0
black==23.9.1
commands =
flake8 ./mako/ ./test/ setup.py --exclude test/templates,test/foo {posargs}
black --check .

0 comments on commit 893e0a0

Please sign in to comment.