Bump mako from 1.2.0 to 1.2.3 (#1845)

* Bump mako from 1.2.0 to 1.2.3

Bumps [mako](https://github.com/sqlalchemy/mako) from 1.2.0 to 1.2.3.
- [Release notes](https://github.com/sqlalchemy/mako/releases)
- [Changelog](https://github.com/sqlalchemy/mako/blob/main/CHANGES)
- [Commits](https://github.com/sqlalchemy/mako/commits)

---
updated-dependencies:
- dependency-name: mako
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update mako==1.2.3

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com>

[skip ci]
This commit is contained in:
dependabot[bot] 2022-11-12 17:19:17 -08:00 committed by GitHub
parent 58aab24c28
commit d26ce224ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 66 additions and 43 deletions

View file

@ -1,8 +1,8 @@
# mako/__init__.py
# Copyright 2006-2021 the Mako authors and contributors <see AUTHORS file>
# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
__version__ = "1.2.0"
__version__ = "1.2.3"

View file

@ -1,5 +1,5 @@
# mako/_ast_util.py
# Copyright 2006-2021 the Mako authors and contributors <see AUTHORS file>
# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php

View file

@ -1,5 +1,5 @@
# mako/ast.py
# Copyright 2006-2021 the Mako authors and contributors <see AUTHORS file>
# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php

View file

@ -1,5 +1,5 @@
# mako/cache.py
# Copyright 2006-2021 the Mako authors and contributors <see AUTHORS file>
# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php

View file

@ -1,5 +1,5 @@
# mako/cmd.py
# Copyright 2006-2021 the Mako authors and contributors <see AUTHORS file>
# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php

View file

@ -1,5 +1,5 @@
# mako/codegen.py
# Copyright 2006-2021 the Mako authors and contributors <see AUTHORS file>
# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php

View file

@ -1,5 +1,5 @@
# mako/compat.py
# Copyright 2006-2021 the Mako authors and contributors <see AUTHORS file>
# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php

View file

@ -1,5 +1,5 @@
# mako/exceptions.py
# Copyright 2006-2021 the Mako authors and contributors <see AUTHORS file>
# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php

View file

@ -1,5 +1,5 @@
# ext/autohandler.py
# Copyright 2006-2021 the Mako authors and contributors <see AUTHORS file>
# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php

View file

@ -1,5 +1,5 @@
# ext/babelplugin.py
# Copyright 2006-2021 the Mako authors and contributors <see AUTHORS file>
# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php

View file

@ -1,5 +1,5 @@
# ext/beaker_cache.py
# Copyright 2006-2021 the Mako authors and contributors <see AUTHORS file>
# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php

View file

@ -1,5 +1,5 @@
# ext/extract.py
# Copyright 2006-2021 the Mako authors and contributors <see AUTHORS file>
# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php

View file

@ -1,5 +1,5 @@
# ext/linguaplugin.py
# Copyright 2006-2021 the Mako authors and contributors <see AUTHORS file>
# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php

View file

@ -1,5 +1,5 @@
# ext/preprocessors.py
# Copyright 2006-2021 the Mako authors and contributors <see AUTHORS file>
# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php

View file

@ -1,5 +1,5 @@
# ext/pygmentplugin.py
# Copyright 2006-2021 the Mako authors and contributors <see AUTHORS file>
# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php

View file

@ -1,5 +1,5 @@
# ext/turbogears.py
# Copyright 2006-2021 the Mako authors and contributors <see AUTHORS file>
# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php

View file

@ -1,5 +1,5 @@
# mako/filters.py
# Copyright 2006-2021 the Mako authors and contributors <see AUTHORS file>
# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php

View file

@ -1,5 +1,5 @@
# mako/lexer.py
# Copyright 2006-2021 the Mako authors and contributors <see AUTHORS file>
# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
@ -74,12 +74,11 @@ class Lexer:
(start, end) = match.span()
self.match_position = end + 1 if end == start else end
self.matched_lineno = self.lineno
lines = re.findall(r"\n", self.text[mp : self.match_position])
cp = mp - 1
while cp >= 0 and cp < self.textlength and self.text[cp] != "\n":
cp -= 1
if cp >= 0 and cp < self.textlength:
cp = self.text[: cp + 1].rfind("\n")
self.matched_charpos = mp - cp
self.lineno += len(lines)
self.lineno += self.text[mp : self.match_position].count("\n")
return match
def parse_until_text(self, watch_nesting, *text):
@ -273,20 +272,24 @@ class Lexer:
return self.template
def match_tag_start(self):
match = self.match(
r"""
reg = r"""
\<% # opening tag
([\w\.\:]+) # keyword
((?:\s+\w+|\s*=\s*|".*?"|'.*?')*) # attrname, = \
((?:\s+\w+|\s*=\s*|"[^"]*?"|'[^']*?'|\s*,\s*)*) # attrname, = \
# sign, string expression
# comma is for backwards compat
# identified in #366
\s* # more whitespace
(/)?> # closing
""",
"""
match = self.match(
reg,
re.I | re.S | re.X,
)
@ -319,7 +322,7 @@ class Lexer:
return True
def match_tag_end(self):
match = self.match(r"\</%[\t ]*(.+?)[\t ]*>")
match = self.match(r"\</%[\t ]*([^\t ]+?)[\t ]*>")
if match:
if not len(self.tag):
raise exceptions.SyntaxException(

View file

@ -1,5 +1,5 @@
# mako/lookup.py
# Copyright 2006-2021 the Mako authors and contributors <see AUTHORS file>
# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php

View file

@ -1,5 +1,5 @@
# mako/parsetree.py
# Copyright 2006-2021 the Mako authors and contributors <see AUTHORS file>
# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php

View file

@ -1,5 +1,5 @@
# mako/pygen.py
# Copyright 2006-2021 the Mako authors and contributors <see AUTHORS file>
# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
@ -43,6 +43,15 @@ class PythonPrinter:
# source lines
self.source_map = {}
self._re_space_comment = re.compile(r"^\s*#")
self._re_space = re.compile(r"^\s*$")
self._re_indent = re.compile(r":[ \t]*(?:#.*)?$")
self._re_compound = re.compile(r"^\s*(if|try|elif|while|for|with)")
self._re_indent_keyword = re.compile(
r"^\s*(def|class|else|elif|except|finally)"
)
self._re_unindentor = re.compile(r"^\s*(else|elif|except|finally).*\:")
def _update_lineno(self, num):
self.lineno += num
@ -86,8 +95,8 @@ class PythonPrinter:
if (
line is None
or re.match(r"^\s*#", line)
or re.match(r"^\s*$", line)
or self._re_space_comment.match(line)
or self._re_space.match(line)
):
hastext = False
else:
@ -121,12 +130,12 @@ class PythonPrinter:
# note that a line can both decrase (before printing) and
# then increase (after printing) the indentation level.
if re.search(r":[ \t]*(?:#.*)?$", line):
if self._re_indent.search(line):
# increment indentation count, and also
# keep track of what the keyword was that indented us,
# if it is a python compound statement keyword
# where we might have to look for an "unindent" keyword
match = re.match(r"^\s*(if|try|elif|while|for|with)", line)
match = self._re_compound.match(line)
if match:
# its a "compound" keyword, so we will check for "unindentors"
indentor = match.group(1)
@ -137,9 +146,7 @@ class PythonPrinter:
# its not a "compound" keyword. but lets also
# test for valid Python keywords that might be indenting us,
# else assume its a non-indenting line
m2 = re.match(
r"^\s*(def|class|else|elif|except|finally)", line
)
m2 = self._re_indent_keyword.match(line)
if m2:
self.indent += 1
self.indent_detail.append(indentor)
@ -167,7 +174,7 @@ class PythonPrinter:
# if the current line doesnt have one of the "unindentor" keywords,
# return False
match = re.match(r"^\s*(else|elif|except|finally).*\:", line)
match = self._re_unindentor.match(line)
# if True, whitespace matches up, we have a compound indentor,
# and this line has an unindentor, this
# is probably good enough
@ -193,6 +200,9 @@ class PythonPrinter:
stripspace is a string of space that will be truncated from the
start of the line before indenting."""
if stripspace == "":
# Fast path optimization.
return self.indentstring * self.indent + line
return re.sub(
r"^%s" % stripspace, self.indentstring * self.indent, line

View file

@ -1,5 +1,5 @@
# mako/pyparser.py
# Copyright 2006-2021 the Mako authors and contributors <see AUTHORS file>
# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php

View file

@ -1,5 +1,5 @@
# mako/template.py
# Copyright 2006-2021 the Mako authors and contributors <see AUTHORS file>
# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php

View file

@ -80,6 +80,16 @@ class TemplateTest:
output = filters(output)
eq_(output, expected)
def indicates_unbound_local_error(self, rendered_output, unbound_var):
var = f"&#39;{unbound_var}&#39;"
error_msgs = (
# < 3.11
f"local variable {var} referenced before assignment",
# >= 3.11
f"cannot access local variable {var} where it is not associated",
)
return any((msg in rendered_output) for msg in error_msgs)
class PlainCacheImpl(CacheImpl):
"""Simple memory cache impl so that tests which

View file

@ -1,5 +1,5 @@
# mako/util.py
# Copyright 2006-2021 the Mako authors and contributors <see AUTHORS file>
# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php

View file

@ -22,7 +22,7 @@ importlib-metadata==5.0.0
importlib-resources==5.10.0
git+https://github.com/Tautulli/ipwhois.git@master#egg=ipwhois
IPy==1.01
Mako==1.2.0
Mako==1.2.3
MarkupSafe==2.1.1
musicbrainzngs==0.7.1
packaging==21.3