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 ae53ea5, 3fadee0 · Browse files · 12 files·+53 added−47 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
12 files+53 added−47 removed
- tests:+4 added−2 removed
- other:+49 added−45 removed
Provenance
- Commit
36b601f- Tree
00e6017- Author
David Lord <davidism@gmail.com>- Committer
David Lord <davidism@gmail.com>- Parent 1
ae53ea5- Parent 2
3fadee0
12 files changed+53 added−47 removed
modified:docs/templates.rst+1 added-1 removed
1170 unmodified lines1171 {% include ['page_detailed.html', 'page.html'] %}1172 {% include ['special_sidebar.html', 'sidebar.html'] ignore missing %}1173 1174 A variable, with either a template name or template object, can also be1175-passed to the statment.1175+passed to the statement.1176 1177 .. _import:1178 1179 Import773 unmodified linesmodified:requirements/dev.txt+21 added-15 removed
6 unmodified lines7 #8 -r docs.txt9 -r tests.txt10 -r typing.txt11-build==0.8.011+build==0.9.012 # via pip-tools13+cachetools==5.2.014+ # via tox15 cfgv==3.3.116 # via pre-commit17+chardet==5.1.018+ # via tox19 click==8.1.320 # via21 # pip-compile-multi22 # pip-tools23+colorama==0.4.624+ # via tox25 distlib==0.3.626 # via virtualenv21-filelock==3.8.027+filelock==3.9.028 # via29 # tox30 # virtualenv25-identify==2.5.631+identify==2.5.1132 # via pre-commit33 nodeenv==1.7.034 # via pre-commit35 pep517==0.13.036 # via build31-pip-compile-multi==2.4.637+pip-compile-multi==2.6.138 # via -r requirements/dev.in33-pip-tools==6.9.039+pip-tools==6.12.140 # via pip-compile-multi35-platformdirs==2.5.236- # via virtualenv37-pre-commit==2.20.041+platformdirs==2.6.242+ # via43+ # tox44+ # virtualenv45+pre-commit==2.21.046 # via -r requirements/dev.in47+pyproject-api==1.2.148+ # via tox49 pyyaml==6.050 # via pre-commit41-six==1.16.042- # via tox43-toml==0.10.244- # via pre-commit51 toposort==1.752 # via pip-compile-multi47-tox==3.26.053+tox==4.1.054 # via -r requirements/dev.in49-virtualenv==20.16.555+virtualenv==20.17.156 # via57 # pre-commit58 # tox53-wheel==0.37.159+wheel==0.38.460 # via pip-tools61 62 # The following packages are considered to be unsafe in a requirements file:63 # pip1 unmodified linemodified:requirements/docs.txt+7 added-9 removed
5 unmodified lines6 # pip-compile-multi7 #8 alabaster==0.7.129 # via sphinx10-babel==2.10.310+babel==2.11.011 # via sphinx12-certifi==2022.9.2412+certifi==2022.12.713 # via requests14 charset-normalizer==2.1.115 # via requests16 docutils==0.195 unmodified lines22 jinja2==3.1.223 # via sphinx24 markupsafe==2.1.125 # via jinja226-packaging==21.326+packaging==22.027 # via28 # pallets-sphinx-themes29 # sphinx30-pallets-sphinx-themes==2.0.230+pallets-sphinx-themes==2.0.331 # via -r requirements/docs.in32 pygments==2.13.033 # via sphinx34-pyparsing==3.0.935- # via packaging36-pytz==2022.434+pytz==2022.735 # via babel36 requests==2.28.137 # via sphinx38 snowballstemmer==2.2.039 # via sphinx42-sphinx==5.2.340+sphinx==6.0.041 # via42 # -r requirements/docs.in43 # pallets-sphinx-themes44 # sphinx-issues13 unmodified lines58 sphinxcontrib-qthelp==1.0.359 # via sphinx60 sphinxcontrib-serializinghtml==1.1.561 # via sphinx64-urllib3==1.26.1262+urllib3==1.26.1363 # via requestsmodified:requirements/tests.txt+5 added-7 removed
3 unmodified lines4 # To update, run:5 #6 # pip-compile-multi7 #8-attrs==22.1.08+attrs==22.2.09 # via pytest10+exceptiongroup==1.1.011+ # via pytest12 iniconfig==1.1.113 # via pytest12-packaging==21.314+packaging==22.015 # via pytest16 pluggy==1.0.017 # via pytest16-py==1.11.017- # via pytest18-pyparsing==3.0.919- # via packaging20-pytest==7.1.318+pytest==7.2.019 # via -r requirements/tests.in20 tomli==2.0.121 # via pytestmodified:requirements/typing.txt+1 added-1 removed
3 unmodified lines4 # To update, run:5 #6 # pip-compile-multi7 #8-mypy==0.9828+mypy==0.9919 # via -r requirements/typing.in10 mypy-extensions==0.4.311 # via mypy12 tomli==2.0.13 unmodified linesmodified:src/jinja2/async_utils.py+1 added-1 removed
72 unmodified lines73 if hasattr(iterable, "__aiter__"):74 async for item in t.cast("t.AsyncIterable[V]", iterable):75 yield item76 else:77- for item in t.cast("t.Iterable[V]", iterable):77+ for item in iterable:78 yield item79 80 81 async def auto_to_list(3 unmodified linesmodified:src/jinja2/ext.py+2 added-2 removed
289 unmodified lines290 translations = gettext.NullTranslations()291 292 if hasattr(translations, "pgettext"):293 # Python < 3.8294- pgettext = translations.pgettext # type: ignore294+ pgettext = translations.pgettext295 else:296 297 def pgettext(c: str, s: str) -> str:298 return s299 300 if hasattr(translations, "npgettext"):301- npgettext = translations.npgettext # type: ignore301+ npgettext = translations.npgettext302 else:303 304 def npgettext(c: str, s: str, p: str, n: int) -> str:305 return s if n == 1 else p554 unmodified linesmodified:src/jinja2/loaders.py+1 added-1 removed
387 unmodified lines388 # Package is a zip file.389 prefix = self._template_root[len(self._archive) :].lstrip(os.sep) + os.sep390 offset = len(prefix)391 392- for name in self._loader._files.keys(): # type: ignore392+ for name in self._loader._files.keys():393 # Find names under the templates directory that aren't directories.394 if name.startswith(prefix) and name[-1] != os.sep:395 results.append(name[offset:].replace(os.sep, "/"))396 262 unmodified linesmodified:src/jinja2/runtime.py+2 added-2 removed
270 unmodified lines271 272 # Allow callable classes to take a context273 if (274 hasattr(__obj, "__call__") # noqa: B004275- and _PassArg.from_obj(__obj.__call__) is not None # type: ignore275+ and _PassArg.from_obj(__obj.__call__) is not None276 ):277- __obj = __obj.__call__ # type: ignore277+ __obj = __obj.__call__278 279 pass_arg = _PassArg.from_obj(__obj)280 281 if pass_arg is _PassArg.context:772 unmodified linesmodified:tests/test_loader.py+4 added-2 removed
181 unmodified lines182 183 184 class TestModuleLoader:185 archive = None186+ mod_env = None187 188 def compile_down(self, prefix_loader, zip="deflated"):189 log = []190 self.reg_env = Environment(loader=prefix_loader)5 unmodified lines196 self.reg_env.compile_templates(self.archive, zip=zip, log_function=log.append)197 self.mod_env = Environment(loader=loaders.ModuleLoader(self.archive))198 return "".join(log)199 199- def teardown(self):200- if hasattr(self, "mod_env"):200+ def teardown_method(self):201+ if self.archive is not None:202 if os.path.isfile(self.archive):203 os.remove(self.archive)204 else:205 shutil.rmtree(self.archive)206 self.archive = None207+ self.mod_env = None208 209 def test_log(self, prefix_loader):210 log = self.compile_down(prefix_loader)211 assert (203 unmodified linesmodified:.pre-commit-config.yaml+6 added-6 removed
1 unmodified line2 autoupdate_branch: "3.1.x"3 autoupdate_schedule: monthly4 repos:5 - repo: https://github.com/asottile/pyupgrade6- rev: v3.1.06+ rev: v3.3.17 hooks:8 - id: pyupgrade9 args: ["--py37-plus"]10 - repo: https://github.com/asottile/reorder_python_imports11- rev: v3.8.411+ rev: v3.9.012 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.10.017+ rev: 22.12.018 hooks:19 - id: black20 - repo: https://github.com/PyCQA/flake821- rev: 5.0.421+ rev: 6.0.022 hooks:23 - id: flake824 additional_dependencies: [flake8-bugbear]25 - repo: https://github.com/peterdemin/pip-compile-multi26- rev: v2.4.626+ rev: v2.6.127 hooks:28 - id: pip-compile-multi-verify29 - repo: https://github.com/pre-commit/pre-commit-hooks30- rev: v4.3.030+ rev: v4.4.031 hooks:32 - id: fix-byte-order-marker33 - id: trailing-whitespace34 - id: end-of-file-fixermodified:setup.cfg+2 added
76 unmodified lines77 # bare except, handled by bugbear B00178 E72279 # bin op line break, invalid80 W50381+ # zip with strict=, requires python >= 3.1082+ B90583 # up to 88 allowed by bugbear B95084 max-line-length = 8085 per-file-ignores =86 # __init__ exports names25 unmodified lines