diff options
| author | Michał Górny <mgorny@gentoo.org> | 2024-11-11 04:50:08 +0100 |
|---|---|---|
| committer | Michał Górny <mgorny@gentoo.org> | 2024-11-11 05:07:23 +0100 |
| commit | 832063fcffe02eb04f68486146ceb7b214197961 (patch) | |
| tree | 756ae9509b83cb6250a760372336a84730cbb29c /dev-python/jinja2 | |
| parent | 3c662df751daad011a48f05fb9a9ff074a08cc24 (diff) | |
| download | gentoo-832063fcffe02eb04f68486146ceb7b214197961.tar.gz gentoo-832063fcffe02eb04f68486146ceb7b214197961.tar.bz2 gentoo-832063fcffe02eb04f68486146ceb7b214197961.zip | |
Rename dev-python/{jinja → jinja2}
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/jinja2')
| -rw-r--r-- | dev-python/jinja2/Manifest | 1 | ||||
| -rw-r--r-- | dev-python/jinja2/files/jinja2-3.1.4-py313.patch | 67 | ||||
| -rw-r--r-- | dev-python/jinja2/jinja2-3.1.4.ebuild | 51 | ||||
| -rw-r--r-- | dev-python/jinja2/metadata.xml | 14 |
4 files changed, 133 insertions, 0 deletions
diff --git a/dev-python/jinja2/Manifest b/dev-python/jinja2/Manifest new file mode 100644 index 000000000000..bfa1bf69488e --- /dev/null +++ b/dev-python/jinja2/Manifest @@ -0,0 +1 @@ +DIST jinja2-3.1.4.tar.gz 240245 BLAKE2B cb70699cea93ddf53b7c8876b9006cc70599d49f8c64ab615759a53db6829cab7b55ac673777bc4c8dc5dfc68efada29d37f47fe7cf449044721f659fe6a654d SHA512 d07d68a2687af68c705d3b7f5a2c67aca7b9d125316b15085888b9d0d6e769981af76f6f524728b89b5501bd671d518fcb2638f9ae112e57ca2bf2a53482cd89 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 <tagrain@gmail.com> +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 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>python@gentoo.org</email> + <name>Python</name> + </maintainer> + <stabilize-allarches/> + <upstream> + <remote-id type="pypi">Jinja2</remote-id> + <remote-id type="github">pallets/jinja</remote-id> + <remote-id type="cpe">cpe:/a:palletsprojects:jinja</remote-id> + </upstream> +</pkgmetadata> |
