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 c3a61d6, 466a200 · Browse files · 8 files+37 added−18 removed
This commit

State

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

Diff stats

8 files+37 added−18 removed

  • other:+37 added−18 removed

8 files+37 added−18 removed

modified:requirements/dev.txt+6 added-6 removed
24 unmodified lines
25nodeenv==1.6.026 # via pre-commit27pep517==0.12.028 # via pip-tools29pip-compile-multi==2.4.429pip-compile-multi==2.4.530 # via -r requirements/dev.in31pip-tools==6.5.131pip-tools==6.6.032 # via pip-compile-multi33platformdirs==2.5.133platformdirs==2.5.234 # via virtualenv35pre-commit==2.17.035pre-commit==2.18.136 # via -r requirements/dev.in37pyyaml==6.038 # via pre-commit39six==1.16.0
5 unmodified lines
45 # pre-commit46 # tox47toposort==1.748 # via pip-compile-multi49tox==3.24.549tox==3.25.050 # via -r requirements/dev.in51virtualenv==20.14.051virtualenv==20.14.152 # via53 # pre-commit54 # tox55wheel==0.37.1
5 unmodified lines
modified:requirements/docs.txt+3 added-3 removed
5 unmodified lines
6# pip-compile-multi7#8alabaster==0.7.129 # via sphinx10babel==2.9.110babel==2.10.111 # via sphinx12certifi==2021.10.813 # via requests14charset-normalizer==2.0.12
13 unmodified lines
28 # pallets-sphinx-themes29 # sphinx30pallets-sphinx-themes==2.0.231 # via -r requirements/docs.in32pygments==2.11.232pygments==2.12.033 # via sphinx34pyparsing==3.0.734pyparsing==3.0.835 # via packaging36pytz==2022.137 # via babel38requests==2.27.1
27 unmodified lines
modified:requirements/tests.txt+2 added-2 removed
13 unmodified lines
14pluggy==1.0.015 # via pytest16py==1.11.017 # via pytest18pyparsing==3.0.718pyparsing==3.0.819 # via packaging20pytest==7.1.120pytest==7.1.221 # via -r requirements/tests.in22tomli==2.0.123 # via pytest
modified:requirements/typing.txt+1 added-1 removed
9 unmodified lines
10mypy-extensions==0.4.311 # via mypy12tomli==2.0.113 # via mypy14typing-extensions==4.1.114typing-extensions==4.2.015 # via mypy
modified:src/jinja2/environment.py+11 added-1 removed
391 unmodified lines
392 line_statement_prefix: t.Optional[str] = missing,393 line_comment_prefix: t.Optional[str] = missing,394 trim_blocks: bool = missing,395 lstrip_blocks: bool = missing,396 newline_sequence: "te.Literal['\\n', '\\r\\n', '\\r']" = missing,397 keep_trailing_newline: bool = missing,398 extensions: t.Sequence[t.Union[str, t.Type["Extension"]]] = missing,399 optimized: bool = missing,400 undefined: t.Type[Undefined] = missing,401 finalize: t.Optional[t.Callable[..., t.Any]] = missing,
1 unmodified line
403 loader: t.Optional["BaseLoader"] = missing,404 cache_size: int = missing,405 auto_reload: bool = missing,406 bytecode_cache: t.Optional["BytecodeCache"] = missing,407 enable_async: bool = False,408 ) -> "Environment":409 """Create a new overlay environment that shares all the data with the410 current environment except for cache and the overridden attributes.411 Extensions cannot be removed for an overlayed environment. An overlayed
3 unmodified lines
415 Creating overlays should happen after the initial environment was set416 up completely. Not all attributes are truly linked, some are just417 copied over so modifications on the original environment may not shine418 through.419420 .. versionchanged:: 3.1.2421 Added the ``newline_sequence``,, ``keep_trailing_newline``,422 and ``enable_async`` parameters to match ``__init__``.423 """424 args = dict(locals())418 del args["self"], args["cache_size"], args["extensions"]425 del args["self"], args["cache_size"], args["extensions"], args["enable_async"]426427 rv = object.__new__(self.__class__)428 rv.__dict__.update(self.__dict__)429 rv.overlayed = True
13 unmodified lines
443 rv.extensions[key] = value.bind(rv)444 if extensions is not missing:445 rv.extensions.update(load_extensions(rv, extensions))446447 if enable_async is not missing:448 rv.is_async = enable_async449450 return _environment_config_check(rv)451452 @property453 def lexer(self) -> Lexer:
1214 unmodified lines
modified:src/jinja2/visitor.py+2 added-2 removed
41 unmodified lines
42 return self.generic_visit(node, *args, **kwargs)4344 def generic_visit(self, node: Node, *args: t.Any, **kwargs: t.Any) -> t.Any:45 """Called if no explicit visitor function exists for a node."""46 for node in node.iter_child_nodes():47 self.visit(node, *args, **kwargs)46 for child_node in node.iter_child_nodes():47 self.visit(child_node, *args, **kwargs)484950class NodeTransformer(NodeVisitor):51 """Walks the abstract syntax tree and allows modifications of nodes.
41 unmodified lines
modified:.pre-commit-config.yaml+3 added-3 removed
modified:CHANGES.rst+9 added
4 unmodified lines
56Unreleased789Version 3.1.210-------------1112Unreleased1314- Add parameters to ``Environment.overlay`` to match ``__init__``.15 :issue:`1645`161718Version 3.1.119-------------2021Released 2022-03-25
959 unmodified lines