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
Provenance
- Commit
5d9ece6- Tree
3442544- Author
David Lord <davidism@gmail.com>- Committer
David Lord <davidism@gmail.com>- Parent 1
e740cc6- Parent 2
bf25151
10 files changed+41 added−43 removed
modified:docs/api.rst+2 added-2 removed
749 unmodified lines750 {{ value }} is not a prime number751 {% endif %}752 753 Some decorators are available to tell Jinja to pass extra information to754-the filter. The object is passed as the first argument, making the value755-being filtered the second argument.754+the test. The object is passed as the first argument, making the value755+being tested the second argument.756 757 - :func:`pass_environment` passes the :class:`Environment`.758 - :func:`pass_eval_context` passes the :ref:`eval-context`.759 - :func:`pass_context` passes the current163 unmodified linesmodified:docs/integration.rst+1 added-1 removed
89 unmodified lines90 .. code-block:: python91 92 config['pylons.strict_c'] = True93 94-.. _Pylons: https://pylonshq.com/94+.. _Pylons: https://pylonsproject.org/modified:docs/switching.rst+2 added-2 removed
82 unmodified lines83 84 .. code-block:: django85 86 {% for item in items %}87- {{ item }}87+ {{ forloop.counter }}. {{ item }}88 {% empty %}89 No items!90 {% endfor %}91 2 unmodified lines94 95 .. code-block:: jinja96 97 {% for item in items %}98- {{ loop.index}}. {{ item }}98+ {{ loop.index }}. {{ item }}99 {% else %}100 No items!101 {% endfor %}102 79 unmodified linesmodified:docs/templates.rst+4 added-2 removed
1013 unmodified lines1014 {% filter upper %}1015 This text becomes uppercase1016 {% endfilter %}1017 1018+Filters that accept arguments can be called like this::1019 1020+ {% filter center(100) %}Center this{% endfilter %}1021+1022 .. _assignments:1023 1024 Assignments1025 ~~~~~~~~~~~584 unmodified lines1610 given for each cycle.1611 1612 .. versionadded:: 2.11613 1611- .. method:: current1612- :property:1614+ .. property:: current1615 1616 Return the current item. Equivalent to the item that will be1617 returned next time :meth:`next` is called.1618 334 unmodified linesmodified:requirements/dev.txt+11 added-15 removed
14 unmodified lines15 click==8.1.316 # via17 # pip-compile-multi18 # pip-tools19-distlib==0.3.419+distlib==0.3.620 # via virtualenv21-filelock==3.7.121+filelock==3.8.022 # via23 # tox24 # virtualenv25-identify==2.5.125+identify==2.5.626 # via pre-commit27 nodeenv==1.7.028 # via pre-commit29-pep517==0.12.029+pep517==0.13.030 # via build31-pip-compile-multi==2.4.531+pip-compile-multi==2.4.632 # via -r requirements/dev.in33-pip-tools==6.8.033+pip-tools==6.9.034 # via pip-compile-multi35 platformdirs==2.5.236 # via virtualenv37-pre-commit==2.19.037+pre-commit==2.20.038 # via -r requirements/dev.in39 pyyaml==6.040 # via pre-commit41 six==1.16.042- # via43- # tox44- # virtualenv42+ # via tox43 toml==0.10.246- # via47- # pre-commit48- # tox44+ # via pre-commit45 toposort==1.746 # via pip-compile-multi51-tox==3.25.147+tox==3.26.048 # via -r requirements/dev.in53-virtualenv==20.15.149+virtualenv==20.16.550 # via51 # pre-commit52 # tox53 wheel==0.37.15 unmodified linesmodified:requirements/docs.txt+8 added-8 removed
7 unmodified lines8 alabaster==0.7.129 # via sphinx10 babel==2.10.311 # via sphinx12-certifi==2022.6.1512+certifi==2022.9.2413 # via requests14-charset-normalizer==2.1.014+charset-normalizer==2.1.115 # via requests16-docutils==0.18.116+docutils==0.1917 # via sphinx18-idna==3.318+idna==3.419 # via requests20 imagesize==1.4.121 # via sphinx22 jinja2==3.1.25 unmodified lines28 # pallets-sphinx-themes29 # sphinx30 pallets-sphinx-themes==2.0.231 # via -r requirements/docs.in32-pygments==2.12.032+pygments==2.13.033 # via sphinx34 pyparsing==3.0.935 # via packaging36-pytz==2022.136+pytz==2022.437 # via babel38 requests==2.28.139 # via sphinx40 snowballstemmer==2.2.041 # via sphinx42-sphinx==5.0.242+sphinx==5.2.343 # via44 # -r requirements/docs.in45 # pallets-sphinx-themes46 # sphinx-issues13 unmodified lines60 sphinxcontrib-qthelp==1.0.361 # via sphinx62 sphinxcontrib-serializinghtml==1.1.563 # via sphinx64-urllib3==1.26.964+urllib3==1.26.1265 # via requestsmodified:requirements/tests.txt+2 added-2 removed
3 unmodified lines4 # To update, run:5 #6 # pip-compile-multi7 #8-attrs==21.4.08+attrs==22.1.09 # via pytest10 iniconfig==1.1.111 # via pytest12 packaging==21.33 unmodified lines16 py==1.11.017 # via pytest18 pyparsing==3.0.919 # via packaging20-pytest==7.1.220+pytest==7.1.321 # via -r requirements/tests.in22 tomli==2.0.123 # via pytestmodified:requirements/typing.txt+2 added-2 removed
3 unmodified lines4 # To update, run:5 #6 # pip-compile-multi7 #8-mypy==0.9618+mypy==0.9829 # via -r requirements/typing.in10 mypy-extensions==0.4.311 # via mypy12 tomli==2.0.113 # via mypy14-typing-extensions==4.3.014+typing-extensions==4.4.015 # via mypymodified:src/jinja2/environment.py+4 added-4 removed
1251 unmodified lines1252 t.filename = namespace["__file__"]1253 t.blocks = namespace["blocks"]1254 1255 # render function and module1256- t.root_render_func = namespace["root"] # type: ignore1256+ t.root_render_func = namespace["root"]1257 t._module = None1258 1259 # debug and loader helpers1260 t._debug_info = namespace["debug_info"]87 unmodified lines1348 1349 ctx = self.new_context(dict(*args, **kwargs))1350 1351 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()1355 1356 async def generate_async(174 unmodified lines1531 " a template module. Use the async methods of the"1532 " API you are using."1533 )1534 1535- body_stream = list(template.root_render_func(context)) # type: ignore1535+ body_stream = list(template.root_render_func(context))1536 1537 self._body_stream = body_stream1538 self.__dict__.update(context.get_exported())1539 self.__name__ = template.name23 unmodified lines1563 self._undefined_to_none = undefined_to_none1564 1565 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 rv96 unmodified linesmodified:.pre-commit-config.yaml+5 added-5 removed
1 unmodified line2 autoupdate_branch: "3.1.x"3 autoupdate_schedule: monthly4 repos: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.04 unmodified lines