diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2023-09-18 16:23:31 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2023-09-18 16:24:55 -0400 |
commit | 893e0a0350204ab8ebea014a1581d60b49928698 (patch) | |
tree | 19a269d2b32e683ce0709ed185afc849dae2a4f2 | |
parent | 4bb7bb3193b1962b2ed7972983ed9d7d63fe3a20 (diff) | |
download | mako-893e0a0350204ab8ebea014a1581d60b49928698.tar.gz |
bump black, zimports
Change-Id: Id9afb5a6dfd02ce37b11486a046ca522fcd3c91a
-rw-r--r-- | .pre-commit-config.yaml | 4 | ||||
-rwxr-xr-x | mako/cmd.py | 1 | ||||
-rw-r--r-- | mako/codegen.py | 2 | ||||
-rw-r--r-- | mako/lookup.py | 1 | ||||
-rw-r--r-- | mako/pyparser.py | 3 | ||||
-rw-r--r-- | mako/runtime.py | 2 | ||||
-rw-r--r-- | mako/template.py | 1 | ||||
-rw-r--r-- | mako/testing/assertions.py | 1 | ||||
-rw-r--r-- | test/ext/test_linguaplugin.py | 1 | ||||
-rw-r--r-- | test/test_cache.py | 1 | ||||
-rw-r--r-- | test/test_exceptions.py | 1 | ||||
-rw-r--r-- | test/test_template.py | 2 | ||||
-rw-r--r-- | tox.ini | 4 |
13 files changed, 5 insertions, 19 deletions
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 19bc31d..36ec5fa 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 diff --git a/mako/cmd.py b/mako/cmd.py index 53be9b5..6bb8197 100755 --- a/mako/cmd.py +++ b/mako/cmd.py @@ -25,7 +25,6 @@ def _exit(): def cmdline(argv=None): - parser = ArgumentParser() parser.add_argument( "--var", diff --git a/mako/codegen.py b/mako/codegen.py index b623abd..a516d3b 100644 --- a/mako/codegen.py +++ b/mako/codegen.py @@ -816,7 +816,6 @@ class _GenerateRenderMethod: ) or len(self.compiler.default_filters) ): - s = self.create_filter_callable( node.escapes_code.args, "%s" % node.text, True ) @@ -1181,7 +1180,6 @@ class _Identifiers: 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'" diff --git a/mako/lookup.py b/mako/lookup.py index 5795c47..ea1aec6 100644 --- a/mako/lookup.py +++ b/mako/lookup.py @@ -178,7 +178,6 @@ class TemplateLookup(TemplateCollection): lexer_cls=None, include_error_handler=None, ): - self.directories = [ posixpath.normpath(d) for d in util.to_list(directories, ()) ] diff --git a/mako/pyparser.py b/mako/pyparser.py index 9ac0081..68218a0 100644 --- a/mako/pyparser.py +++ b/mako/pyparser.py @@ -64,7 +64,6 @@ class FindIdentifiers(_ast_util.NodeVisitor): 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) @@ -99,7 +98,6 @@ class FindIdentifiers(_ast_util.NodeVisitor): 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 @@ -122,7 +120,6 @@ class FindIdentifiers(_ast_util.NodeVisitor): self.local_ident_stack = local_ident_stack def visit_For(self, node): - # flip around visit self.visit(node.iter) diff --git a/mako/runtime.py b/mako/runtime.py index 6d7fa68..23401b7 100644 --- a/mako/runtime.py +++ b/mako/runtime.py @@ -530,7 +530,7 @@ class Namespace: 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) diff --git a/mako/template.py b/mako/template.py index 9bda4dc..e72915b 100644 --- a/mako/template.py +++ b/mako/template.py @@ -26,7 +26,6 @@ from mako.lexer import Lexer class Template: - r"""Represents a compiled template. :class:`.Template` includes a reference to the original diff --git a/mako/testing/assertions.py b/mako/testing/assertions.py index 14ea635..22221cd 100644 --- a/mako/testing/assertions.py +++ b/mako/testing/assertions.py @@ -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 diff --git a/test/ext/test_linguaplugin.py b/test/ext/test_linguaplugin.py index 5aafcff..6e2faa8 100644 --- a/test/ext/test_linguaplugin.py +++ b/test/ext/test_linguaplugin.py @@ -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() diff --git a/test/test_cache.py b/test/test_cache.py index dd415d4..9e0d559 100644 --- a/test/test_cache.py +++ b/test/test_cache.py @@ -80,7 +80,6 @@ register_plugin("mock", __name__, "MockCacheImpl") class CacheTest: - real_backend = "simple" def _install_mock_cache(self, template, implname=None): diff --git a/test/test_exceptions.py b/test/test_exceptions.py index be573e6..e1654ff 100644 --- a/test/test_exceptions.py +++ b/test/test_exceptions.py @@ -232,7 +232,6 @@ ${foobar} ) def test_mod_no_encoding(self): - mod = __import__("test.foo.mod_no_encoding").foo.mod_no_encoding try: mod.run() diff --git a/test/test_template.py b/test/test_template.py index 6e7a309..62fd21d 100644 --- a/test/test_template.py +++ b/test/test_template.py @@ -30,7 +30,6 @@ class ctx: class MiscTest(TemplateTest): def test_crlf_linebreaks(self): - crlf = r""" <% foo = True @@ -1164,7 +1163,6 @@ class GlobalsTest(TemplateTest): class RichTracebackTest(TemplateTest): def _do_test_traceback(self, utf8, memory, syntax): - if memory: if syntax: source = ( @@ -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 . |