]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
Merge branch '3.1.x'
authorDavid Lord <davidism@gmail.com>
Fri, 23 Aug 2024 23:51:25 +0000 (16:51 -0700)
committerDavid Lord <davidism@gmail.com>
Fri, 23 Aug 2024 23:52:48 +0000 (16:52 -0700)
1  2 
pyproject.toml
requirements/tests37.in
requirements/tests37.txt
src/jinja2/environment.py
src/jinja2/loaders.py
tox.ini

diff --cc pyproject.toml
Simple merge
diff --cc requirements/tests37.in
index 0e459b2d422a256fd466da873533a1316093de00,9c2bed18086d79c55b2dc799f9db9f2410e1c6b9..0000000000000000000000000000000000000000
deleted file mode 100644,100644
+++ /dev/null
@@@ -1,2 -1,2 +1,0 @@@
--pytest
- trio==0.26.0
 -trio==0.22.2
diff --cc requirements/tests37.txt
index ffc6233828e4ae51c64b56c1d14586fe0db79016,81c6213c0e42cbed48e9afbd5c6803177f2c15c9..0000000000000000000000000000000000000000
deleted file mode 100644,100644
+++ /dev/null
@@@ -1,28 -1,43 +1,0 @@@
--#
--# This file is autogenerated by pip-compile with Python 3.7
--# by the following command:
--#
--#    pip-compile tests37.in
--#
- attrs==23.2.0
 -attrs==24.2.0
--    # via
--    #   outcome
--    #   trio
- idna==3.7
 -exceptiongroup==1.2.2
 -    # via
 -    #   pytest
 -    #   trio
 -idna==3.8
--    # via trio
 -importlib-metadata==6.7.0
 -    # via
 -    #   attrs
 -    #   pluggy
 -    #   pytest
--iniconfig==2.0.0
--    # via pytest
--outcome==1.3.0.post0
--    # via trio
--packaging==24.0
--    # via pytest
--pluggy==1.2.0
--    # via pytest
--pytest==7.4.4
--    # via -r tests37.in
--sniffio==1.3.1
--    # via trio
--sortedcontainers==2.4.0
--    # via trio
- trio==0.26.0
 -tomli==2.0.1
 -    # via pytest
 -trio==0.22.2
--    # via -r tests37.in
 -typing-extensions==4.7.1
 -    # via importlib-metadata
 -zipp==3.15.0
 -    # via importlib-metadata
Simple merge
index 5cb49271edc32ed36705ca634b708b0040cb4061,8c2c86cd0b9eb164e97003a126e8baac0241ad5e..8ca32cbb0d369ef94ff3af223a43b0d46a3580e3
@@@ -382,20 -406,19 +406,16 @@@ class PackageLoader(BaseLoader)
                      for name in filenames
                  )
          else:
-             if not hasattr(self._loader, "_files"):
-                 raise TypeError(
-                     "This zip import does not have the required"
-                     " metadata to list templates."
-                 )
+             files = _get_zipimporter_files(self._loader)
  
              # Package is a zip file.
 -            prefix = (
 -                self._template_root[len(self._archive) :].lstrip(os.path.sep)
 -                + os.path.sep
 -            )
 +            prefix = self._template_root[len(self._archive) :].lstrip(os.sep) + os.sep
              offset = len(prefix)
  
-             for name in self._loader._files.keys():
+             for name in files:
                  # Find names under the templates directory that aren't directories.
 -                if name.startswith(prefix) and name[-1] != os.path.sep:
 -                    results.append(name[offset:].replace(os.path.sep, "/"))
 +                if name.startswith(prefix) and name[-1] != os.sep:
 +                    results.append(name[offset:].replace(os.sep, "/"))
  
          results.sort()
          return results
diff --cc tox.ini
index bb84c67e5a4c9d8ad710149ff38b1857acf761eb,a40f36a4412d8adae5a23448844ec57b98c4d5d7..064ca2e4af2fe1477675ffecca32503e4e06297d
+++ b/tox.ini
@@@ -48,11 -54,11 +54,3 @@@ commands 
      pip-compile tests.in -q {posargs:-U}
      pip-compile typing.in -q {posargs:-U}
      pip-compile dev.in -q {posargs:-U}
--
--[testenv:update-requirements37]
--base_python = 3.7
--labels = update
--deps = pip-tools
--skip_install = true
--change_dir = requirements
--commands = pip-compile tests37.in -q {posargs:-U}