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 b490da6, 896a1d5 · Browse files · 16 files·+189 added−203 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
16 files+189 added−203 removed
- tests:+1 added−1 removed
- other:+188 added−202 removed
Provenance
- Commit
7f0fc0a- Tree
c1e9c5e- Author
David Lord <davidism@gmail.com>- Committer
David Lord <davidism@gmail.com>- Parent 1
b490da6- Parent 2
896a1d5
16 files changed+189 added−203 removed
modified:.github/workflows/publish.yaml+1 added-1 removed
21 unmodified lines2223242526262728293043 unmodified lines21 unmodified lines # Generate hashes used for provenance. - name: generate hash id: hash run: cd dist && echo "hash=$(sha256sum * | base64 -w0)" >> $GITHUB_OUTPUT - uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 - uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6 with: path: ./dist provenance: needs: [build]43 unmodified linesdeleted:.github/dependabot.yml-18 removed
123456789101112131415161718version: 2updates: - package-ecosystem: github-actions directory: / schedule: interval: monthly groups: github-actions: patterns: - '*' - package-ecosystem: pip directory: /requirements/ schedule: interval: monthly groups: python-requirements: patterns: - '*'modified:requirements/build.txt+8 added-2 removed
1 #2-# This file is autogenerated by pip-compile with Python 3.122+# This file is autogenerated by pip-compile with Python 3.83 # by the following command:4 #5 # pip-compile build.in6 #7 build==1.2.18 # via -r build.in9-packaging==24.09+importlib-metadata==8.4.010 # via build11+packaging==24.112+ # via build13 pyproject-hooks==1.1.014 # via build15+tomli==2.0.116+ # via build17+zipp==3.20.018+ # via importlib-metadatamodified:requirements/dev.txt+98 added-109 removed
1 #2-# This file is autogenerated by pip-compile with Python 3.122+# This file is autogenerated by pip-compile with Python 3.83 # by the following command:4 #5 # pip-compile dev.in6 #7-alabaster==0.7.167+alabaster==0.7.138+ # via sphinx9+attrs==24.2.010 # via9- # -r docs.txt10- # sphinx11-attrs==23.2.012- # via13- # -r tests.txt11 # outcome12 # trio16-babel==2.15.017- # via18- # -r docs.txt19- # sphinx20-cachetools==5.3.313+babel==2.16.014+ # via sphinx15+build==1.2.116+ # via pip-tools17+cachetools==5.5.018 # via tox22-certifi==2024.2.223- # via24- # -r docs.txt25- # requests19+certifi==2024.7.420+ # via requests21 cfgv==3.4.022 # via pre-commit23 chardet==5.2.024 # via tox25 charset-normalizer==3.3.226+ # via requests27+click==8.1.728 # via32- # -r docs.txt33- # requests29+ # pip-compile-multi30+ # pip-tools31 colorama==0.4.632 # via tox33 distlib==0.3.834 # via virtualenv38-docutils==0.21.235+docutils==0.20.136+ # via sphinx37+exceptiongroup==1.2.238 # via40- # -r docs.txt41- # sphinx42-filelock==3.14.039+ # pytest40+ # trio41+filelock==3.15.442 # via43 # tox44 # virtualenv46-identify==2.5.3645+identify==2.6.046 # via pre-commit48-idna==3.747+idna==3.848 # via50- # -r docs.txt51- # -r tests.txt49 # requests50 # trio51 imagesize==1.4.152+ # via sphinx53+importlib-metadata==8.4.054 # via56- # -r docs.txt55+ # build56 # sphinx57 iniconfig==2.0.059- # via60- # -r tests.txt61- # pytest58+ # via pytest59 jinja2==3.1.463- # via64- # -r docs.txt65- # sphinx60+ # via sphinx61 markupsafe==2.1.567- # via68- # -r docs.txt69- # jinja270-mypy==1.10.071- # via -r typing.txt62+ # via jinja263+mypy==1.11.164+ # via -r typing.in65 mypy-extensions==1.0.073- # via74- # -r typing.txt75- # mypy76-nodeenv==1.8.066+ # via mypy67+nodeenv==1.9.168 # via pre-commit69 outcome==1.3.0.post070+ # via trio71+packaging==24.172 # via80- # -r tests.txt81- # trio82-packaging==24.083- # via84- # -r docs.txt85- # -r tests.txt73+ # build74 # pallets-sphinx-themes75 # pyproject-api76 # pytest77 # sphinx78 # tox79 pallets-sphinx-themes==2.1.392- # via -r docs.txt93-platformdirs==4.2.180+ # via -r docs.in81+pip-compile-multi==2.6.482+ # via -r dev.in83+pip-tools==7.4.184+ # via pip-compile-multi85+platformdirs==4.2.286 # via87 # tox88 # virtualenv89 pluggy==1.5.090 # via99- # -r tests.txt91 # pytest92 # tox102-pre-commit==3.8.093+pre-commit==3.5.094 # via -r dev.in95 pygments==2.18.0105- # via106- # -r docs.txt107- # sphinx108-pyproject-api==1.6.196+ # via sphinx97+pyproject-api==1.7.198 # via tox110-pytest==8.2.0111- # via -r tests.txt112-pyyaml==6.0.1113- # via pre-commit114-requests==2.31.099+pyproject-hooks==1.1.0100 # via116- # -r docs.txt117- # sphinx101+ # build102+ # pip-tools103+pytest==8.3.2104+ # via -r tests.in105+pytz==2024.1106+ # via babel107+pyyaml==6.0.2108+ # via pre-commit109+requests==2.32.3110+ # via sphinx111 sniffio==1.3.1119- # via120- # -r tests.txt121- # trio112+ # via trio113 snowballstemmer==2.2.0123- # via124- # -r docs.txt125- # sphinx114+ # via sphinx115 sortedcontainers==2.4.0116+ # via trio117+sphinx==7.1.2118 # via128- # -r tests.txt129- # trio130-sphinx==8.0.2131- # via132- # -r docs.txt119+ # -r docs.in120 # pallets-sphinx-themes121+ # sphinx-issues122 # sphinxcontrib-log-cabinet135-sphinxcontrib-applehelp==1.0.8136- # via137- # -r docs.txt138- # sphinx139-sphinxcontrib-devhelp==1.0.6140- # via141- # -r docs.txt142- # sphinx143-sphinxcontrib-htmlhelp==2.0.5144- # via145- # -r docs.txt146- # sphinx123+sphinx-issues==4.1.0124+ # via -r docs.in125+sphinxcontrib-applehelp==1.0.4126+ # via sphinx127+sphinxcontrib-devhelp==1.0.2128+ # via sphinx129+sphinxcontrib-htmlhelp==2.0.1130+ # via sphinx131 sphinxcontrib-jsmath==1.0.1148- # via149- # -r docs.txt150- # sphinx132+ # via sphinx133 sphinxcontrib-log-cabinet==1.0.1152- # via -r docs.txt153-sphinxcontrib-qthelp==1.0.7134+ # via -r docs.in135+sphinxcontrib-qthelp==1.0.3136+ # via sphinx137+sphinxcontrib-serializinghtml==1.1.5138+ # via sphinx139+tomli==2.0.1140 # via155- # -r docs.txt156- # sphinx157-sphinxcontrib-serializinghtml==1.1.10158- # via159- # -r docs.txt160- # sphinx161-tox==4.15.1141+ # build142+ # mypy143+ # pip-tools144+ # pyproject-api145+ # pytest146+ # tox147+toposort==1.10148+ # via pip-compile-multi149+tox==4.18.0150 # via -r dev.in163-trio==0.26.0164- # via -r tests.txt165-typing-extensions==4.11.0151+trio==0.26.2152+ # via -r tests.in153+typing-extensions==4.12.2154+ # via mypy155+urllib3==2.2.2156+ # via requests157+virtualenv==20.26.3158 # via167- # -r typing.txt168- # mypy169-urllib3==2.2.1170- # via171- # -r docs.txt172- # requests173-virtualenv==20.26.1174- # via159 # pre-commit160 # tox161+wheel==0.44.0162+ # via pip-tools163+zipp==3.20.0164+ # via importlib-metadata165 166 # The following packages are considered to be unsafe in a requirements file:167+# pip168 # setuptoolsmodified:requirements/docs.txt+24 added-15 removed
1 #2-# This file is autogenerated by pip-compile with Python 3.122+# This file is autogenerated by pip-compile with Python 3.83 # by the following command:4 #5 # pip-compile docs.in6 #7-alabaster==0.7.167+alabaster==0.7.138 # via sphinx9-babel==2.15.09+babel==2.16.010 # via sphinx11-certifi==2024.2.211+certifi==2024.7.412 # via requests13 charset-normalizer==3.3.214 # via requests15-docutils==0.21.215+docutils==0.20.116 # via sphinx17-idna==3.717+idna==3.818 # via requests19 imagesize==1.4.120 # via sphinx21+importlib-metadata==8.4.022+ # via sphinx23 jinja2==3.1.424 # via sphinx25 markupsafe==2.1.526 # via jinja225-packaging==24.027+packaging==24.128 # via29 # pallets-sphinx-themes30 # sphinx31 pallets-sphinx-themes==2.1.332 # via -r docs.in33 pygments==2.18.034 # via sphinx35+pytz==2024.136+ # via babel33-requests==2.31.037+requests==2.32.338 # via sphinx39 snowballstemmer==2.2.040 # via sphinx37-sphinx==8.0.241+sphinx==7.1.242 # via43 # -r docs.in44 # pallets-sphinx-themes45+ # sphinx-issues46 # sphinxcontrib-log-cabinet47+sphinx-issues==4.1.048+ # via -r docs.in42-sphinxcontrib-applehelp==1.0.849+sphinxcontrib-applehelp==1.0.450 # via sphinx44-sphinxcontrib-devhelp==1.0.651+sphinxcontrib-devhelp==1.0.252 # via sphinx46-sphinxcontrib-htmlhelp==2.0.553+sphinxcontrib-htmlhelp==2.0.154 # via sphinx55 sphinxcontrib-jsmath==1.0.156 # via sphinx57 sphinxcontrib-log-cabinet==1.0.158 # via -r docs.in52-sphinxcontrib-qthelp==1.0.759+sphinxcontrib-qthelp==1.0.360 # via sphinx54-sphinxcontrib-serializinghtml==1.1.1061+sphinxcontrib-serializinghtml==1.1.562 # via sphinx56-urllib3==2.2.163+urllib3==2.2.264 # via requests65+zipp==3.20.066+ # via importlib-metadatamodified:requirements/tests.txt+12 added-6 removed
1 #2-# This file is autogenerated by pip-compile with Python 3.122+# This file is autogenerated by pip-compile with Python 3.83 # by the following command:4 #5 # pip-compile tests.in6 #7-attrs==23.2.07+attrs==24.2.08 # via9 # outcome10 # trio11+exceptiongroup==1.2.212+ # via13+ # pytest14+ # trio11-idna==3.715+idna==3.816 # via trio17 iniconfig==2.0.018 # via pytest19 outcome==1.3.0.post020 # via trio17-packaging==24.021+packaging==24.122 # via pytest23 pluggy==1.5.024 # via pytest21-pytest==8.2.025+pytest==8.3.226 # via -r tests.in27 sniffio==1.3.128 # via trio29 sortedcontainers==2.4.030 # via trio31+tomli==2.0.132+ # via pytest27-trio==0.26.033+trio==0.26.234 # via -r tests.indeleted:requirements/tests37.in-2 removed
1-pytest2-trio==0.26.0deleted:requirements/tests37.txt-28 removed
1-#2-# This file is autogenerated by pip-compile with Python 3.73-# by the following command:4-#5-# pip-compile tests37.in6-#7-attrs==23.2.08- # via9- # outcome10- # trio11-idna==3.712- # via trio13-iniconfig==2.0.014- # via pytest15-outcome==1.3.0.post016- # via trio17-packaging==24.018- # via pytest19-pluggy==1.2.020- # via pytest21-pytest==7.4.422- # via -r tests37.in23-sniffio==1.3.124- # via trio25-sortedcontainers==2.4.026- # via trio27-trio==0.26.028- # via -r tests37.inmodified:requirements/typing.txt+5 added-3 removed
1 #2-# This file is autogenerated by pip-compile with Python 3.122+# This file is autogenerated by pip-compile with Python 3.83 # by the following command:4 #5 # pip-compile typing.in6 #7-mypy==1.10.07+mypy==1.11.18 # via -r typing.in9 mypy-extensions==1.0.010 # via mypy11-typing-extensions==4.11.011+tomli==2.0.112 # via mypy13+typing-extensions==4.12.214+ # via mypymodified:src/jinja2/async_utils.py+1 added-1 removed
65 unmodified lines66 67 if inspect.isawaitable(value):68 return await t.cast("t.Awaitable[V]", value)69 70- return t.cast("V", value)70+ return value71 72 73 class _IteratorToAsyncIterator(t.Generic[V]):74 def __init__(self, iterator: "t.Iterator[V]"):25 unmodified linesmodified:src/jinja2/environment.py+1 added-1 removed
706 unmodified lines707 """708 return compile(source, filename, "exec")709 710 @typing.overload711- def compile( # type: ignore711+ def compile(712 self,713 source: t.Union[str, nodes.Template],714 name: t.Optional[str] = None,715 filename: t.Optional[str] = None,956 unmodified linesmodified:src/jinja2/loaders.py+26 added-6 removed
236 unmodified lines237 found.add(template)238 return sorted(found)239 240 241+if sys.version_info >= (3, 13):242+243+ def _get_zipimporter_files(z: t.Any) -> t.Dict[str, object]:244+ try:245+ get_files = z._get_files246+ except AttributeError as e:247+ raise TypeError(248+ "This zip import does not have the required"249+ " metadata to list templates."250+ ) from e251+ return get_files()252+else:253+254+ def _get_zipimporter_files(z: t.Any) -> t.Dict[str, object]:255+ try:256+ files = z._files257+ except AttributeError as e:258+ raise TypeError(259+ "This zip import does not have the required"260+ " metadata to list templates."261+ ) from e262+ return files # type: ignore[no-any-return]263+264+265 class PackageLoader(BaseLoader):266 """Load templates from a directory in a Python package.267 268 :param package_name: Import name of the package that contains the136 unmodified lines405 os.path.join(dirpath, name).replace(os.sep, "/")406 for name in filenames407 )408 else:385- if not hasattr(self._loader, "_files"):386- raise TypeError(387- "This zip import does not have the required"388- " metadata to list templates."389- )409+ files = _get_zipimporter_files(self._loader)410 411 # Package is a zip file.412 prefix = self._template_root[len(self._archive) :].lstrip(os.sep) + os.sep413 offset = len(prefix)414 395- for name in self._loader._files.keys():415+ for name in files:416 # Find names under the templates directory that aren't directories.417 if name.startswith(prefix) and name[-1] != os.sep:418 results.append(name[offset:].replace(os.sep, "/"))419 265 unmodified linesmodified:tests/test_loader.py+1 added-1 removed
361 unmodified lines362 assert up_to_date is None363 364 365 @pytest.mark.xfail(366- sys.implementation.name == "pypy" or sys.version_info > (3, 13),366+ sys.implementation.name == "pypy",367 reason="zipimporter doesn't have a '_files' attribute",368 raises=TypeError,369 )370 def test_package_zip_list(package_zip_loader):43 unmodified linesmodified:.pre-commit-config.yaml+1 added-1 removed
1 ci:2 autoupdate_schedule: monthly3 repos:4 - repo: https://github.com/astral-sh/ruff-pre-commit5- rev: v0.5.65+ rev: v0.6.26 hooks:7 - id: ruff8 - id: ruff-format9 - repo: https://github.com/pre-commit/pre-commit-hooks7 unmodified linesmodified:pyproject.toml+5 added-1 removed
92 unmodified lines93 "I", # isort94 "UP", # pyupgrade95 "W", # pycodestyle warning96 ]97-ignore-init-module-imports = true97 98 [tool.ruff.lint.isort]99 force-single-line = true100 order-by-type = false101+102+[tool.gha-update]103+tag-only = [104+ "slsa-framework/slsa-github-generator",105+]modified:tox.ini+6 added-8 removed
29 unmodified lines30 [testenv:docs]31 deps = -r requirements/docs.txt32 commands = sphinx-build -E -W -b dirhtml docs docs/_build/dirhtml33 34+[testenv:update-actions]35+labels = update36+deps = gha-update37+commands = gha-update38+39 [testenv:update-pre_commit]40 labels = update41 deps = pre-commit42 skip_install = true43 commands = pre-commit autoupdate -j444 45 [testenv:update-requirements]46+base_python = 3.847 labels = update48 deps = pip-tools49 skip_install = true50 change_dir = requirements2 unmodified lines53 pip-compile docs.in -q {posargs:-U}54 pip-compile tests.in -q {posargs:-U}55 pip-compile typing.in -q {posargs:-U}56 pip-compile dev.in -q {posargs:-U}51-52-[testenv:update-requirements37]53-base_python = 3.754-labels = update55-deps = pip-tools56-skip_install = true57-change_dir = requirements58-commands = pip-compile tests37.in -q {posargs:-U}