diff --git a/3.2.6.tar.gz b/3.2.6.tar.gz new file mode 100644 index 0000000..74be8cb 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 fc954e7..0000000 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 0000000..845520f --- /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 01353ef..0000000 --- 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-regressions-test-error.patch b/fix-the-regressions-test-error.patch deleted file mode 100644 index 1b4c646..0000000 --- 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 index 5b5622e..25c6423 100644 --- a/import-from-the-new-abc-module.patch +++ b/import-from-the-new-abc-module.patch @@ -1,29 +1,27 @@ -From 488f246543f8a18ee8ecf8748edec72ade508288 Mon Sep 17 00:00:00 2001 -From: xigaoxinyan -Date: Thu, 7 Apr 2022 19:25:39 +0800 -Subject: [PATCH] ImportError-py3.10 +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 --- - NameMapper.py | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) + Cheetah/NameMapper.py | 4 ++++ + 1 file changed, 4 insertions(+) -diff --git a/NameMapper.py b/NameMapper.py -index 68ded17..f5207e0 100644 +diff --git a/Cheetah/NameMapper.py b/Cheetah/NameMapper.py +index 3c16dff..d92cddd 100755 --- a/Cheetah/NameMapper.py +++ b/Cheetah/NameMapper.py -@@ -139,8 +139,10 @@ difference in realistic usage scenarios. - Cheetah uses the optimized C version (_namemapper.c) if it has +@@ -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. """ -- --from collections import Mapping + +try: + from collections.abc import Mapping +except ImportError: + from collections import Mapping import inspect from pprint import pformat - from Cheetah.compat import PY2 + -- -2.27.0 +2.23.0 diff --git a/python-cheetah.spec b/python-cheetah.spec index e132226..59cf5d5 100644 --- a/python-cheetah.spec +++ b/python-cheetah.spec @@ -1,14 +1,13 @@ Name: python-cheetah -Version: 3.1.0 -Release: 10 +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 +Source0: 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 +Patch0001: _bootlocale-removed.patch Patch0003: import-from-the-new-abc-module.patch %description @@ -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 +* Wed Jun 15 2022 houyingchao - 3.2.6-1 +- Upgrade to version 3.2.6 + * Tue Apr 12 2022 xigaoxinyan - 3.1.0-10 - import from the new abc module inside of collections