From 51be8f45b17e3da3ac48eca6b16b703bb58fda76 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Tue, 12 Nov 2024 03:02:41 +0000 Subject: gentoo auto-resync : 12:11:2024 - 03:02:41 --- dev-python/jinja2/Manifest | 4 ++ dev-python/jinja2/files/jinja2-3.1.4-py313.patch | 67 ++++++++++++++++++++++++ dev-python/jinja2/jinja2-3.1.4.ebuild | 51 ++++++++++++++++++ dev-python/jinja2/metadata.xml | 14 +++++ 4 files changed, 136 insertions(+) create mode 100644 dev-python/jinja2/Manifest create mode 100644 dev-python/jinja2/files/jinja2-3.1.4-py313.patch create mode 100644 dev-python/jinja2/jinja2-3.1.4.ebuild create mode 100644 dev-python/jinja2/metadata.xml (limited to 'dev-python/jinja2') diff --git a/dev-python/jinja2/Manifest b/dev-python/jinja2/Manifest new file mode 100644 index 000000000000..3fd8ab020035 --- /dev/null +++ b/dev-python/jinja2/Manifest @@ -0,0 +1,4 @@ +AUX jinja2-3.1.4-py313.patch 2365 BLAKE2B 554b37e4f874060a6c2758426a08cad61b752913535f607d065e7a648fa5db272abd85615ba7734df3b2775320318da58040db08aa56c195d4b11e8e242adaec SHA512 3470db6a936c4a921ee3d5a8f7443f0dac9e2416be0332cb80c0c5cd6e1a80186a372a9f7034f5609202b93186c7c3e0e2bcddef209187043b2ebd4d9c796fe3 +DIST jinja2-3.1.4.tar.gz 240245 BLAKE2B cb70699cea93ddf53b7c8876b9006cc70599d49f8c64ab615759a53db6829cab7b55ac673777bc4c8dc5dfc68efada29d37f47fe7cf449044721f659fe6a654d SHA512 d07d68a2687af68c705d3b7f5a2c67aca7b9d125316b15085888b9d0d6e769981af76f6f524728b89b5501bd671d518fcb2638f9ae112e57ca2bf2a53482cd89 +EBUILD jinja2-3.1.4.ebuild 1191 BLAKE2B c71fe43da8e4b25f74ec0b2e91d4d1d37ecbf71ae9ff6daf1e042eda289ba346298f0af4c80a4208c1bcdb687830e4d433c4fcadf11ffeadfe5ca443ce220241 SHA512 a9df44616a31489fd17543ade813cb5ec9c9788352357917dffc7e0b64501df5b273b1b993665398314dc096209065b76ece6a19f51046614bd0718cdefae47e +MISC metadata.xml 467 BLAKE2B 5cba0288a395e281e76810639b6e74153f1fe7532addb41ab9ff1e7e3d23616f2cd6cce9ef266ec3545fe6694fb3e25457f9ad383d5de3e2612dedd5609f2a6f SHA512 04f6f784b771602d2ad23afba5d8c9d10fb44b68873ea20a92904f0350081265852c9e4874866e8684c6a163e99f88053b5ea367357fd74790861f6e7d9cb1e3 diff --git a/dev-python/jinja2/files/jinja2-3.1.4-py313.patch b/dev-python/jinja2/files/jinja2-3.1.4-py313.patch new file mode 100644 index 000000000000..b68091e5397a --- /dev/null +++ b/dev-python/jinja2/files/jinja2-3.1.4-py313.patch @@ -0,0 +1,67 @@ +From 679af7f816ced8941ed5cf9b151a0cac543d0336 Mon Sep 17 00:00:00 2001 +From: Thomas Grainger +Date: Mon, 13 May 2024 18:02:35 +0100 +Subject: [PATCH] fix test_package_zip_list on 3.13 + +--- + src/jinja2/loaders.py | 32 ++++++++++++++++++++++++++------ + tests/test_loader.py | 2 +- + 2 files changed, 27 insertions(+), 7 deletions(-) + +diff --git a/src/jinja2/loaders.py b/src/jinja2/loaders.py +index 9eaf647ba..8c2c86cd0 100644 +--- a/src/jinja2/loaders.py ++++ b/src/jinja2/loaders.py +@@ -238,6 +238,30 @@ def list_templates(self) -> t.List[str]: + return sorted(found) + + ++if sys.version_info >= (3, 13): ++ ++ def _get_zipimporter_files(z: t.Any) -> t.Dict[str, object]: ++ try: ++ get_files = z._get_files ++ except AttributeError as e: ++ raise TypeError( ++ "This zip import does not have the required" ++ " metadata to list templates." ++ ) from e ++ return get_files() ++else: ++ ++ def _get_zipimporter_files(z: t.Any) -> t.Dict[str, object]: ++ try: ++ files = z._files ++ except AttributeError as e: ++ raise TypeError( ++ "This zip import does not have the required" ++ " metadata to list templates." ++ ) from e ++ return files # type: ignore[no-any-return] ++ ++ + class PackageLoader(BaseLoader): + """Load templates from a directory in a Python package. + +@@ -382,11 +406,7 @@ def list_templates(self) -> t.List[str]: + 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 = ( +@@ -395,7 +415,7 @@ def list_templates(self) -> t.List[str]: + ) + 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, "/")) diff --git a/dev-python/jinja2/jinja2-3.1.4.ebuild b/dev-python/jinja2/jinja2-3.1.4.ebuild new file mode 100644 index 000000000000..b89e94804438 --- /dev/null +++ b/dev-python/jinja2/jinja2-3.1.4.ebuild @@ -0,0 +1,51 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=flit +PYPI_PN=jinja2 +PYTHON_COMPAT=( python3_{10..13} pypy3 ) +PYTHON_REQ_USE="threads(+)" + +inherit distutils-r1 pypi + +DESCRIPTION="A full-featured template engine for Python" +HOMEPAGE=" + https://palletsprojects.com/p/jinja/ + https://github.com/pallets/jinja/ + https://pypi.org/project/Jinja2/ +" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~alpha amd64 arm arm64 hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x64-macos ~x64-solaris" + +RDEPEND=" + >=dev-python/markupsafe-2.0[${PYTHON_USEDEP}] +" + +distutils_enable_sphinx docs \ + dev-python/sphinx-issues \ + dev-python/pallets-sphinx-themes +distutils_enable_tests pytest + +# XXX: handle Babel better? + +src_prepare() { + local PATCHES=( + # https://github.com/pallets/jinja/pull/1979 + "${FILESDIR}/${P}-py313.patch" + ) + + # avoid unnecessary dep on extra sphinxcontrib modules + sed -i '/sphinxcontrib.log_cabinet/ d' docs/conf.py || die + + distutils-r1_src_prepare +} + +pkg_postinst() { + if ! has_version dev-python/Babel; then + elog "For i18n support, please emerge dev-python/Babel." + fi +} diff --git a/dev-python/jinja2/metadata.xml b/dev-python/jinja2/metadata.xml new file mode 100644 index 000000000000..7dfbf7b05fcf --- /dev/null +++ b/dev-python/jinja2/metadata.xml @@ -0,0 +1,14 @@ + + + + + python@gentoo.org + Python + + + + Jinja2 + pallets/jinja + cpe:/a:palletsprojects:jinja + + -- cgit v1.2.3