Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-Jinja2 for openSUSE:Factory checked in at 2021-11-18 10:33:13 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-Jinja2 (Old) and /work/SRC/openSUSE:Factory/.python-Jinja2.new.1895 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-Jinja2" Thu Nov 18 10:33:13 2021 rev:46 rq:931805 version:3.0.3 Changes: -------- --- /work/SRC/openSUSE:Factory/python-Jinja2/python-Jinja2.changes 2021-10-20 20:23:58.961366904 +0200 +++ /work/SRC/openSUSE:Factory/.python-Jinja2.new.1895/python-Jinja2.changes 2021-11-18 10:33:35.703894084 +0100 @@ -1,0 +2,11 @@ +Sun Nov 14 14:59:31 UTC 2021 - Michael Str??der <mich...@stroeder.com> + +- update to 3.0.3 + * Fix traceback rewriting internals for Python 3.10 and 3.11. (#1535) + * Fix how the native environment treats leading and trailing spaces + when parsing values on Python 3.10. (PR#1537) + * Improve async performance by avoiding checks for common types. (#1514) + * Revert change to ``hash(Node)`` behavior. Nodes are hashed by id again (#1521) + * ``PackageLoader`` works when the package is a single module file. (#1512) + +------------------------------------------------------------------- Old: ---- Jinja2-3.0.2.tar.gz New: ---- Jinja2-3.0.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-Jinja2.spec ++++++ --- /var/tmp/diff_new_pack.GojOjQ/_old 2021-11-18 10:33:36.215894561 +0100 +++ /var/tmp/diff_new_pack.GojOjQ/_new 2021-11-18 10:33:36.215894561 +0100 @@ -24,7 +24,7 @@ %bcond_without test %endif Name: python-Jinja2 -Version: 3.0.2 +Version: 3.0.3 Release: 0 Summary: A template engine written in pure Python License: BSD-3-Clause ++++++ Jinja2-3.0.2.tar.gz -> Jinja2-3.0.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Jinja2-3.0.2/CHANGES.rst new/Jinja2-3.0.3/CHANGES.rst --- old/Jinja2-3.0.2/CHANGES.rst 2021-10-05 02:48:02.000000000 +0200 +++ new/Jinja2-3.0.3/CHANGES.rst 2021-11-09 21:25:25.000000000 +0100 @@ -1,5 +1,22 @@ .. currentmodule:: jinja2 +Version 3.0.3 +------------- + +Released 2021-11-09 + +- Fix traceback rewriting internals for Python 3.10 and 3.11. + :issue:`1535` +- Fix how the native environment treats leading and trailing spaces + when parsing values on Python 3.10. :pr:`1537` +- Improve async performance by avoiding checks for common types. + :issue:`1514` +- Revert change to ``hash(Node)`` behavior. Nodes are hashed by id + again :issue:`1521` +- ``PackageLoader`` works when the package is a single module file. + :issue:`1512` + + Version 3.0.2 ------------- @@ -408,7 +425,7 @@ possible. For more information and a discussion see :issue:`641` - Resolved an issue where ``block scoped`` would not take advantage of the new scoping rules. In some more exotic cases a variable - overriden in a local scope would not make it into a block. + overridden in a local scope would not make it into a block. - Change the code generation of the ``with`` statement to be in line with the new scoping rules. This resolves some unlikely bugs in edge cases. This also introduces a new internal ``With`` node that can be diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Jinja2-3.0.2/PKG-INFO new/Jinja2-3.0.3/PKG-INFO --- old/Jinja2-3.0.2/PKG-INFO 2021-10-05 02:48:54.677827000 +0200 +++ new/Jinja2-3.0.3/PKG-INFO 2021-11-09 21:26:28.880435500 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: Jinja2 -Version: 3.0.2 +Version: 3.0.3 Summary: A very fast and expressive template engine. Home-page: https://palletsprojects.com/p/jinja/ Author: Armin Ronacher diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Jinja2-3.0.2/docs/templates.rst new/Jinja2-3.0.3/docs/templates.rst --- old/Jinja2-3.0.2/docs/templates.rst 2021-05-12 01:25:55.000000000 +0200 +++ new/Jinja2-3.0.3/docs/templates.rst 2021-11-09 20:04:05.000000000 +0100 @@ -587,17 +587,26 @@ Template Objects ~~~~~~~~~~~~~~~~ -.. versionchanged:: 2.4 +``extends``, ``include``, and ``import`` can take a template object +instead of the name of a template to load. This could be useful in some +advanced situations, since you can use Python code to load a template +first and pass it in to ``render``. + +.. code-block:: python + + if debug_mode: + layout = env.get_template("debug_layout.html") + else: + layout = env.get_template("layout.html") + + user_detail = env.get_template("user/detail.html", layout=layout) -If a template object was passed in the template context, you can -extend from that object as well. Assuming the calling code passes -a layout template as `layout_template` to the environment, this -code works:: +.. code-block:: jinja - {% extends layout_template %} + {% extends layout %} -Previously, the `layout_template` variable had to be a string with -the layout template's filename for this to work. +Note how ``extends`` is passed the variable with the template object +that was passed to ``render``, instead of a string. HTML Escaping @@ -914,9 +923,6 @@ `arguments` A tuple of the names of arguments the macro accepts. -`defaults` - A tuple of default values. - `catch_kwargs` This is `true` if the macro accepts extra keyword arguments (i.e.: accesses the special `kwargs` variable). @@ -1338,8 +1344,19 @@ ``{{ '=' * 80 }}`` would print a bar of 80 equal signs. ``**`` - Raise the left operand to the power of the right operand. ``{{ 2**3 }}`` - would return ``8``. + Raise the left operand to the power of the right operand. + ``{{ 2**3 }}`` would return ``8``. + + Unlike Python, chained pow is evaluated left to right. + ``{{ 3**3**3 }}`` is evaluated as ``(3**3)**3`` in Jinja, but would + be evaluated as ``3**(3**3)`` in Python. Use parentheses in Jinja + to be explicit about what order you want. It is usually preferable + to do extended math in Python and pass the results to ``render`` + rather than doing it in the template. + + This behavior may be changed in the future to match Python, if it's + possible to introduce an upgrade path. + Comparisons ~~~~~~~~~~~ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Jinja2-3.0.2/requirements/dev.txt new/Jinja2-3.0.3/requirements/dev.txt --- old/Jinja2-3.0.2/requirements/dev.txt 2021-10-04 22:41:58.000000000 +0200 +++ new/Jinja2-3.0.3/requirements/dev.txt 2021-11-09 18:17:58.000000000 +0100 @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile +# This file is autogenerated by pip-compile with python 3.10 # To update, run: # # pip-compile requirements/dev.in @@ -12,41 +12,41 @@ # via sphinx backports.entry-points-selectable==1.1.0 # via virtualenv -certifi==2021.5.30 +certifi==2021.10.8 # via requests cfgv==3.3.1 # via pre-commit -charset-normalizer==2.0.6 +charset-normalizer==2.0.7 # via requests -click==8.0.1 +click==8.0.3 # via pip-tools distlib==0.3.3 # via virtualenv docutils==0.17.1 # via sphinx -filelock==3.3.0 +filelock==3.3.2 # via # tox # virtualenv -identify==2.3.0 +identify==2.3.3 # via pre-commit -idna==3.2 +idna==3.3 # via requests imagesize==1.2.0 # via sphinx iniconfig==1.1.1 # via pytest -jinja2==3.0.1 +jinja2==3.0.2 # via sphinx markupsafe==2.0.1 # via jinja2 -mypy-extensions==0.4.3 - # via mypy mypy==0.910 # via -r requirements/typing.in +mypy-extensions==0.4.3 + # via mypy nodeenv==1.6.0 # via pre-commit -packaging==21.0 +packaging==21.2 # via # pallets-sphinx-themes # pytest @@ -54,9 +54,9 @@ # tox pallets-sphinx-themes==2.0.1 # via -r requirements/docs.in -pep517==0.11.0 +pep517==0.12.0 # via pip-tools -pip-tools==6.3.0 +pip-tools==6.4.0 # via -r requirements/dev.in platformdirs==2.4.0 # via virtualenv @@ -66,7 +66,7 @@ # tox pre-commit==2.15.0 # via -r requirements/dev.in -py==1.10.0 +py==1.11.0 # via # pytest # tox @@ -78,7 +78,7 @@ # via -r requirements/tests.in pytz==2021.3 # via babel -pyyaml==5.4.1 +pyyaml==6.0 # via pre-commit requests==2.26.0 # via sphinx @@ -88,14 +88,14 @@ # virtualenv snowballstemmer==2.1.0 # via sphinx -sphinx-issues==1.2.0 - # via -r requirements/docs.in sphinx==4.2.0 # via # -r requirements/docs.in # pallets-sphinx-themes # sphinx-issues # sphinxcontrib-log-cabinet +sphinx-issues==1.2.0 + # via -r requirements/docs.in sphinxcontrib-applehelp==1.0.2 # via sphinx sphinxcontrib-devhelp==1.0.2 @@ -116,7 +116,7 @@ # pre-commit # pytest # tox -tomli==1.2.1 +tomli==1.2.2 # via pep517 tox==3.24.4 # via -r requirements/dev.in @@ -124,7 +124,7 @@ # via mypy urllib3==1.26.7 # via requests -virtualenv==20.8.1 +virtualenv==20.10.0 # via # pre-commit # tox diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Jinja2-3.0.2/requirements/docs.txt new/Jinja2-3.0.3/requirements/docs.txt --- old/Jinja2-3.0.2/requirements/docs.txt 2021-10-04 22:41:58.000000000 +0200 +++ new/Jinja2-3.0.3/requirements/docs.txt 2021-11-09 18:17:58.000000000 +0100 @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile +# This file is autogenerated by pip-compile with python 3.10 # To update, run: # # pip-compile requirements/docs.in @@ -8,21 +8,21 @@ # via sphinx babel==2.9.1 # via sphinx -certifi==2021.5.30 +certifi==2021.10.8 # via requests -charset-normalizer==2.0.6 +charset-normalizer==2.0.7 # via requests docutils==0.17.1 # via sphinx -idna==3.2 +idna==3.3 # via requests imagesize==1.2.0 # via sphinx -jinja2==3.0.1 +jinja2==3.0.2 # via sphinx markupsafe==2.0.1 # via jinja2 -packaging==21.0 +packaging==21.2 # via # pallets-sphinx-themes # sphinx @@ -38,14 +38,14 @@ # via sphinx snowballstemmer==2.1.0 # via sphinx -sphinx-issues==1.2.0 - # via -r requirements/docs.in sphinx==4.2.0 # via # -r requirements/docs.in # pallets-sphinx-themes # sphinx-issues # sphinxcontrib-log-cabinet +sphinx-issues==1.2.0 + # via -r requirements/docs.in sphinxcontrib-applehelp==1.0.2 # via sphinx sphinxcontrib-devhelp==1.0.2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Jinja2-3.0.2/requirements/tests.txt new/Jinja2-3.0.3/requirements/tests.txt --- old/Jinja2-3.0.2/requirements/tests.txt 2021-10-04 22:41:58.000000000 +0200 +++ new/Jinja2-3.0.3/requirements/tests.txt 2021-11-09 18:17:58.000000000 +0100 @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile +# This file is autogenerated by pip-compile with python 3.10 # To update, run: # # pip-compile requirements/tests.in @@ -8,11 +8,11 @@ # via pytest iniconfig==1.1.1 # via pytest -packaging==21.0 +packaging==21.2 # via pytest pluggy==1.0.0 # via pytest -py==1.10.0 +py==1.11.0 # via pytest pyparsing==2.4.7 # via packaging diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Jinja2-3.0.2/requirements/typing.txt new/Jinja2-3.0.3/requirements/typing.txt --- old/Jinja2-3.0.2/requirements/typing.txt 2021-10-04 22:41:58.000000000 +0200 +++ new/Jinja2-3.0.3/requirements/typing.txt 2021-11-09 18:17:58.000000000 +0100 @@ -1,13 +1,13 @@ # -# This file is autogenerated by pip-compile +# This file is autogenerated by pip-compile with python 3.10 # To update, run: # # pip-compile requirements/typing.in # -mypy-extensions==0.4.3 - # via mypy mypy==0.910 # via -r requirements/typing.in +mypy-extensions==0.4.3 + # via mypy toml==0.10.2 # via mypy typing-extensions==3.10.0.2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Jinja2-3.0.2/src/Jinja2.egg-info/PKG-INFO new/Jinja2-3.0.3/src/Jinja2.egg-info/PKG-INFO --- old/Jinja2-3.0.2/src/Jinja2.egg-info/PKG-INFO 2021-10-05 02:48:54.000000000 +0200 +++ new/Jinja2-3.0.3/src/Jinja2.egg-info/PKG-INFO 2021-11-09 21:26:28.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: Jinja2 -Version: 3.0.2 +Version: 3.0.3 Summary: A very fast and expressive template engine. Home-page: https://palletsprojects.com/p/jinja/ Author: Armin Ronacher diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Jinja2-3.0.2/src/Jinja2.egg-info/SOURCES.txt new/Jinja2-3.0.3/src/Jinja2.egg-info/SOURCES.txt --- old/Jinja2-3.0.2/src/Jinja2.egg-info/SOURCES.txt 2021-10-05 02:48:54.000000000 +0200 +++ new/Jinja2-3.0.3/src/Jinja2.egg-info/SOURCES.txt 2021-11-09 21:26:28.000000000 +0100 @@ -88,6 +88,7 @@ tests/test_lexnparse.py tests/test_loader.py tests/test_nativetypes.py +tests/test_nodes.py tests/test_regression.py tests/test_runtime.py tests/test_security.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Jinja2-3.0.2/src/jinja2/__init__.py new/Jinja2-3.0.3/src/jinja2/__init__.py --- old/Jinja2-3.0.2/src/jinja2/__init__.py 2021-10-05 02:48:02.000000000 +0200 +++ new/Jinja2-3.0.3/src/jinja2/__init__.py 2021-11-09 21:25:25.000000000 +0100 @@ -42,4 +42,4 @@ from .utils import pass_eval_context as pass_eval_context from .utils import select_autoescape as select_autoescape -__version__ = "3.0.2" +__version__ = "3.0.3" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Jinja2-3.0.2/src/jinja2/async_utils.py new/Jinja2-3.0.3/src/jinja2/async_utils.py --- old/Jinja2-3.0.2/src/jinja2/async_utils.py 2021-05-18 19:40:19.000000000 +0200 +++ new/Jinja2-3.0.3/src/jinja2/async_utils.py 2021-11-09 18:17:58.000000000 +0100 @@ -44,7 +44,14 @@ return decorator +_common_primitives = {int, float, bool, str, list, dict, tuple, type(None)} + + async def auto_await(value: t.Union[t.Awaitable["V"], "V"]) -> "V": + # Avoid a costly call to isawaitable + if type(value) in _common_primitives: + return t.cast("V", value) + if inspect.isawaitable(value): return await t.cast("t.Awaitable[V]", value) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Jinja2-3.0.2/src/jinja2/debug.py new/Jinja2-3.0.3/src/jinja2/debug.py --- old/Jinja2-3.0.2/src/jinja2/debug.py 2021-05-10 15:52:40.000000000 +0200 +++ new/Jinja2-3.0.3/src/jinja2/debug.py 2021-11-09 18:17:58.000000000 +0100 @@ -102,62 +102,42 @@ "__jinja_exception__": exc_value, } # Raise an exception at the correct line number. - code = compile("\n" * (lineno - 1) + "raise __jinja_exception__", filename, "exec") + code: CodeType = compile( + "\n" * (lineno - 1) + "raise __jinja_exception__", filename, "exec" + ) # Build a new code object that points to the template file and # replaces the location with a block name. - try: - location = "template" + location = "template" - if tb is not None: - function = tb.tb_frame.f_code.co_name + if tb is not None: + function = tb.tb_frame.f_code.co_name - if function == "root": - location = "top-level template code" - elif function.startswith("block_"): - location = f"block {function[6:]!r}" - - # Collect arguments for the new code object. CodeType only - # accepts positional arguments, and arguments were inserted in - # new Python versions. - code_args = [] - - for attr in ( - "argcount", - "posonlyargcount", # Python 3.8 - "kwonlyargcount", - "nlocals", - "stacksize", - "flags", - "code", # codestring - "consts", # constants - "names", - "varnames", - ("filename", filename), - ("name", location), - "firstlineno", - "lnotab", - "freevars", - "cellvars", - "linetable", # Python 3.10 - ): - if isinstance(attr, tuple): - # Replace with given value. - code_args.append(attr[1]) - continue - - try: - # Copy original value if it exists. - code_args.append(getattr(code, "co_" + t.cast(str, attr))) - except AttributeError: - # Some arguments were added later. - continue - - code = CodeType(*code_args) - except Exception: - # Some environments such as Google App Engine don't support - # modifying code objects. - pass + if function == "root": + location = "top-level template code" + elif function.startswith("block_"): + location = f"block {function[6:]!r}" + + if sys.version_info >= (3, 8): + code = code.replace(co_name=location) + else: + code = CodeType( + code.co_argcount, + code.co_kwonlyargcount, + code.co_nlocals, + code.co_stacksize, + code.co_flags, + code.co_code, + code.co_consts, + code.co_names, + code.co_varnames, + code.co_filename, + location, + code.co_firstlineno, + code.co_lnotab, + code.co_freevars, + code.co_cellvars, + ) # Execute the new code, which is guaranteed to raise, and return # the new traceback without this frame. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Jinja2-3.0.2/src/jinja2/environment.py new/Jinja2-3.0.3/src/jinja2/environment.py --- old/Jinja2-3.0.2/src/jinja2/environment.py 2021-05-18 22:40:12.000000000 +0200 +++ new/Jinja2-3.0.3/src/jinja2/environment.py 2021-11-09 19:10:36.000000000 +0100 @@ -1115,33 +1115,20 @@ class Template: - """The central template object. This class represents a compiled template - and is used to evaluate it. + """A compiled template that can be rendered. - Normally the template object is generated from an :class:`Environment` but - it also has a constructor that makes it possible to create a template - instance directly using the constructor. It takes the same arguments as - the environment constructor but it's not possible to specify a loader. - - Every template object has a few methods and members that are guaranteed - to exist. However it's important that a template object should be - considered immutable. Modifications on the object are not supported. - - Template objects created from the constructor rather than an environment - do have an `environment` attribute that points to a temporary environment - that is probably shared with other templates created with the constructor - and compatible settings. - - >>> template = Template('Hello {{ name }}!') - >>> template.render(name='John Doe') == u'Hello John Doe!' - True - >>> stream = template.stream(name='John Doe') - >>> next(stream) == u'Hello John Doe!' - True - >>> next(stream) - Traceback (most recent call last): - ... - StopIteration + Use the methods on :class:`Environment` to create or load templates. + The environment is used to configure how templates are compiled and + behave. + + It is also possible to create a template object directly. This is + not usually recommended. The constructor takes most of the same + arguments as :class:`Environment`. All templates created with the + same environment arguments share the same ephemeral ``Environment`` + instance behind the scenes. + + A template object should be considered immutable. Modifications on + the object are not supported. """ #: Type of environment to create when creating a template directly diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Jinja2-3.0.2/src/jinja2/loaders.py new/Jinja2-3.0.3/src/jinja2/loaders.py --- old/Jinja2-3.0.2/src/jinja2/loaders.py 2021-10-05 02:47:12.000000000 +0200 +++ new/Jinja2-3.0.3/src/jinja2/loaders.py 2021-11-09 21:21:27.000000000 +0100 @@ -297,10 +297,18 @@ self._archive = loader.archive pkgdir = next(iter(spec.submodule_search_locations)) # type: ignore template_root = os.path.join(pkgdir, package_path) - elif spec.submodule_search_locations: - # This will be one element for regular packages and multiple - # for namespace packages. - for root in spec.submodule_search_locations: + else: + roots: t.List[str] = [] + + # One element for regular packages, multiple for namespace + # packages, or None for single module file. + if spec.submodule_search_locations: + roots.extend(spec.submodule_search_locations) + # A single module file, use the parent directory instead. + elif spec.origin is not None: + roots.append(os.path.dirname(spec.origin)) + + for root in roots: root = os.path.join(root, package_path) if os.path.isdir(root): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Jinja2-3.0.2/src/jinja2/nativetypes.py new/Jinja2-3.0.3/src/jinja2/nativetypes.py --- old/Jinja2-3.0.2/src/jinja2/nativetypes.py 2021-05-10 15:52:40.000000000 +0200 +++ new/Jinja2-3.0.3/src/jinja2/nativetypes.py 2021-11-09 18:17:58.000000000 +0100 @@ -1,5 +1,6 @@ import typing as t from ast import literal_eval +from ast import parse from itertools import chain from itertools import islice @@ -33,7 +34,12 @@ raw = "".join([str(v) for v in chain(head, values)]) try: - return literal_eval(raw) + return literal_eval( + # In Python 3.10+ ast.literal_eval removes leading spaces/tabs + # from the given string. For backwards compatibility we need to + # parse the string ourselves without removing leading spaces/tabs. + parse(raw, mode="eval") + ) except (ValueError, SyntaxError, MemoryError): return raw diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Jinja2-3.0.2/src/jinja2/nodes.py new/Jinja2-3.0.3/src/jinja2/nodes.py --- old/Jinja2-3.0.2/src/jinja2/nodes.py 2021-10-04 22:41:58.000000000 +0200 +++ new/Jinja2-3.0.3/src/jinja2/nodes.py 2021-11-09 18:18:01.000000000 +0100 @@ -241,8 +241,7 @@ return tuple(self.iter_fields()) == tuple(other.iter_fields()) - def __hash__(self) -> int: - return hash(tuple(self.iter_fields())) + __hash__ = object.__hash__ def __repr__(self) -> str: args_str = ", ".join(f"{a}={getattr(self, a, None)!r}" for a in self.fields) @@ -956,7 +955,7 @@ class FloorDiv(BinExpr): - """Divides the left by the right node and truncates conver the + """Divides the left by the right node and converts the result into an integer by truncating. """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Jinja2-3.0.2/tests/test_debug.py new/Jinja2-3.0.3/tests/test_debug.py --- old/Jinja2-3.0.2/tests/test_debug.py 2021-04-05 19:47:37.000000000 +0200 +++ new/Jinja2-3.0.3/tests/test_debug.py 2021-11-09 18:17:58.000000000 +0100 @@ -36,9 +36,11 @@ test, r""" File ".*?broken.html", line 2, in (top-level template code|<module>) - \{\{ fail\(\) \}\} + \{\{ fail\(\) \}\}( + \^{12})? File ".*debug?.pyc?", line \d+, in <lambda> - tmpl\.render\(fail=lambda: 1 / 0\) + tmpl\.render\(fail=lambda: 1 / 0\)( + ~~\^~~)? ZeroDivisionError: (int(eger)? )?division (or modulo )?by zero """, ) @@ -66,7 +68,8 @@ test, r""" File ".*debug.pyc?", line \d+, in test - raise TemplateSyntaxError\("wtf", 42\) + raise TemplateSyntaxError\("wtf", 42\)( + \^{36})? (jinja2\.exceptions\.)?TemplateSyntaxError: wtf line 42""", ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Jinja2-3.0.2/tests/test_inheritance.py new/Jinja2-3.0.3/tests/test_inheritance.py --- old/Jinja2-3.0.2/tests/test_inheritance.py 2021-05-12 01:25:55.000000000 +0200 +++ new/Jinja2-3.0.3/tests/test_inheritance.py 2021-11-09 18:18:01.000000000 +0100 @@ -37,7 +37,7 @@ {% block block1 %} {% if false %} {% block block2 %} - this should workd + this should work {% endblock %} {% endif %} {% endblock %} @@ -49,7 +49,7 @@ {% block block1 %} {% if false %} {% block block2 %} - this should workd + this should work {% endblock %} {% endif %} {% endblock %} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Jinja2-3.0.2/tests/test_loader.py new/Jinja2-3.0.3/tests/test_loader.py --- old/Jinja2-3.0.2/tests/test_loader.py 2021-10-05 02:47:12.000000000 +0200 +++ new/Jinja2-3.0.3/tests/test_loader.py 2021-11-09 21:21:27.000000000 +0100 @@ -314,6 +314,28 @@ @pytest.fixture() +def package_file_loader(monkeypatch): + monkeypatch.syspath_prepend(Path(__file__).parent / "res") + return PackageLoader("__init__") + + +@pytest.mark.parametrize( + ("template", "expect"), [("foo/test.html", "FOO"), ("test.html", "BAR")] +) +def test_package_file_source(package_file_loader, template, expect): + source, name, up_to_date = package_file_loader.get_source(None, template) + assert source.rstrip() == expect + assert name.endswith(os.path.join(*split_template_path(template))) + assert up_to_date() + + +def test_package_file_list(package_file_loader): + templates = package_file_loader.list_templates() + assert "foo/test.html" in templates + assert "test.html" in templates + + +@pytest.fixture() def package_zip_loader(monkeypatch): package_zip = (Path(__file__) / ".." / "res" / "package.zip").resolve() monkeypatch.syspath_prepend(package_zip) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Jinja2-3.0.2/tests/test_nativetypes.py new/Jinja2-3.0.3/tests/test_nativetypes.py --- old/Jinja2-3.0.2/tests/test_nativetypes.py 2021-04-09 23:59:18.000000000 +0200 +++ new/Jinja2-3.0.3/tests/test_nativetypes.py 2021-11-09 18:17:58.000000000 +0100 @@ -147,3 +147,9 @@ def test_spontaneous_env(): t = NativeTemplate("{{ true }}") assert isinstance(t.environment, NativeEnvironment) + + +def test_leading_spaces(env): + t = env.from_string(" {{ True }}") + result = t.render() + assert result == " True" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Jinja2-3.0.2/tests/test_nodes.py new/Jinja2-3.0.3/tests/test_nodes.py --- old/Jinja2-3.0.2/tests/test_nodes.py 1970-01-01 01:00:00.000000000 +0100 +++ new/Jinja2-3.0.3/tests/test_nodes.py 2021-11-09 18:17:58.000000000 +0100 @@ -0,0 +1,3 @@ +def test_template_hash(env): + template = env.parse("hash test") + hash(template) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Jinja2-3.0.2/tox.ini new/Jinja2-3.0.3/tox.ini --- old/Jinja2-3.0.2/tox.ini 2021-04-09 23:59:18.000000000 +0200 +++ new/Jinja2-3.0.3/tox.ini 2021-11-09 18:17:58.000000000 +0100 @@ -1,6 +1,6 @@ [tox] envlist = - py{39,38,37,36,py3} + py{311,310,39,38,37,36,py37} style typing docs