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
Provenance
- Commit
a0dd775- Tree
7c4ab1c- Author
David Lord <davidism@gmail.com>- Committer
David Lord <davidism@gmail.com>- Parent 1
c3a61d6- Parent 2
466a200
8 files changed+37 added−18 removed
modified:requirements/dev.txt+6 added-6 removed
24 unmodified lines25 nodeenv==1.6.026 # via pre-commit27 pep517==0.12.028 # via pip-tools29-pip-compile-multi==2.4.429+pip-compile-multi==2.4.530 # via -r requirements/dev.in31-pip-tools==6.5.131+pip-tools==6.6.032 # via pip-compile-multi33-platformdirs==2.5.133+platformdirs==2.5.234 # via virtualenv35-pre-commit==2.17.035+pre-commit==2.18.136 # via -r requirements/dev.in37 pyyaml==6.038 # via pre-commit39 six==1.16.05 unmodified lines45 # pre-commit46 # tox47 toposort==1.748 # via pip-compile-multi49-tox==3.24.549+tox==3.25.050 # via -r requirements/dev.in51-virtualenv==20.14.051+virtualenv==20.14.152 # via53 # pre-commit54 # tox55 wheel==0.37.15 unmodified linesmodified:requirements/docs.txt+3 added-3 removed
5 unmodified lines6 # pip-compile-multi7 #8 alabaster==0.7.129 # via sphinx10-babel==2.9.110+babel==2.10.111 # via sphinx12 certifi==2021.10.813 # via requests14 charset-normalizer==2.0.1213 unmodified lines28 # pallets-sphinx-themes29 # sphinx30 pallets-sphinx-themes==2.0.231 # via -r requirements/docs.in32-pygments==2.11.232+pygments==2.12.033 # via sphinx34-pyparsing==3.0.734+pyparsing==3.0.835 # via packaging36 pytz==2022.137 # via babel38 requests==2.27.127 unmodified linesmodified:requirements/tests.txt+2 added-2 removed
13 unmodified lines14 pluggy==1.0.015 # via pytest16 py==1.11.017 # via pytest18-pyparsing==3.0.718+pyparsing==3.0.819 # via packaging20-pytest==7.1.120+pytest==7.1.221 # via -r requirements/tests.in22 tomli==2.0.123 # via pytestmodified:requirements/typing.txt+1 added-1 removed
9 unmodified lines10 mypy-extensions==0.4.311 # via mypy12 tomli==2.0.113 # via mypy14-typing-extensions==4.1.114+typing-extensions==4.2.015 # via mypymodified:src/jinja2/environment.py+11 added-1 removed
391 unmodified lines392 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 line403 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 overlayed3 unmodified lines415 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.419+420+ .. 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"]426 427 rv = object.__new__(self.__class__)428 rv.__dict__.update(self.__dict__)429 rv.overlayed = True13 unmodified lines443 rv.extensions[key] = value.bind(rv)444 if extensions is not missing:445 rv.extensions.update(load_extensions(rv, extensions))446 447+ if enable_async is not missing:448+ rv.is_async = enable_async449+450 return _environment_config_check(rv)451 452 @property453 def lexer(self) -> Lexer:1214 unmodified linesmodified:src/jinja2/visitor.py+2 added-2 removed
41 unmodified lines42 return self.generic_visit(node, *args, **kwargs)43 44 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)48 49 50 class NodeTransformer(NodeVisitor):51 """Walks the abstract syntax tree and allows modifications of nodes.41 unmodified linesmodified:.pre-commit-config.yaml+3 added-3 removed
12345667891011 unmodified lines222324252626272829303031323334ci: autoupdate_branch: "3.0.x" autoupdate_schedule: monthlyrepos: - repo: https://github.com/asottile/pyupgrade rev: v2.31.1 rev: v2.32.0 hooks: - id: pyupgrade args: ["--py37-plus"] - repo: https://github.com/asottile/reorder_python_imports11 unmodified lines hooks: - id: flake8 additional_dependencies: [flake8-bugbear] - repo: https://github.com/peterdemin/pip-compile-multi rev: v2.4.4 rev: v2.4.5 hooks: - id: pip-compile-multi-verify - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.1.0 rev: v4.2.0 hooks: - id: fix-byte-order-marker - id: trailing-whitespace - id: end-of-file-fixermodified:CHANGES.rst+9 added
4 unmodified lines5 6 Unreleased7 8 9+Version 3.1.210+-------------11+12+Unreleased13+14+- Add parameters to ``Environment.overlay`` to match ``__init__``.15+ :issue:`1645`16+17+18 Version 3.1.119 -------------20 21 Released 2022-03-25959 unmodified lines