Skip to content
Myr

Merge branch '3.1.x'

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Lord · committed by David Lord · parents e740cc6, bf25151 · Browse files · 10 files+41 added−43 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

10 files+41 added−43 removed

  • other:+41 added−43 removed

10 files+41 added−43 removed

modified:docs/api.rst+2 added-2 removed
749 unmodified lines
750 {{ value }} is not a prime number751 {% endif %}752753Some decorators are available to tell Jinja to pass extra information to754the filter. The object is passed as the first argument, making the value755being filtered the second argument.754the test. The object is passed as the first argument, making the value755being tested the second argument.756757- :func:`pass_environment` passes the :class:`Environment`.758- :func:`pass_eval_context` passes the :ref:`eval-context`.759- :func:`pass_context` passes the current
163 unmodified lines
modified:docs/integration.rst+1 added-1 removed
89 unmodified lines
90.. code-block:: python9192 config['pylons.strict_c'] = True9394.. _Pylons: https://pylonshq.com/94.. _Pylons: https://pylonsproject.org/
modified:docs/switching.rst+2 added-2 removed
82 unmodified lines
8384.. code-block:: django8586 {% for item in items %}87 {{ item }}87 {{ forloop.counter }}. {{ item }}88 {% empty %}89 No items!90 {% endfor %}91
2 unmodified lines
9495.. code-block:: jinja9697 {% for item in items %}98 {{ loop.index}}. {{ item }}98 {{ loop.index }}. {{ item }}99 {% else %}100 No items!101 {% endfor %}102
79 unmodified lines
modified:docs/templates.rst+4 added-2 removed
1013 unmodified lines
1014 {% filter upper %}1015 This text becomes uppercase1016 {% endfilter %}10171018Filters that accept arguments can be called like this::10191020 {% filter center(100) %}Center this{% endfilter %}10211022.. _assignments:10231024Assignments1025~~~~~~~~~~~
584 unmodified lines
1610 given for each cycle.16111612 .. versionadded:: 2.116131611 .. method:: current1612 :property:1614 .. property:: current16151616 Return the current item. Equivalent to the item that will be1617 returned next time :meth:`next` is called.1618
334 unmodified lines
modified:requirements/dev.txt+11 added-15 removed
14 unmodified lines
15click==8.1.316 # via17 # pip-compile-multi18 # pip-tools19distlib==0.3.419distlib==0.3.620 # via virtualenv21filelock==3.7.121filelock==3.8.022 # via23 # tox24 # virtualenv25identify==2.5.125identify==2.5.626 # via pre-commit27nodeenv==1.7.028 # via pre-commit29pep517==0.12.029pep517==0.13.030 # via build31pip-compile-multi==2.4.531pip-compile-multi==2.4.632 # via -r requirements/dev.in33pip-tools==6.8.033pip-tools==6.9.034 # via pip-compile-multi35platformdirs==2.5.236 # via virtualenv37pre-commit==2.19.037pre-commit==2.20.038 # via -r requirements/dev.in39pyyaml==6.040 # via pre-commit41six==1.16.042 # via43 # tox44 # virtualenv42 # via tox43toml==0.10.246 # via47 # pre-commit48 # tox44 # via pre-commit45toposort==1.746 # via pip-compile-multi51tox==3.25.147tox==3.26.048 # via -r requirements/dev.in53virtualenv==20.15.149virtualenv==20.16.550 # via51 # pre-commit52 # tox53wheel==0.37.1
5 unmodified lines
modified:requirements/docs.txt+8 added-8 removed
7 unmodified lines
8alabaster==0.7.129 # via sphinx10babel==2.10.311 # via sphinx12certifi==2022.6.1512certifi==2022.9.2413 # via requests14charset-normalizer==2.1.014charset-normalizer==2.1.115 # via requests16docutils==0.18.116docutils==0.1917 # via sphinx18idna==3.318idna==3.419 # via requests20imagesize==1.4.121 # via sphinx22jinja2==3.1.2
5 unmodified lines
28 # pallets-sphinx-themes29 # sphinx30pallets-sphinx-themes==2.0.231 # via -r requirements/docs.in32pygments==2.12.032pygments==2.13.033 # via sphinx34pyparsing==3.0.935 # via packaging36pytz==2022.136pytz==2022.437 # via babel38requests==2.28.139 # via sphinx40snowballstemmer==2.2.041 # via sphinx42sphinx==5.0.242sphinx==5.2.343 # via44 # -r requirements/docs.in45 # pallets-sphinx-themes46 # sphinx-issues
13 unmodified lines
60sphinxcontrib-qthelp==1.0.361 # via sphinx62sphinxcontrib-serializinghtml==1.1.563 # via sphinx64urllib3==1.26.964urllib3==1.26.1265 # via requests
modified:requirements/tests.txt+2 added-2 removed
3 unmodified lines
4# To update, run:5#6# pip-compile-multi7#8attrs==21.4.08attrs==22.1.09 # via pytest10iniconfig==1.1.111 # via pytest12packaging==21.3
3 unmodified lines
16py==1.11.017 # via pytest18pyparsing==3.0.919 # via packaging20pytest==7.1.220pytest==7.1.321 # via -r requirements/tests.in22tomli==2.0.123 # via pytest
modified:requirements/typing.txt+2 added-2 removed
3 unmodified lines
4# To update, run:5#6# pip-compile-multi7#8mypy==0.9618mypy==0.9829 # via -r requirements/typing.in10mypy-extensions==0.4.311 # via mypy12tomli==2.0.113 # via mypy14typing-extensions==4.3.014typing-extensions==4.4.015 # via mypy
modified:src/jinja2/environment.py+4 added-4 removed
1251 unmodified lines
1252 t.filename = namespace["__file__"]1253 t.blocks = namespace["blocks"]12541255 # render function and module1256 t.root_render_func = namespace["root"] # type: ignore1256 t.root_render_func = namespace["root"]1257 t._module = None12581259 # debug and loader helpers1260 t._debug_info = namespace["debug_info"]
87 unmodified lines
13481349 ctx = self.new_context(dict(*args, **kwargs))13501351 try:1352 yield from self.root_render_func(ctx) # type: ignore1352 yield from self.root_render_func(ctx)1353 except Exception:1354 yield self.environment.handle_exception()13551356 async def generate_async(
174 unmodified lines
1531 " a template module. Use the async methods of the"1532 " API you are using."1533 )15341535 body_stream = list(template.root_render_func(context)) # type: ignore1535 body_stream = list(template.root_render_func(context))15361537 self._body_stream = body_stream1538 self.__dict__.update(context.get_exported())1539 self.__name__ = template.name
23 unmodified lines
1563 self._undefined_to_none = undefined_to_none15641565 def __call__(self, *args: t.Any, **kwargs: t.Any) -> t.Optional[t.Any]:1566 context = self._template.new_context(dict(*args, **kwargs))1567 consume(self._template.root_render_func(context)) # type: ignore1567 consume(self._template.root_render_func(context))1568 rv = context.vars["result"]1569 if self._undefined_to_none and isinstance(rv, Undefined):1570 rv = None1571 return rv
96 unmodified lines
modified:.pre-commit-config.yaml+5 added-5 removed
1 unmodified line
2 autoupdate_branch: "3.1.x"3 autoupdate_schedule: monthly4repos:5 - repo: https://github.com/asottile/pyupgrade6 rev: v2.34.06 rev: v3.1.07 hooks:8 - id: pyupgrade9 args: ["--py37-plus"]10 - repo: https://github.com/asottile/reorder_python_imports11 rev: v3.3.011 rev: v3.8.412 hooks:13 - id: reorder-python-imports14 args: ["--application-directories", "src"]15 additional_dependencies: ["setuptools>60.9"]16 - repo: https://github.com/psf/black17 rev: 22.6.017 rev: 22.10.018 hooks:19 - id: black20 - repo: https://github.com/PyCQA/flake821 rev: 4.0.121 rev: 5.0.422 hooks:23 - id: flake824 additional_dependencies: [flake8-bugbear]25 - repo: https://github.com/peterdemin/pip-compile-multi26 rev: v2.4.526 rev: v2.4.627 hooks:28 - id: pip-compile-multi-verify29 - repo: https://github.com/pre-commit/pre-commit-hooks30 rev: v4.3.0
4 unmodified lines