summaryrefslogtreecommitdiff
path: root/dev-python/cheetah3
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/cheetah3')
-rw-r--r--dev-python/cheetah3/Manifest5
-rw-r--r--dev-python/cheetah3/cheetah3-3.3.1.ebuild44
-rw-r--r--dev-python/cheetah3/cheetah3-3.3.3.ebuild10
-rw-r--r--dev-python/cheetah3/files/cheetah3-3.3.3-py313.patch63
4 files changed, 72 insertions, 50 deletions
diff --git a/dev-python/cheetah3/Manifest b/dev-python/cheetah3/Manifest
index 27bc27fe333d..a4aa02be6aac 100644
--- a/dev-python/cheetah3/Manifest
+++ b/dev-python/cheetah3/Manifest
@@ -1,5 +1,4 @@
-DIST cheetah3-3.3.1.gh.tar.gz 315007 BLAKE2B 627cb435db1cf274861a29b993f49457c1ba4147b6e1514b5d5961a2fd565c39ff9cae3bcd9665379c5206dc2cef98a6bf159781e664d75d87fa8c4244ec4e43 SHA512 057d3772390076157a0e09e6b5e60ad0ec3b1669aa62741bcfd314f846bba091884d361382d6399e73bce06aaf49366ee3cbeb040c6f5b3e00423eefd440c300
+AUX cheetah3-3.3.3-py313.patch 1956 BLAKE2B 3fa17870675a43ddfdf7c0d6cb80d559675b1213151e1147d37becea9013375d12192a6f16fdac66e45cf63b69c2e4a44233cd6f0930795b06c2353bbb30fe92 SHA512 767983f2f0c332681ed9cbd524988c23169c3a3be48231b1d1a41ca70734be829003909bc8f56f3edc16b25957fff89574268d355447de635c835bf6c49c5bcc
DIST cheetah3-3.3.3.gh.tar.gz 315249 BLAKE2B f5dc748c49adbddffb0339069f800583739bffce8085c3abb80080d14d051a334e6b7d1b8ced218218334cae6cc000877570f3ab7c1ef0d760de36bf956f9c2e SHA512 638ee6ca0d37b86cfa93f8fc0da4c259da639c3b107c8810201e4bed30ca4674b5e546abc1d8f716d1bba7d1c72d51f559894a90580fa02f1409f7a73a246001
-EBUILD cheetah3-3.3.1.ebuild 971 BLAKE2B 74a1043aeabc943de1386e1844f0997ae5e931c774517ad06f1f9d9840aa5eff8c043f61acc6cd44c218becab2cf12681c2a1d18c06405e4b1261d6289c5224b SHA512 eb6d639b5997b40e249d87051b15ee169e46e2c9bd11836db6c980dd2d366103a607cddedaebd71fd14a3500ed301049051905b0719a229081b846d23723a296
-EBUILD cheetah3-3.3.3.ebuild 1040 BLAKE2B 577e16aba252a62ee2ecb794bf75a415caaae908dd8f9a306faf1eac8141c2dde9623c696c8e6b76f709946e2a21f39df91256e72c7c59b1ac0fc59b891f68c9 SHA512 2b9be1418a8503114b1723836adba02cceb8ff4751d6014167f68101fe05b269d6507f1155a33aa46b881e08cca5fb1df6d886babf180677b5e03be4f056cf9e
+EBUILD cheetah3-3.3.3.ebuild 1112 BLAKE2B 93a3dc928c85f0de7d485c99df07a4528c264e1fe1a95e76cedbf84d465077768ab6bce09f578dc96d33081233861a2d4e8f02c478e474f384a9d53998765608 SHA512 8e59ab26271273bb6280eda4724fc90816b5c9f679a6467a3ad6034643253193416068403a9dfb5eec09c7a6f6fc569c9862ecdef5a9b5f93be8e8e5926b122c
MISC metadata.xml 728 BLAKE2B eed475bf99f19abf5f934cc9e9f0ed10c3a29536767133a628dc3f23e95a37a0feaa82e4f080ac8f6d541cc6d802a084d670e64049149937b061e5f20bac317b SHA512 52b5eb46efb8d6e750823775ef459eec200e617e9232867cdfa229e2d7b6a41feee15441ac1a7c1ad2871f0fd19fb91fd6c36719eee2592c41e27ad8ec5fd162
diff --git a/dev-python/cheetah3/cheetah3-3.3.1.ebuild b/dev-python/cheetah3/cheetah3-3.3.1.ebuild
deleted file mode 100644
index f3f6408a0e61..000000000000
--- a/dev-python/cheetah3/cheetah3-3.3.1.ebuild
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright 1999-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-DISTUTILS_EXT=1
-DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( python3_{10..12} )
-
-inherit distutils-r1
-
-MY_P=${P/_p/.post}
-DESCRIPTION="Python-powered template engine and code generator"
-HOMEPAGE="
- https://cheetahtemplate.org/
- https://github.com/CheetahTemplate3/Cheetah3/
- https://pypi.org/project/Cheetah3/
-"
-SRC_URI="
- https://github.com/CheetahTemplate3/Cheetah3/archive/${PV/_p/.post}.tar.gz
- -> ${MY_P}.gh.tar.gz
-"
-S=${WORKDIR}/${MY_P}
-
-LICENSE="MIT"
-SLOT="0"
-KEYWORDS="amd64 arm arm64 ~loong ~ppc64 ~riscv x86"
-
-RDEPEND="
- dev-python/markdown[${PYTHON_USEDEP}]
-"
-BDEPEND="
- ${RDEPEND}
-"
-
-DOCS=( ANNOUNCE.rst README.rst TODO )
-
-python_test() {
- # the package can't handle TMPDIR with hyphens
- # https://github.com/CheetahTemplate3/cheetah3/issues/53
- local -x TMPDIR=/tmp
-
- "${EPYTHON}" Cheetah/Tests/Test.py || die "Tests fail with ${EPYTHON}"
-}
diff --git a/dev-python/cheetah3/cheetah3-3.3.3.ebuild b/dev-python/cheetah3/cheetah3-3.3.3.ebuild
index 990570eb221b..204d8de6418b 100644
--- a/dev-python/cheetah3/cheetah3-3.3.3.ebuild
+++ b/dev-python/cheetah3/cheetah3-3.3.3.ebuild
@@ -5,8 +5,7 @@ EAPI=8
DISTUTILS_EXT=1
DISTUTILS_USE_PEP517=setuptools
-# py3.13: https://github.com/CheetahTemplate3/cheetah3/issues/60
-PYTHON_COMPAT=( python3_{10..12} )
+PYTHON_COMPAT=( python3_{10..13} )
inherit distutils-r1
@@ -25,7 +24,7 @@ S=${WORKDIR}/${MY_P}
LICENSE="MIT"
SLOT="0"
-KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86"
+KEYWORDS="amd64 arm arm64 ~loong ~ppc64 ~riscv x86"
RDEPEND="
dev-python/markdown[${PYTHON_USEDEP}]
@@ -36,6 +35,11 @@ BDEPEND="
DOCS=( ANNOUNCE.rst README.rst TODO )
+PATCHES=(
+ # https://github.com/CheetahTemplate3/cheetah3/commit/ee2739b73bafbcb9a8cc5511d5e03e6b0d9bced1
+ "${FILESDIR}/${P}-py313.patch"
+)
+
python_test() {
# the package can't handle TMPDIR with hyphens
# https://github.com/CheetahTemplate3/cheetah3/issues/53
diff --git a/dev-python/cheetah3/files/cheetah3-3.3.3-py313.patch b/dev-python/cheetah3/files/cheetah3-3.3.3-py313.patch
new file mode 100644
index 000000000000..591cab07286a
--- /dev/null
+++ b/dev-python/cheetah3/files/cheetah3-3.3.3-py313.patch
@@ -0,0 +1,63 @@
+From ee2739b73bafbcb9a8cc5511d5e03e6b0d9bced1 Mon Sep 17 00:00:00 2001
+From: Oleg Broytman <phd@phdru.name>
+Date: Sat, 22 Jun 2024 05:47:51 +0300
+Subject: [PATCH] Fix(NameMapper): Fix mapping test
+
+Python 3.13 brought a new mapping type `FrameLocalsProxy`.
+
+Fixes: #60.
+
+[skip ci]
+---
+ Cheetah/NameMapper.py | 8 +++++++-
+ docs/news.rst | 3 +++
+ 2 files changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/Cheetah/NameMapper.py b/Cheetah/NameMapper.py
+index 7c09e37d..32c1f366 100755
+--- a/Cheetah/NameMapper.py
++++ b/Cheetah/NameMapper.py
+@@ -140,8 +140,8 @@
+ been compiled or falls back to the Python version if not.
+ """
+
+-import inspect
+ from pprint import pformat
++import inspect
+ import sys
+
+ from .compat import PY2
+@@ -149,6 +149,8 @@
+ from collections import Mapping
+ else:
+ from collections.abc import Mapping
++ if sys.version_info[:2] >= (3, 13):
++ from collections.abc import MutableMapping
+
+ _INCLUDE_NAMESPACE_REPR_IN_NOTFOUND_EXCEPTIONS = False
+ _ALLOW_WRAPPING_OF_NOTFOUND_EXCEPTIONS = True
+@@ -319,6 +321,10 @@ def __valueForName():
+ try:
+ if not frame:
+ frame = inspect.stack()[1][0]
++ if sys.version_info[:2] >= (3, 13):
++ FrameLocalsProxy = frame.f_locals
++ if not isinstance(FrameLocalsProxy, Mapping):
++ MutableMapping.register(type(FrameLocalsProxy))
+ key = name.split('.')[0]
+ for namespace in _namespaces(frame, searchList):
+ if hasKey(namespace, key):
+diff --git a/docs/news.rst b/docs/news.rst
+index 8adf5806..78f6e5ff 100644
+--- a/docs/news.rst
++++ b/docs/news.rst
+@@ -15,6 +15,9 @@ Bug fixes:
+ - Fixed ``_namemapper.c``: Silent an error
+ from ``PyMapping_HasKeyString`` under Python 3.13+.
+
++ - Fixed mapping test in ``NameMapper.py``:
++ Python 3.13 brough a new mapping type ``FrameLocalsProxy``.
++
+ Tests:
+
+ - tox: Run tests under Python 3.13.