Skip to content

Commit 5d9ece6

Browse files
committed
Merge branch '3.1.x'
2 parents e740cc6 + bf25151 commit 5d9ece6

File tree

10 files changed

+41
-43
lines changed

10 files changed

+41
-43
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,27 @@ ci:
33
autoupdate_schedule: monthly
44
repos:
55
- repo: https://github.com/asottile/pyupgrade
6-
rev: v2.34.0
6+
rev: v3.1.0
77
hooks:
88
- id: pyupgrade
99
args: ["--py37-plus"]
1010
- repo: https://github.com/asottile/reorder_python_imports
11-
rev: v3.3.0
11+
rev: v3.8.4
1212
hooks:
1313
- id: reorder-python-imports
1414
args: ["--application-directories", "src"]
1515
additional_dependencies: ["setuptools>60.9"]
1616
- repo: https://github.com/psf/black
17-
rev: 22.6.0
17+
rev: 22.10.0
1818
hooks:
1919
- id: black
2020
- repo: https://github.com/PyCQA/flake8
21-
rev: 4.0.1
21+
rev: 5.0.4
2222
hooks:
2323
- id: flake8
2424
additional_dependencies: [flake8-bugbear]
2525
- repo: https://github.com/peterdemin/pip-compile-multi
26-
rev: v2.4.5
26+
rev: v2.4.6
2727
hooks:
2828
- id: pip-compile-multi-verify
2929
- repo: https://github.com/pre-commit/pre-commit-hooks

docs/api.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -751,8 +751,8 @@ Now it can be used in templates:
751751
{% endif %}
752752

753753
Some decorators are available to tell Jinja to pass extra information to
754-
the filter. The object is passed as the first argument, making the value
755-
being filtered the second argument.
754+
the test. The object is passed as the first argument, making the value
755+
being tested the second argument.
756756

757757
- :func:`pass_environment` passes the :class:`Environment`.
758758
- :func:`pass_eval_context` passes the :ref:`eval-context`.

docs/integration.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,4 @@ this add this to ``config/environment.py``:
9191
9292
config['pylons.strict_c'] = True
9393
94-
.. _Pylons: https://pylonshq.com/
94+
.. _Pylons: https://pylonsproject.org/

docs/switching.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ In Django, the special variable for the loop context is called
8484
.. code-block:: django
8585
8686
{% for item in items %}
87-
{{ item }}
87+
{{ forloop.counter }}. {{ item }}
8888
{% empty %}
8989
No items!
9090
{% endfor %}
@@ -95,7 +95,7 @@ and the ``else`` block is used for no loop items.
9595
.. code-block:: jinja
9696
9797
{% for item in items %}
98-
{{ loop.index}}. {{ item }}
98+
{{ loop.index }}. {{ item }}
9999
{% else %}
100100
No items!
101101
{% endfor %}

docs/templates.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,6 +1015,9 @@ template data. Just wrap the code in the special `filter` section::
10151015
This text becomes uppercase
10161016
{% endfilter %}
10171017

1018+
Filters that accept arguments can be called like this::
1019+
1020+
{% filter center(100) %}Center this{% endfilter %}
10181021

10191022
.. _assignments:
10201023

@@ -1608,8 +1611,7 @@ The following functions are available in the global scope by default:
16081611

16091612
.. versionadded:: 2.1
16101613

1611-
.. method:: current
1612-
:property:
1614+
.. property:: current
16131615

16141616
Return the current item. Equivalent to the item that will be
16151617
returned next time :meth:`next` is called.

requirements/dev.txt

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,41 +16,37 @@ click==8.1.3
1616
# via
1717
# pip-compile-multi
1818
# pip-tools
19-
distlib==0.3.4
19+
distlib==0.3.6
2020
# via virtualenv
21-
filelock==3.7.1
21+
filelock==3.8.0
2222
# via
2323
# tox
2424
# virtualenv
25-
identify==2.5.1
25+
identify==2.5.6
2626
# via pre-commit
2727
nodeenv==1.7.0
2828
# via pre-commit
29-
pep517==0.12.0
29+
pep517==0.13.0
3030
# via build
31-
pip-compile-multi==2.4.5
31+
pip-compile-multi==2.4.6
3232
# via -r requirements/dev.in
33-
pip-tools==6.8.0
33+
pip-tools==6.9.0
3434
# via pip-compile-multi
3535
platformdirs==2.5.2
3636
# via virtualenv
37-
pre-commit==2.19.0
37+
pre-commit==2.20.0
3838
# via -r requirements/dev.in
3939
pyyaml==6.0
4040
# via pre-commit
4141
six==1.16.0
42-
# via
43-
# tox
44-
# virtualenv
42+
# via tox
4543
toml==0.10.2
46-
# via
47-
# pre-commit
48-
# tox
44+
# via pre-commit
4945
toposort==1.7
5046
# via pip-compile-multi
51-
tox==3.25.1
47+
tox==3.26.0
5248
# via -r requirements/dev.in
53-
virtualenv==20.15.1
49+
virtualenv==20.16.5
5450
# via
5551
# pre-commit
5652
# tox

