diff --git a/3.2.6.tar.gz b/3.2.6.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..74be8cb0b7153c8e4cf842b08a3025a554e4ca39 Binary files /dev/null and b/3.2.6.tar.gz differ diff --git a/Cheetah3-3.1.0.tar.gz b/Cheetah3-3.1.0.tar.gz deleted file mode 100644 index fc954e7eaf1278750201799c4fe3216e7f890411..0000000000000000000000000000000000000000 Binary files a/Cheetah3-3.1.0.tar.gz and /dev/null differ diff --git a/_bootlocale-removed.patch b/_bootlocale-removed.patch new file mode 100644 index 0000000000000000000000000000000000000000..845520fb02ad901a9cecad124d797b0f8d194754 --- /dev/null +++ b/_bootlocale-removed.patch @@ -0,0 +1,27 @@ +From 112dddd8fa5fb9c285fb8ef2818abfef99365070 Mon Sep 17 00:00:00 2001 +From: Victor Stinner +Date: Tue, 19 Jan 2021 11:19:15 +0100 +Subject: [PATCH] Skip test_import_bootlocale() on Python 3.10 + +The _bootlocale module has been removed from Python 3.10: +https://github.com/python/cpython/commit/b62bdf71ea0cd52041d49691d8ae3dc645bd48e1 +https://bugs.python.org/issue42208 +--- + Cheetah/Tests/ImportHooks.py | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/Cheetah/Tests/ImportHooks.py b/Cheetah/Tests/ImportHooks.py +index d7b5f5d..bc0239c 100644 +--- a/Cheetah/Tests/ImportHooks.py ++++ b/Cheetah/Tests/ImportHooks.py +@@ -87,7 +87,9 @@ def test_import_builtin(self): + return + raise self.fail("All builtin modules are imported") + +- if not PY2: ++ # _bootlocale was removed in Python 3.10: ++ # https://bugs.python.org/issue42208 ++ if not PY2 and sys.version_info < (3, 10): + def test_import_bootlocale(self): + if '_bootlocale' in sys.modules: + del sys.modules['_bootlocale'] diff --git a/cheetah-3.0.0-dont-run-tests-twice.patch b/cheetah-3.0.0-dont-run-tests-twice.patch deleted file mode 100644 index 01353ef4dc00d28f52234fd35346a964038fa7c6..0000000000000000000000000000000000000000 --- a/cheetah-3.0.0-dont-run-tests-twice.patch +++ /dev/null @@ -1,9 +0,0 @@ ---- Cheetah-3.0.0/Cheetah/CheetahWrapper.py.orig 2010-12-12 22:43:26.000000000 -0500 -+++ Cheetah-3.0.0/Cheetah/CheetahWrapper.py 2010-12-20 17:24:44.524608918 -0500 -@@ -263,7 +263,6 @@ - if '-v' in self.testOpts: - verbosity = 2 - runner = unittest.TextTestRunner(verbosity=verbosity) -- runner.run(unittest.TestSuite(Test.suites)) - results = runner.run(unittest.TestSuite(Test.suites)) - exit(int(not results.wasSuccessful())) diff --git a/fix-the-ImportManger-infinite-recursion.patch b/fix-the-ImportManger-infinite-recursion.patch deleted file mode 100644 index 5121cc0ed61257e10b38b907e9340ff28ce391da..0000000000000000000000000000000000000000 --- a/fix-the-ImportManger-infinite-recursion.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 18219344a05a2db8aaa39f401567d18b9ffd57c6 Mon Sep 17 00:00:00 2001 -Subject: fix the ImportManger infinite recursion - ---- - Cheetah/ImportManager.py | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/Cheetah/ImportManager.py b/Cheetah/ImportManager.py -index dbb2c96..d752755 100644 ---- a/Cheetah/ImportManager.py -+++ b/Cheetah/ImportManager.py -@@ -21,6 +21,7 @@ import sys - import imp - import marshal - from Cheetah.compat import string_type -+import _bootlocale - - _installed = False - --- -2.23.0 - diff --git a/fix-the-regressions-test-error.patch b/fix-the-regressions-test-error.patch deleted file mode 100644 index 1b4c64697b9f80d11d165decb0eb9c0e3df76bb9..0000000000000000000000000000000000000000 --- a/fix-the-regressions-test-error.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 43de6576d55bfcbdbc51e065f5df78fb8da83023 Mon Sep 17 00:00:00 2001 -From: Oleg Broytman -Date: Sat, 6 Apr 2019 17:25:30 +0300 -Subject: [PATCH] Tests: Use `cgi.escape` for Py2, `html.escape` for Py3 - ---- - Cheetah/Tests/Regressions.py | 11 +++++++---- - 1 files changed, 7 insertions(+), 4 deletions(-) - -diff --git a/Cheetah/Tests/Regressions.py b/Cheetah/Tests/Regressions.py -index b380e6d..b72fd77 100755 ---- a/Cheetah/Tests/Regressions.py -+++ b/Cheetah/Tests/Regressions.py -@@ -1,5 +1,10 @@ - #!/usr/bin/env python - -+try: -+ from cgi import escape as html_escape -+except ImportError: # Python 3.8+ -+ from html import escape as html_escape -+ - import unittest - import Cheetah.NameMapper - import Cheetah.Template -@@ -138,18 +143,16 @@ class Mantis_Issue_11_Regression_Test(unittest.TestCase): - s = s.replace("&", "&") # Must be done first! - ''' - def test_FailingBehavior(self): -- import cgi - template = Cheetah.Template.Template( - "$escape($request)", -- searchList=[{'escape': cgi.escape, 'request': 'foobar'}]) -+ searchList=[{'escape': html_escape, 'request': 'foobar'}]) - assert template - self.assertRaises(AttributeError, template.respond) - - def test_FailingBehaviorWithSetting(self): -- import cgi - template = Cheetah.Template.Template( - "$escape($request)", -- searchList=[{'escape': cgi.escape, 'request': 'foobar'}], -+ searchList=[{'escape': html_escape, 'request': 'foobar'}], - compilerSettings={'prioritizeSearchListOverSelf': True}) - assert template - assert template.respond() diff --git a/import-from-the-new-abc-module.patch b/import-from-the-new-abc-module.patch new file mode 100644 index 0000000000000000000000000000000000000000..25c64234fcb84ce8b02253153894d92cb24047d8 --- /dev/null +++ b/import-from-the-new-abc-module.patch @@ -0,0 +1,27 @@ +From d4f4de215094dc9c1f51427f3d24f66739115470 Mon Sep 17 00:00:00 2001 +From: houyingchao <1348375921@qq.com> +Date: Wed, 15 Jun 2022 14:04:57 +0800 +Subject: [PATCH] import-from-the-new-abc-module + +--- + Cheetah/NameMapper.py | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/Cheetah/NameMapper.py b/Cheetah/NameMapper.py +index 3c16dff..d92cddd 100755 +--- a/Cheetah/NameMapper.py ++++ b/Cheetah/NameMapper.py +@@ -140,6 +140,10 @@ Cheetah uses the optimized C version (_namemapper.c) if it has + been compiled or falls back to the Python version if not. + """ + ++try: ++ from collections.abc import Mapping ++except ImportError: ++ from collections import Mapping + import inspect + from pprint import pformat + +-- +2.23.0 + diff --git a/python-cheetah.spec b/python-cheetah.spec index 932c076b774ad24ea01fd3dfe364b9173c7f24b2..d3c488515c9babee45dd4f3e5012dd3f2cf80f75 100644 --- a/python-cheetah.spec +++ b/python-cheetah.spec @@ -1,15 +1,14 @@ Name: python-cheetah -Version: 3.1.0 -Release: 9 +Version: 3.2.6 +Release: 1 Summary: The Python-Powered Template Engine License: MIT URL: http://cheetahtemplate.org/ -Source: https://pypi.python.org/packages/54/86/ea50bb5baf1daa8ca1a56774d48150a69376679d27c4130848702efc378c/Cheetah3-3.1.0.tar.gz +Source: https://github.com/CheetahTemplate3/cheetah3/archive/refs/tags/3.2.6.tar.gz BuildRequires: gcc python3-devel python3-setuptools python3-markdown python3-pygments -Patch0001: cheetah-3.0.0-dont-run-tests-twice.patch -Patch0002: fix-the-regressions-test-error.patch -Patch0003: fix-the-ImportManger-infinite-recursion.patch +Patch0001: _bootlocale-removed.patch +Patch0002: import-from-the-new-abc-module.patch %description Cheetah3 is a free and open source template engine and code-generation tool written in Python. @@ -27,8 +26,8 @@ Summary: The Python-Powered Template Engine The Python-Powered Template Engine %prep -%autosetup -n Cheetah3-%{version} -p1 -%{__sed} -i -e '/^#!/,1d' Cheetah/Tests/* Cheetah/DirectiveAnalyzer.py Cheetah/Utils/Misc.py +%autosetup -n cheetah3-%{version} -p1 +%{__sed} -i -e '/^#!/,1d' Cheetah/Tests/*.py Cheetah/DirectiveAnalyzer.py Cheetah/Utils/Misc.py %build %py3_build @@ -47,6 +46,9 @@ export PATH="%{buildroot}/%{_bindir}:$PATH" PYTHONPATH="%{buildroot}/%{python3_s %{python3_sitearch}/ %changelog +* Mon Oct 17 2022 Ge Wang - 3.2.6-1 +- Upgrade to version 3.2.6 + * Wed Oct 21 2020 chengzihan - 3.1.0-9 - Remove subpackage python2-cheetah