requirements/docs.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ alabaster==0.7.12
99
# via sphinx
1010
babel==2.10.3
1111
# via sphinx
12-
certifi==2022.6.15
12+
certifi==2022.9.24
1313
# via requests
14-
charset-normalizer==2.1.0
14+
charset-normalizer==2.1.1
1515
# via requests
16-
docutils==0.18.1
16+
docutils==0.19
1717
# via sphinx
18-
idna==3.3
18+
idna==3.4
1919
# via requests
2020
imagesize==1.4.1
2121
# via sphinx
@@ -29,17 +29,17 @@ packaging==21.3
2929
# sphinx
3030
pallets-sphinx-themes==2.0.2
3131
# via -r requirements/docs.in
32-
pygments==2.12.0
32+
pygments==2.13.0
3333
# via sphinx
3434
pyparsing==3.0.9
3535
# via packaging
36-
pytz==2022.1
36+
pytz==2022.4
3737
# via babel
3838
requests==2.28.1
3939
# via sphinx
4040
snowballstemmer==2.2.0
4141
# via sphinx
42-
sphinx==5.0.2
42+
sphinx==5.2.3
4343
# via
4444
# -r requirements/docs.in
4545
# pallets-sphinx-themes
@@ -61,5 +61,5 @@ sphinxcontrib-qthelp==1.0.3
6161
# via sphinx
6262
sphinxcontrib-serializinghtml==1.1.5
6363
# via sphinx
64-
urllib3==1.26.9
64+
urllib3==1.26.12
6565
# via requests

requirements/tests.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#
66
# pip-compile-multi
77
#
8-
attrs==21.4.0
8+
attrs==22.1.0
99
# via pytest
1010
iniconfig==1.1.1
1111
# via pytest
@@ -17,7 +17,7 @@ py==1.11.0
1717
# via pytest
1818
pyparsing==3.0.9
1919
# via packaging
20-
pytest==7.1.2
20+
pytest==7.1.3
2121
# via -r requirements/tests.in
2222
tomli==2.0.1
2323
# via pytest

requirements/typing.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
#
66
# pip-compile-multi
77
#
8-
mypy==0.961
8+
mypy==0.982
99
# via -r requirements/typing.in
1010
mypy-extensions==0.4.3
1111
# via mypy
1212
tomli==2.0.1
1313
# via mypy
14-
typing-extensions==4.3.0
14+
typing-extensions==4.4.0
1515
# via mypy

src/jinja2/environment.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,7 +1253,7 @@ def _from_namespace(
12531253
t.blocks = namespace["blocks"]
12541254

12551255
# render function and module
1256-
t.root_render_func = namespace["root"] # type: ignore
1256+
t.root_render_func = namespace["root"]
12571257
t._module = None
12581258

12591259
# debug and loader helpers
@@ -1349,7 +1349,7 @@ async def to_list() -> t.List[str]:
13491349
ctx = self.new_context(dict(*args, **kwargs))
13501350

13511351
try:
1352-
yield from self.root_render_func(ctx) # type: ignore
1352+
yield from self.root_render_func(ctx)
13531353
except Exception:
13541354
yield self.environment.handle_exception()
13551355

@@ -1532,7 +1532,7 @@ def __init__(
15321532
" API you are using."
15331533
)
15341534

1535-
body_stream = list(template.root_render_func(context)) # type: ignore
1535+
body_stream = list(template.root_render_func(context))
15361536

15371537
self._body_stream = body_stream
15381538
self.__dict__.update(context.get_exported())
@@ -1564,7 +1564,7 @@ def __init__(self, template: Template, undefined_to_none: bool) -> None:
15641564

15651565
def __call__(self, *args: t.Any, **kwargs: t.Any) -> t.Optional[t.Any]:
15661566
context = self._template.new_context(dict(*args, **kwargs))
1567-
consume(self._template.root_render_func(context)) # type: ignore
1567+
consume(self._template.root_render_func(context))
15681568
rv = context.vars["result"]
15691569
if self._undefined_to_none and isinstance(rv, Undefined):
15701570
rv = None

0 commit comments

Comments
 (0)