From f7a716750bd4b8d36e2f94d98c4e03b6c8befc7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 4 Nov 2021 18:18:44 +0100 Subject: [PATCH 01/38] Fix build with Python 3.11.0a1 --- 1525.patch | 33 +++++++++++++++++++++++++++ 1527.patch | 56 ++++++++++++++++++++++++++++++++++++++++++++++ python-jinja2.spec | 5 +++++ 3 files changed, 94 insertions(+) create mode 100644 1525.patch create mode 100644 1527.patch diff --git a/1525.patch b/1525.patch new file mode 100644 index 0000000..1528f23 --- /dev/null +++ b/1525.patch @@ -0,0 +1,33 @@ +From e32c985af3a419ae2ea0853ad8084a12ab62745b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= +Date: Tue, 2 Nov 2021 16:47:28 +0100 +Subject: [PATCH] Tests: Make "Traceback did not match" an actual f-string + +Otherwise the failure looks like this: + + > assert ( + m is not None + ), "Traceback did not match:\n\n{''.join(tb)}\nexpected:\n{expected_tb}" + E AssertionError: Traceback did not match: + E + E {''.join(tb)} + E expected: + E {expected_tb} + E assert None is not None +--- + tests/test_debug.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/test_debug.py b/tests/test_debug.py +index 0aec78ae4..c639bbc29 100644 +--- a/tests/test_debug.py ++++ b/tests/test_debug.py +@@ -25,7 +25,7 @@ def assert_traceback_matches(self, callback, expected_tb): + m = re.search(expected_tb.strip(), "".join(tb)) + assert ( + m is not None +- ), "Traceback did not match:\n\n{''.join(tb)}\nexpected:\n{expected_tb}" ++ ), f"Traceback did not match:\n\n{''.join(tb)}\nexpected:\n{expected_tb}" + + def test_runtime_error(self, fs_env): + def test(): diff --git a/1527.patch b/1527.patch new file mode 100644 index 0000000..e5b0b2b --- /dev/null +++ b/1527.patch @@ -0,0 +1,56 @@ +From 757756696ceebf9967ad8b8c6df60a2be7f23c51 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= +Date: Thu, 4 Nov 2021 18:03:06 +0100 +Subject: [PATCH] Tests: Adapt expected traceback regexes for Python 3.11.0a1 + +Fixes https://github.com/pallets/jinja/issues/1526 + +Before: + + File ".../broken.html", line 2, in + {{ fail() }} + File ".../test_debug.py", line 32, in + tmpl.render(fail=lambda: 1 / 0) + ZeroDivisionError: division by zero + +After: + + File ".../broken.html", line 2, in + {{ fail() }} + ^^^^^^^^^^^^ + File ".../test_debug.py", line 32, in + tmpl.render(fail=lambda: 1 / 0) + ~~^~~ + ZeroDivisionError: division by zero +--- + tests/test_debug.py | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/tests/test_debug.py b/tests/test_debug.py +index 0aec78ae4..1cb931cfc 100644 +--- a/tests/test_debug.py ++++ b/tests/test_debug.py +@@ -36,9 +36,11 @@ def test(): + test, + r""" + File ".*?broken.html", line 2, in (top-level template code|) +- \{\{ fail\(\) \}\} ++ \{\{ fail\(\) \}\}( ++ \^{12})? + File ".*debug?.pyc?", line \d+, in +- tmpl\.render\(fail=lambda: 1 / 0\) ++ tmpl\.render\(fail=lambda: 1 / 0\)( ++ ~~\^~~)? + ZeroDivisionError: (int(eger)? )?division (or modulo )?by zero + """, + ) +@@ -66,7 +68,8 @@ def test(): + test, + r""" + File ".*debug.pyc?", line \d+, in test +- raise TemplateSyntaxError\("wtf", 42\) ++ raise TemplateSyntaxError\("wtf", 42\)( ++ \^{36})? + (jinja2\.exceptions\.)?TemplateSyntaxError: wtf + line 42""", + ) diff --git a/python-jinja2.spec b/python-jinja2.spec index 4b68047..01afdbf 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -8,6 +8,11 @@ License: BSD URL: https://palletsprojects.com/p/jinja/ Source0: %{pypi_source} +# Tests: Make "Traceback did not match" an actual f-string +Patch1: https://github.com/pallets/jinja/pull/1525.patch +# Tests: Adapt expected traceback regexes for Python 3.11.0a1 +Patch2: https://github.com/pallets/jinja/pull/1527.patch + %if 0%{?fedora} || 0%{?rhel} > 7 # Enable python3 build by default %bcond_without python3 From 6f194bb41bfde389436798f9b64ca8f49ceeb9d0 Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Wed, 10 Nov 2021 09:38:20 +0100 Subject: [PATCH 02/38] Declare i18n extra to map the upstream package structure Stop requiring the explicit runtime dependencies when building with Python 3. They're read from metadata. --- python-jinja2.spec | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index 01afdbf..2c5b330 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -2,7 +2,7 @@ Name: python-jinja2 Version: 3.0.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: General purpose template engine License: BSD URL: https://palletsprojects.com/p/jinja/ @@ -91,10 +91,6 @@ BuildRequires: python3-Pallets-Sphinx-Themes BuildRequires: python3-sphinxcontrib-log-cabinet BuildRequires: python3-sphinx-issues %endif -Requires: python3-babel >= 0.8 -Requires: python3-markupsafe >= 0.23 -Requires: python3-setuptools -%{?python_provide:%python_provide python3-jinja2} %description -n python3-jinja2 Jinja2 is a template engine written in pure Python. It provides a @@ -106,6 +102,8 @@ as Smarty or Django, you should feel right at home with Jinja2. It's both designer and developer friendly by sticking to Python's principles and adding functionality useful for templating environments. + +%{?python_extras_subpkg:%python_extras_subpkg -n python3-jinja2 -i%{python3_sitelib}/Jinja2-*.egg-info i18n} %endif # with python3 @@ -184,6 +182,10 @@ PYTHONPATH=$(pwd)/src %{__python3} -m pytest tests %changelog +* Wed Nov 10 2021 Karolina Surma - 3.0.1-3 +- Don't explicitly declare runtime dependencies when building for Python 3 +- Declare jinja2+i18n extra to map the upstream package structure + * Fri Jul 23 2021 Fedora Release Engineering - 3.0.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild From 652a40287ba43d4c3d03bb642927986a5f6191c0 Mon Sep 17 00:00:00 2001 From: Thomas Moschny Date: Mon, 15 Nov 2021 21:11:41 +0100 Subject: [PATCH 03/38] Use new Python packaging guidelines. Jinja2 version 3 does not support Python 2 anymore. --- python-jinja2.spec | 140 ++++++++------------------------------------- 1 file changed, 23 insertions(+), 117 deletions(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index 2c5b330..cbb6c8a 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -2,7 +2,7 @@ Name: python-jinja2 Version: 3.0.1 -Release: 3%{?dist} +Release: 4%{?dist} Summary: General purpose template engine License: BSD URL: https://palletsprojects.com/p/jinja/ @@ -13,34 +13,14 @@ Patch1: https://github.com/pallets/jinja/pull/1525.patch # Tests: Adapt expected traceback regexes for Python 3.11.0a1 Patch2: https://github.com/pallets/jinja/pull/1527.patch -%if 0%{?fedora} || 0%{?rhel} > 7 -# Enable python3 build by default -%bcond_without python3 -%else -%bcond_with python3 -%endif - -%if 0%{?fedora} > 33 || 0%{?rhel} > 7 -# Disable python2 build by default -%bcond_with python2 -%else -%bcond_without python2 -%endif - # Enable building without docs to avoid a circular dependency between this # and python-sphinx: %bcond_without docs -%if 0%{?fedora} || 0%{?rhel} > 7 -%bcond_without async -%else -%bcond_with async -%endif - BuildArch: noarch -%description -Jinja2 is a template engine written in pure Python. It provides a +%global _description %{expand: +Jinja2 is a template engine written in pure Python. It provides a Django inspired non-XML syntax but supports inline expressions and an optional sandboxed environment. @@ -48,42 +28,13 @@ If you have any exposure to other text-based template languages, such as Smarty or Django, you should feel right at home with Jinja2. It's both designer and developer friendly by sticking to Python's principles and adding functionality useful for templating -environments. +environments.} +%description %_description -%if %{with python2} -%package -n python2-jinja2 -Summary: General purpose template engine for python2 -BuildRequires: python2-devel -BuildRequires: python2-setuptools -BuildRequires: python2-babel >= 0.8 -BuildRequires: python2-markupsafe >= 0.23 -Requires: python2-babel >= 0.8 -Requires: python2-markupsafe >= 0.23 -Requires: python2-setuptools -%{?python_provide:%python_provide python2-jinja2} - -%description -n python2-jinja2 -Jinja2 is a template engine written in pure Python. It provides a -Django inspired non-XML syntax but supports inline expressions and an -optional sandboxed environment. - -If you have any exposure to other text-based template languages, such -as Smarty or Django, you should feel right at home with Jinja2. It's -both designer and developer friendly by sticking to Python's -principles and adding functionality useful for templating -environments. -%endif # with python2 - - -%if %{with python3} %package -n python3-jinja2 -Summary: General purpose template engine for python3 +Summary: %{summary} BuildRequires: python3-devel -BuildRequires: python3-setuptools -BuildRequires: python3-babel >= 0.8 -BuildRequires: python3-markupsafe >= 0.23 -BuildRequires: python3-pytest %if %{with docs} BuildRequires: %{_bindir}/sphinx-build-3 BuildRequires: make @@ -92,96 +43,51 @@ BuildRequires: python3-sphinxcontrib-log-cabinet BuildRequires: python3-sphinx-issues %endif -%description -n python3-jinja2 -Jinja2 is a template engine written in pure Python. It provides a -Django inspired non-XML syntax but supports inline expressions and an -optional sandboxed environment. +%description -n python3-jinja2 %_description -If you have any exposure to other text-based template languages, such -as Smarty or Django, you should feel right at home with Jinja2. It's -both designer and developer friendly by sticking to Python's -principles and adding functionality useful for templating -environments. - -%{?python_extras_subpkg:%python_extras_subpkg -n python3-jinja2 -i%{python3_sitelib}/Jinja2-*.egg-info i18n} -%endif # with python3 +%pyproject_extras_subpkg -n python3-jinja2 i18n %prep %autosetup -p1 -n %{srcname}-%{version} -# cleanup -find . -name '*.pyo' -o -name '*.pyc' -delete + +%generate_buildrequires +%pyproject_buildrequires -x i18n + %build -%if %{with python2} -%py2_build -%endif # with python2 - -%if %{with python3} -%py3_build +%pyproject_wheel %if %{with docs} make -C docs html PYTHONPATH=$(pwd)/src SPHINXBUILD=sphinx-build-3 # remove hidden file -rm -rf docs/_build/html/.buildinfo -%endif # with docs -%endif # with python3 +rm -rvf docs/_build/html/.buildinfo +%endif %install -%if %{with python2} -%py2_install - -# these files are valid only on Python 3.6+ -rm %{buildroot}%{python2_sitelib}/jinja2/asyncsupport.py -rm %{buildroot}%{python2_sitelib}/jinja2/asyncfilters.py -%endif # with python2 - -%if %{with python3} -%py3_install - -%if ! %{with async} -# these files are valid only on Python 3.6+ -rm %{buildroot}%{python3_sitelib}/jinja2/asyncsupport.py -rm %{buildroot}%{python3_sitelib}/jinja2/asyncfilters.py -%endif # ! with async -%endif # with python3 +%pyproject_install +%pyproject_save_files jinja2 %check -%if %{with python3} -PYTHONPATH=$(pwd)/src %{__python3} -m pytest tests -%endif # with python3 +%pytest tests -%if %{with python2} -%files -n python2-jinja2 -%doc CHANGES.rst -%doc ext -%doc examples -%license LICENSE.rst -%if %{with docs} -%doc docs/_build/html -%endif -%{python2_sitelib}/jinja2/ -%{python2_sitelib}/Jinja2-*.egg-info/ -%endif # with python2 - - -%if %{with python3} -%files -n python3-jinja2 +%files -n python3-jinja2 -f %{pyproject_files} %doc CHANGES.rst %doc examples %license LICENSE.rst %if %{with docs} %doc docs/_build/html %endif -%{python3_sitelib}/jinja2/ -%{python3_sitelib}/Jinja2-*.egg-info/ -%endif # with python3 %changelog +* Mon Nov 15 2021 Thomas Moschny - 3.0.1-4 +- Use new Python packaging guidelines. +- Jinja2 version 3 does not support Python 2 anymore. + * Wed Nov 10 2021 Karolina Surma - 3.0.1-3 - Don't explicitly declare runtime dependencies when building for Python 3 - Declare jinja2+i18n extra to map the upstream package structure From b498647db83ea5dd01d9af70e10a135e0eca4ca5 Mon Sep 17 00:00:00 2001 From: Thomas Moschny Date: Mon, 15 Nov 2021 21:25:57 +0100 Subject: [PATCH 04/38] Update to 3.0.3. --- 1527.patch | 56 ---------------------------------------------- python-jinja2.spec | 11 ++++----- sources | 2 +- 3 files changed, 7 insertions(+), 62 deletions(-) delete mode 100644 1527.patch diff --git a/1527.patch b/1527.patch deleted file mode 100644 index e5b0b2b..0000000 --- a/1527.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 757756696ceebf9967ad8b8c6df60a2be7f23c51 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= -Date: Thu, 4 Nov 2021 18:03:06 +0100 -Subject: [PATCH] Tests: Adapt expected traceback regexes for Python 3.11.0a1 - -Fixes https://github.com/pallets/jinja/issues/1526 - -Before: - - File ".../broken.html", line 2, in - {{ fail() }} - File ".../test_debug.py", line 32, in - tmpl.render(fail=lambda: 1 / 0) - ZeroDivisionError: division by zero - -After: - - File ".../broken.html", line 2, in - {{ fail() }} - ^^^^^^^^^^^^ - File ".../test_debug.py", line 32, in - tmpl.render(fail=lambda: 1 / 0) - ~~^~~ - ZeroDivisionError: division by zero ---- - tests/test_debug.py | 9 ++++++--- - 1 file changed, 6 insertions(+), 3 deletions(-) - -diff --git a/tests/test_debug.py b/tests/test_debug.py -index 0aec78ae4..1cb931cfc 100644 ---- a/tests/test_debug.py -+++ b/tests/test_debug.py -@@ -36,9 +36,11 @@ def test(): - test, - r""" - File ".*?broken.html", line 2, in (top-level template code|) -- \{\{ fail\(\) \}\} -+ \{\{ fail\(\) \}\}( -+ \^{12})? - File ".*debug?.pyc?", line \d+, in -- tmpl\.render\(fail=lambda: 1 / 0\) -+ tmpl\.render\(fail=lambda: 1 / 0\)( -+ ~~\^~~)? - ZeroDivisionError: (int(eger)? )?division (or modulo )?by zero - """, - ) -@@ -66,7 +68,8 @@ def test(): - test, - r""" - File ".*debug.pyc?", line \d+, in test -- raise TemplateSyntaxError\("wtf", 42\) -+ raise TemplateSyntaxError\("wtf", 42\)( -+ \^{36})? - (jinja2\.exceptions\.)?TemplateSyntaxError: wtf - line 42""", - ) diff --git a/python-jinja2.spec b/python-jinja2.spec index cbb6c8a..6c81bf7 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -1,8 +1,8 @@ %global srcname Jinja2 Name: python-jinja2 -Version: 3.0.1 -Release: 4%{?dist} +Version: 3.0.3 +Release: 1%{?dist} Summary: General purpose template engine License: BSD URL: https://palletsprojects.com/p/jinja/ @@ -10,8 +10,6 @@ Source0: %{pypi_source} # Tests: Make "Traceback did not match" an actual f-string Patch1: https://github.com/pallets/jinja/pull/1525.patch -# Tests: Adapt expected traceback regexes for Python 3.11.0a1 -Patch2: https://github.com/pallets/jinja/pull/1527.patch # Enable building without docs to avoid a circular dependency between this # and python-sphinx: @@ -38,7 +36,7 @@ BuildRequires: python3-devel %if %{with docs} BuildRequires: %{_bindir}/sphinx-build-3 BuildRequires: make -BuildRequires: python3-Pallets-Sphinx-Themes +BuildRequires: python3-Pallets-Sphinx-Themes >= 2 BuildRequires: python3-sphinxcontrib-log-cabinet BuildRequires: python3-sphinx-issues %endif @@ -84,6 +82,9 @@ rm -rvf docs/_build/html/.buildinfo %changelog +* Mon Nov 15 2021 Thomas Moschny - 3.0.3-1 +- Update to 3.0.3. + * Mon Nov 15 2021 Thomas Moschny - 3.0.1-4 - Use new Python packaging guidelines. - Jinja2 version 3 does not support Python 2 anymore. diff --git a/sources b/sources index 166072d..d2d7771 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Jinja2-3.0.1.tar.gz) = 18ca56fb2271885c41982d2a3b2daa8bdc7a95191f54d8eec96ddbe001ac995b3fae766b603d8c9287413e5227062b771575012cd92a3f64ed76067d5f168701 +SHA512 (Jinja2-3.0.3.tar.gz) = 51703d396ffe35155ed216922294441e20d44cd1ab69674140146375d4964654cdb32b38945f22916e0de917bbc0cf406cb680c2e569f9225dbe1fe4063be0b0 From 9326937b8ee5bea35bdd39a793be6af0c139e860 Mon Sep 17 00:00:00 2001 From: Thomas Moschny Date: Mon, 15 Nov 2021 21:46:48 +0100 Subject: [PATCH 05/38] Re-add BR on pytest. --- python-jinja2.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/python-jinja2.spec b/python-jinja2.spec index 6c81bf7..5206d81 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -33,6 +33,7 @@ environments.} %package -n python3-jinja2 Summary: %{summary} BuildRequires: python3-devel +BuildRequires: python3-pytest %if %{with docs} BuildRequires: %{_bindir}/sphinx-build-3 BuildRequires: make From abbbe06df6372ddb51820a1357b63e4c3cea4519 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 21 Jan 2022 12:57:26 +0000 Subject: [PATCH 06/38] - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- python-jinja2.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index 5206d81..7252529 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -2,7 +2,7 @@ Name: python-jinja2 Version: 3.0.3 -Release: 1%{?dist} +Release: 2%{?dist} Summary: General purpose template engine License: BSD URL: https://palletsprojects.com/p/jinja/ @@ -83,6 +83,9 @@ rm -rvf docs/_build/html/.buildinfo %changelog +* Fri Jan 21 2022 Fedora Release Engineering - 3.0.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + * Mon Nov 15 2021 Thomas Moschny - 3.0.3-1 - Update to 3.0.3. From 5147748d39d3818a51410e67c1fcd52ac6dc79f7 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Mon, 13 Jun 2022 17:36:16 +0200 Subject: [PATCH 07/38] Bootstrap for Python 3.11 --- python-jinja2.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index 7252529..c041da3 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -1,8 +1,9 @@ +%global _without_docs 1 %global srcname Jinja2 Name: python-jinja2 Version: 3.0.3 -Release: 2%{?dist} +Release: 3%{?dist} Summary: General purpose template engine License: BSD URL: https://palletsprojects.com/p/jinja/ @@ -83,6 +84,9 @@ rm -rvf docs/_build/html/.buildinfo %changelog +* Mon Jun 13 2022 Python Maint - 3.0.3-3 +- Bootstrap for Python 3.11 + * Fri Jan 21 2022 Fedora Release Engineering - 3.0.3-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild From 86d162e6a12417c5773ef65817b55a5ef4a473a6 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Mon, 13 Jun 2022 18:40:52 +0200 Subject: [PATCH 08/38] Rebuilt for Python 3.11 --- python-jinja2.spec | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index c041da3..7dede72 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -1,9 +1,8 @@ -%global _without_docs 1 %global srcname Jinja2 Name: python-jinja2 Version: 3.0.3 -Release: 3%{?dist} +Release: 4%{?dist} Summary: General purpose template engine License: BSD URL: https://palletsprojects.com/p/jinja/ @@ -84,6 +83,9 @@ rm -rvf docs/_build/html/.buildinfo %changelog +* Mon Jun 13 2022 Python Maint - 3.0.3-4 +- Rebuilt for Python 3.11 + * Mon Jun 13 2022 Python Maint - 3.0.3-3 - Bootstrap for Python 3.11 From e059429ee9c5acac0fa2b1a8f3670dd4b98d77bb Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 22 Jul 2022 19:29:03 +0000 Subject: [PATCH 09/38] Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- python-jinja2.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index 7dede72..690a3a1 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -2,7 +2,7 @@ Name: python-jinja2 Version: 3.0.3 -Release: 4%{?dist} +Release: 5%{?dist} Summary: General purpose template engine License: BSD URL: https://palletsprojects.com/p/jinja/ @@ -83,6 +83,9 @@ rm -rvf docs/_build/html/.buildinfo %changelog +* Fri Jul 22 2022 Fedora Release Engineering - 3.0.3-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + * Mon Jun 13 2022 Python Maint - 3.0.3-4 - Rebuilt for Python 3.11 From 7387df56e9f54d64d1664e59aedc8edb4c09e825 Mon Sep 17 00:00:00 2001 From: Lumir Balhar Date: Fri, 11 Nov 2022 18:15:31 +0100 Subject: [PATCH 10/38] Fix compatibility with pytest 7.2.0 --- python-jinja2.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index 690a3a1..b910b09 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -2,7 +2,7 @@ Name: python-jinja2 Version: 3.0.3 -Release: 5%{?dist} +Release: 6%{?dist} Summary: General purpose template engine License: BSD URL: https://palletsprojects.com/p/jinja/ @@ -50,6 +50,8 @@ BuildRequires: python3-sphinx-issues %prep %autosetup -p1 -n %{srcname}-%{version} +# Fix for https://github.com/pallets/jinja/issues/1758 +sed -i "s/def teardown/def teardown_method/" tests/test_loader.py %generate_buildrequires %pyproject_buildrequires -x i18n @@ -83,6 +85,9 @@ rm -rvf docs/_build/html/.buildinfo %changelog +* Mon Nov 14 2022 Lumír Balhar - 3.0.3-6 +- Fix compatibility with pytest 7.2 + * Fri Jul 22 2022 Fedora Release Engineering - 3.0.3-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild From ba5d786db5abb63fc2f77d26239470d8b6121321 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 20 Jan 2023 14:08:29 +0000 Subject: [PATCH 11/38] Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- python-jinja2.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index b910b09..9f009a1 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -2,7 +2,7 @@ Name: python-jinja2 Version: 3.0.3 -Release: 6%{?dist} +Release: 7%{?dist} Summary: General purpose template engine License: BSD URL: https://palletsprojects.com/p/jinja/ @@ -85,6 +85,9 @@ rm -rvf docs/_build/html/.buildinfo %changelog +* Fri Jan 20 2023 Fedora Release Engineering - 3.0.3-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + * Mon Nov 14 2022 Lumír Balhar - 3.0.3-6 - Fix compatibility with pytest 7.2 From 200fff0803b36c0f2a29e916e0da2505a46335c2 Mon Sep 17 00:00:00 2001 From: Sandro Mani Date: Tue, 2 May 2023 00:21:00 +0200 Subject: [PATCH 12/38] Update to 3.1.2 --- 1525.patch | 33 --------------------------------- python-jinja2.spec | 12 ++++++------ sources | 2 +- 3 files changed, 7 insertions(+), 40 deletions(-) delete mode 100644 1525.patch diff --git a/1525.patch b/1525.patch deleted file mode 100644 index 1528f23..0000000 --- a/1525.patch +++ /dev/null @@ -1,33 +0,0 @@ -From e32c985af3a419ae2ea0853ad8084a12ab62745b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= -Date: Tue, 2 Nov 2021 16:47:28 +0100 -Subject: [PATCH] Tests: Make "Traceback did not match" an actual f-string - -Otherwise the failure looks like this: - - > assert ( - m is not None - ), "Traceback did not match:\n\n{''.join(tb)}\nexpected:\n{expected_tb}" - E AssertionError: Traceback did not match: - E - E {''.join(tb)} - E expected: - E {expected_tb} - E assert None is not None ---- - tests/test_debug.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tests/test_debug.py b/tests/test_debug.py -index 0aec78ae4..c639bbc29 100644 ---- a/tests/test_debug.py -+++ b/tests/test_debug.py -@@ -25,7 +25,7 @@ def assert_traceback_matches(self, callback, expected_tb): - m = re.search(expected_tb.strip(), "".join(tb)) - assert ( - m is not None -- ), "Traceback did not match:\n\n{''.join(tb)}\nexpected:\n{expected_tb}" -+ ), f"Traceback did not match:\n\n{''.join(tb)}\nexpected:\n{expected_tb}" - - def test_runtime_error(self, fs_env): - def test(): diff --git a/python-jinja2.spec b/python-jinja2.spec index 9f009a1..308a34f 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -1,15 +1,12 @@ %global srcname Jinja2 Name: python-jinja2 -Version: 3.0.3 -Release: 7%{?dist} +Version: 3.1.2 +Release: 1%{?dist} Summary: General purpose template engine License: BSD URL: https://palletsprojects.com/p/jinja/ -Source0: %{pypi_source} - -# Tests: Make "Traceback did not match" an actual f-string -Patch1: https://github.com/pallets/jinja/pull/1525.patch +Source0: %{pypi_source %srcname} # Enable building without docs to avoid a circular dependency between this # and python-sphinx: @@ -85,6 +82,9 @@ rm -rvf docs/_build/html/.buildinfo %changelog +* Mon May 01 2023 Sandro Mani - 3.1.2-1 +- Update to 3.1.2 + * Fri Jan 20 2023 Fedora Release Engineering - 3.0.3-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild diff --git a/sources b/sources index d2d7771..0b8ad3a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Jinja2-3.0.3.tar.gz) = 51703d396ffe35155ed216922294441e20d44cd1ab69674140146375d4964654cdb32b38945f22916e0de917bbc0cf406cb680c2e569f9225dbe1fe4063be0b0 +SHA512 (Jinja2-3.1.2.tar.gz) = 5dfe122c1beef5305b34d25f22f96607bd3a6cba098b03091850ea36fefe62b645a7218d7584b35bea252393ac922c9bb3654a9e90f23bcfb273e811fcf2f2c1 From 6eece4eaca98ab8858c33fc30750658b660fff3e Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Tue, 16 May 2023 17:04:21 -0400 Subject: [PATCH 13/38] Disable docs by default in RHEL builds RHEL does not include some of the doc dependencies. This is based on c9s: https://gitlab.com/redhat/centos-stream/rpms/python-jinja2/-/commit/8e7e566ba7e76950f083757e95a01c2b0cbc70e0 --- python-jinja2.spec | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index 308a34f..ae67b5a 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -2,7 +2,7 @@ Name: python-jinja2 Version: 3.1.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: General purpose template engine License: BSD URL: https://palletsprojects.com/p/jinja/ @@ -10,7 +10,11 @@ Source0: %{pypi_source %srcname} # Enable building without docs to avoid a circular dependency between this # and python-sphinx: +%if 0%{?rhel} +%bcond_with docs +%else %bcond_without docs +%endif BuildArch: noarch @@ -82,6 +86,9 @@ rm -rvf docs/_build/html/.buildinfo %changelog +* Fri May 19 2023 Yaakov Selkowitz - 3.1.2-2 +- Disable docs by default in RHEL builds + * Mon May 01 2023 Sandro Mani - 3.1.2-1 - Update to 3.1.2 From 3c58a5d51941271db2b731c15eef2f7464f68fca Mon Sep 17 00:00:00 2001 From: Python Maint Date: Wed, 14 Jun 2023 00:03:28 +0200 Subject: [PATCH 14/38] Bootstrap for Python 3.12 --- python-jinja2.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index ae67b5a..1f482ae 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -1,8 +1,9 @@ +%global _without_docs 1 %global srcname Jinja2 Name: python-jinja2 Version: 3.1.2 -Release: 2%{?dist} +Release: 3%{?dist} Summary: General purpose template engine License: BSD URL: https://palletsprojects.com/p/jinja/ @@ -86,6 +87,9 @@ rm -rvf docs/_build/html/.buildinfo %changelog +* Tue Jun 13 2023 Python Maint - 3.1.2-3 +- Bootstrap for Python 3.12 + * Fri May 19 2023 Yaakov Selkowitz - 3.1.2-2 - Disable docs by default in RHEL builds From d228954a403b2b40fdb71414fd176e8d13b906cd Mon Sep 17 00:00:00 2001 From: Python Maint Date: Fri, 16 Jun 2023 08:18:06 +0200 Subject: [PATCH 15/38] Rebuilt for Python 3.12 --- python-jinja2.spec | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index 1f482ae..7f381fd 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -1,9 +1,8 @@ -%global _without_docs 1 %global srcname Jinja2 Name: python-jinja2 Version: 3.1.2 -Release: 3%{?dist} +Release: 4%{?dist} Summary: General purpose template engine License: BSD URL: https://palletsprojects.com/p/jinja/ @@ -87,6 +86,9 @@ rm -rvf docs/_build/html/.buildinfo %changelog +* Fri Jun 16 2023 Python Maint - 3.1.2-4 +- Rebuilt for Python 3.12 + * Tue Jun 13 2023 Python Maint - 3.1.2-3 - Bootstrap for Python 3.12 From 05480f2accced7d8d9fd380a5b048aefbc6be1e4 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 21 Jul 2023 10:44:21 +0000 Subject: [PATCH 16/38] Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- python-jinja2.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index 7f381fd..4b1f5df 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -2,7 +2,7 @@ Name: python-jinja2 Version: 3.1.2 -Release: 4%{?dist} +Release: 5%{?dist} Summary: General purpose template engine License: BSD URL: https://palletsprojects.com/p/jinja/ @@ -86,6 +86,9 @@ rm -rvf docs/_build/html/.buildinfo %changelog +* Fri Jul 21 2023 Fedora Release Engineering - 3.1.2-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + * Fri Jun 16 2023 Python Maint - 3.1.2-4 - Rebuilt for Python 3.12 From fc015d1bcf201262caa1525455193ca4305418d5 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Tue, 1 Aug 2023 02:55:56 -0400 Subject: [PATCH 17/38] Disable docs in flatpak builds As of F39, flatpak builds will not be able to manually override macros. --- python-jinja2.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index 4b1f5df..9031193 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -10,7 +10,7 @@ Source0: %{pypi_source %srcname} # Enable building without docs to avoid a circular dependency between this # and python-sphinx: -%if 0%{?rhel} +%if 0%{?rhel} || 0%{?flatpak} %bcond_with docs %else %bcond_without docs From 7bb65e9cfd47fa69b6fbe65de8f5303a85054c24 Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Tue, 8 Aug 2023 15:07:41 +0200 Subject: [PATCH 18/38] Declare the license as an SPDX expression --- python-jinja2.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index 9031193..f907e91 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -2,9 +2,9 @@ Name: python-jinja2 Version: 3.1.2 -Release: 5%{?dist} +Release: 6%{?dist} Summary: General purpose template engine -License: BSD +License: BSD-3-Clause URL: https://palletsprojects.com/p/jinja/ Source0: %{pypi_source %srcname} @@ -86,6 +86,9 @@ rm -rvf docs/_build/html/.buildinfo %changelog +* Tue Aug 08 2023 Karolina Surma - 3.1.2-6 +- Declare the license as an SPDX expression + * Fri Jul 21 2023 Fedora Release Engineering - 3.1.2-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild From 512d58d5216b9bb8b6f3082f077557092b6442f5 Mon Sep 17 00:00:00 2001 From: Michel Lind Date: Thu, 11 Jan 2024 10:57:45 -0600 Subject: [PATCH 19/38] Update to 3.1.3 to fix CVE-2024-22195 Signed-off-by: Michel Lind --- python-jinja2.spec | 7 +++++-- sources | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index f907e91..f3e035b 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -1,8 +1,8 @@ %global srcname Jinja2 Name: python-jinja2 -Version: 3.1.2 -Release: 6%{?dist} +Version: 3.1.3 +Release: 1%{?dist} Summary: General purpose template engine License: BSD-3-Clause URL: https://palletsprojects.com/p/jinja/ @@ -86,6 +86,9 @@ rm -rvf docs/_build/html/.buildinfo %changelog +* Thu Jan 11 2024 Michel Lind - 3.1.3-1 +- Update to 3.1.3 to fix CVE-2024-22195 + * Tue Aug 08 2023 Karolina Surma - 3.1.2-6 - Declare the license as an SPDX expression diff --git a/sources b/sources index 0b8ad3a..650df3d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Jinja2-3.1.2.tar.gz) = 5dfe122c1beef5305b34d25f22f96607bd3a6cba098b03091850ea36fefe62b645a7218d7584b35bea252393ac922c9bb3654a9e90f23bcfb273e811fcf2f2c1 +SHA512 (Jinja2-3.1.3.tar.gz) = 5c36d0cd094b40626511f30c561176c095c49ef4066c2752a9edc3e6feb2430dafa866c17deebddcd0168aa1f0fd3944916d592c5c999639b8152e7c1009c700 From 0a28ad92e79c51ca1576b286e9b04af75911b976 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Mon, 22 Jan 2024 02:45:08 +0000 Subject: [PATCH 20/38] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- python-jinja2.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index f3e035b..e84bdd1 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -2,7 +2,7 @@ Name: python-jinja2 Version: 3.1.3 -Release: 1%{?dist} +Release: 2%{?dist} Summary: General purpose template engine License: BSD-3-Clause URL: https://palletsprojects.com/p/jinja/ @@ -86,6 +86,9 @@ rm -rvf docs/_build/html/.buildinfo %changelog +* Mon Jan 22 2024 Fedora Release Engineering - 3.1.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Thu Jan 11 2024 Michel Lind - 3.1.3-1 - Update to 3.1.3 to fix CVE-2024-22195 From 9aeba43e961704e825aa841f8d31393ca5d3ee82 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 26 Jan 2024 05:41:08 +0000 Subject: [PATCH 21/38] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- python-jinja2.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index e84bdd1..455bb37 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -2,7 +2,7 @@ Name: python-jinja2 Version: 3.1.3 -Release: 2%{?dist} +Release: 3%{?dist} Summary: General purpose template engine License: BSD-3-Clause URL: https://palletsprojects.com/p/jinja/ @@ -86,6 +86,9 @@ rm -rvf docs/_build/html/.buildinfo %changelog +* Fri Jan 26 2024 Fedora Release Engineering - 3.1.3-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Mon Jan 22 2024 Fedora Release Engineering - 3.1.3-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From 4d9e43b39a4cbe4fc4c7a06e61d1ee3bf01ee65e Mon Sep 17 00:00:00 2001 From: Tim Landscheidt Date: Sun, 17 Mar 2024 23:06:05 +0000 Subject: [PATCH 22/38] Remove outdated sed to rename test teardown methods The issue was fixed in 3.1.3 via https://github.com/pallets/jinja/commit/3fadee01b712580d811bdd2cb06cd8a1b5ee0821 The sed turns teardown_method into teardown_method_method. --- python-jinja2.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index 455bb37..f94bee6 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -51,8 +51,6 @@ BuildRequires: python3-sphinx-issues %prep %autosetup -p1 -n %{srcname}-%{version} -# Fix for https://github.com/pallets/jinja/issues/1758 -sed -i "s/def teardown/def teardown_method/" tests/test_loader.py %generate_buildrequires %pyproject_buildrequires -x i18n From 18d1a5374f68be5e4533052708a9afdf9883cc00 Mon Sep 17 00:00:00 2001 From: Lumir Balhar Date: Tue, 7 May 2024 13:38:16 +0200 Subject: [PATCH 23/38] Update to 3.1.4 (rhbz#2279211) --- .gitignore | 1 + python-jinja2.spec | 15 +++++++++------ sources | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 02c0702..ced8d09 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /Jinja2-*.tar.gz +/jinja2-3.1.4.tar.gz diff --git a/python-jinja2.spec b/python-jinja2.spec index f94bee6..13a2274 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -1,8 +1,8 @@ -%global srcname Jinja2 +%global srcname jinja2 Name: python-jinja2 -Version: 3.1.3 -Release: 3%{?dist} +Version: 3.1.4 +Release: 1%{?dist} Summary: General purpose template engine License: BSD-3-Clause URL: https://palletsprojects.com/p/jinja/ @@ -75,15 +75,18 @@ rm -rvf docs/_build/html/.buildinfo %files -n python3-jinja2 -f %{pyproject_files} -%doc CHANGES.rst -%doc examples -%license LICENSE.rst +%doc README.md +%doc docs/examples +%license LICENSE.txt %if %{with docs} %doc docs/_build/html %endif %changelog +* Tue May 07 2024 Lumír Balhar - 3.1.4-1 +- Update to 3.1.4 (rhbz#2279211,rhbz#2279491) + * Fri Jan 26 2024 Fedora Release Engineering - 3.1.3-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild diff --git a/sources b/sources index 650df3d..04e4371 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Jinja2-3.1.3.tar.gz) = 5c36d0cd094b40626511f30c561176c095c49ef4066c2752a9edc3e6feb2430dafa866c17deebddcd0168aa1f0fd3944916d592c5c999639b8152e7c1009c700 +SHA512 (jinja2-3.1.4.tar.gz) = d07d68a2687af68c705d3b7f5a2c67aca7b9d125316b15085888b9d0d6e769981af76f6f524728b89b5501bd671d518fcb2638f9ae112e57ca2bf2a53482cd89 From e84a72433ecf5475fc0a5e87f3d2aeb20591b2ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 23 May 2024 15:32:31 +0200 Subject: [PATCH 24/38] Python 3.13 fixes - Fixes: rhzb#2245265 --- python-jinja2.spec | 12 +- python3.13.patch | 581 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 592 insertions(+), 1 deletion(-) create mode 100644 python3.13.patch diff --git a/python-jinja2.spec b/python-jinja2.spec index 13a2274..053e95d 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -2,12 +2,17 @@ Name: python-jinja2 Version: 3.1.4 -Release: 1%{?dist} +Release: 2%{?dist} Summary: General purpose template engine License: BSD-3-Clause URL: https://palletsprojects.com/p/jinja/ Source0: %{pypi_source %srcname} +# Python 3.13 fixes +# https://github.com/pallets/jinja/pull/1960 +# https://github.com/pallets/jinja/pull/1977 +Patch: python3.13.patch + # Enable building without docs to avoid a circular dependency between this # and python-sphinx: %if 0%{?rhel} || 0%{?flatpak} @@ -35,6 +40,7 @@ environments.} Summary: %{summary} BuildRequires: python3-devel BuildRequires: python3-pytest +BuildRequires: python3-trio %if %{with docs} BuildRequires: %{_bindir}/sphinx-build-3 BuildRequires: make @@ -84,6 +90,10 @@ rm -rvf docs/_build/html/.buildinfo %changelog +* Thu May 23 2024 Miro Hrončok - 3.1.4-2 +- Python 3.13 fixes +- Fixes: rhzb#2245265 + * Tue May 07 2024 Lumír Balhar - 3.1.4-1 - Update to 3.1.4 (rhbz#2279211,rhbz#2279491) diff --git a/python3.13.patch b/python3.13.patch new file mode 100644 index 0000000..d0b021e --- /dev/null +++ b/python3.13.patch @@ -0,0 +1,581 @@ +From d44af7635fa97e980673f29c6192d9fc5cbfc85a Mon Sep 17 00:00:00 2001 +From: Thomas Grainger +Date: Thu, 23 May 2024 15:30:36 +0200 +Subject: [PATCH] Python 3.13 fixes + +Combined from: + - https://github.com/pallets/jinja/pull/1960 + - https://github.com/pallets/jinja/pull/1977 + +Co-Authored-By: David Lord +--- + src/jinja2/async_utils.py | 25 ++++++-- + src/jinja2/compiler.py | 46 +++++++++----- + src/jinja2/environment.py | 12 +++- + tests/test_async.py | 122 +++++++++++++++++++++++++++++------- + tests/test_async_filters.py | 67 ++++++++++++++++---- + tests/test_loader.py | 5 +- + 6 files changed, 214 insertions(+), 63 deletions(-) + +diff --git a/src/jinja2/async_utils.py b/src/jinja2/async_utils.py +index e65219e..b0d277d 100644 +--- a/src/jinja2/async_utils.py ++++ b/src/jinja2/async_utils.py +@@ -6,6 +6,9 @@ from functools import wraps + from .utils import _PassArg + from .utils import pass_eval_context + ++if t.TYPE_CHECKING: ++ import typing_extensions as te ++ + V = t.TypeVar("V") + + +@@ -67,15 +70,27 @@ async def auto_await(value: t.Union[t.Awaitable["V"], "V"]) -> "V": + return t.cast("V", value) + + +-async def auto_aiter( ++class _IteratorToAsyncIterator(t.Generic[V]): ++ def __init__(self, iterator: "t.Iterator[V]"): ++ self._iterator = iterator ++ ++ def __aiter__(self) -> "te.Self": ++ return self ++ ++ async def __anext__(self) -> V: ++ try: ++ return next(self._iterator) ++ except StopIteration as e: ++ raise StopAsyncIteration(e.value) from e ++ ++ ++def auto_aiter( + iterable: "t.Union[t.AsyncIterable[V], t.Iterable[V]]", + ) -> "t.AsyncIterator[V]": + if hasattr(iterable, "__aiter__"): +- async for item in t.cast("t.AsyncIterable[V]", iterable): +- yield item ++ return iterable.__aiter__() + else: +- for item in iterable: +- yield item ++ return _IteratorToAsyncIterator(iter(iterable)) + + + async def auto_to_list( +diff --git a/src/jinja2/compiler.py b/src/jinja2/compiler.py +index 2740717..91720c5 100644 +--- a/src/jinja2/compiler.py ++++ b/src/jinja2/compiler.py +@@ -55,7 +55,7 @@ def optimizeconst(f: F) -> F: + + return f(self, node, frame, **kwargs) + +- return update_wrapper(t.cast(F, new_func), f) ++ return update_wrapper(new_func, f) # type: ignore[return-value] + + + def _make_binop(op: str) -> t.Callable[["CodeGenerator", nodes.BinExpr, "Frame"], None]: +@@ -902,12 +902,15 @@ class CodeGenerator(NodeVisitor): + if not self.environment.is_async: + self.writeline("yield from parent_template.root_render_func(context)") + else: +- self.writeline( +- "async for event in parent_template.root_render_func(context):" +- ) ++ self.writeline("agen = parent_template.root_render_func(context)") ++ self.writeline("try:") ++ self.indent() ++ self.writeline("async for event in agen:") + self.indent() + self.writeline("yield event") + self.outdent() ++ self.outdent() ++ self.writeline("finally: await agen.aclose()") + self.outdent(1 + (not self.has_known_extends)) + + # at this point we now have the blocks collected and can visit them too. +@@ -977,14 +980,20 @@ class CodeGenerator(NodeVisitor): + f"yield from context.blocks[{node.name!r}][0]({context})", node + ) + else: ++ self.writeline(f"gen = context.blocks[{node.name!r}][0]({context})") ++ self.writeline("try:") ++ self.indent() + self.writeline( +- f"{self.choose_async()}for event in" +- f" context.blocks[{node.name!r}][0]({context}):", ++ f"{self.choose_async()}for event in gen:", + node, + ) + self.indent() + self.simple_write("event", frame) + self.outdent() ++ self.outdent() ++ self.writeline( ++ f"finally: {self.choose_async('await gen.aclose()', 'gen.close()')}" ++ ) + + self.outdent(level) + +@@ -1057,26 +1066,33 @@ class CodeGenerator(NodeVisitor): + self.writeline("else:") + self.indent() + +- skip_event_yield = False ++ def loop_body() -> None: ++ self.indent() ++ self.simple_write("event", frame) ++ self.outdent() ++ + if node.with_context: + self.writeline( +- f"{self.choose_async()}for event in template.root_render_func(" ++ f"gen = template.root_render_func(" + "template.new_context(context.get_all(), True," +- f" {self.dump_local_context(frame)})):" ++ f" {self.dump_local_context(frame)}))" ++ ) ++ self.writeline("try:") ++ self.indent() ++ self.writeline(f"{self.choose_async()}for event in gen:") ++ loop_body() ++ self.outdent() ++ self.writeline( ++ f"finally: {self.choose_async('await gen.aclose()', 'gen.close()')}" + ) + elif self.environment.is_async: + self.writeline( + "for event in (await template._get_default_module_async())" + "._body_stream:" + ) ++ loop_body() + else: + self.writeline("yield from template._get_default_module()._body_stream") +- skip_event_yield = True +- +- if not skip_event_yield: +- self.indent() +- self.simple_write("event", frame) +- self.outdent() + + if node.ignore_missing: + self.outdent() +diff --git a/src/jinja2/environment.py b/src/jinja2/environment.py +index 1d3be0b..bdd6a2b 100644 +--- a/src/jinja2/environment.py ++++ b/src/jinja2/environment.py +@@ -1358,7 +1358,7 @@ class Template: + + async def generate_async( + self, *args: t.Any, **kwargs: t.Any +- ) -> t.AsyncIterator[str]: ++ ) -> t.AsyncGenerator[str, object]: + """An async version of :meth:`generate`. Works very similarly but + returns an async iterator instead. + """ +@@ -1370,8 +1370,14 @@ class Template: + ctx = self.new_context(dict(*args, **kwargs)) + + try: +- async for event in self.root_render_func(ctx): # type: ignore +- yield event ++ agen = self.root_render_func(ctx) ++ try: ++ async for event in agen: # type: ignore ++ yield event ++ finally: ++ # we can't use async with aclosing(...) because that's only ++ # in 3.10+ ++ await agen.aclose() # type: ignore + except Exception: + yield self.environment.handle_exception() + +diff --git a/tests/test_async.py b/tests/test_async.py +index c9ba70c..4edced9 100644 +--- a/tests/test_async.py ++++ b/tests/test_async.py +@@ -1,6 +1,7 @@ + import asyncio + + import pytest ++import trio + + from jinja2 import ChainableUndefined + from jinja2 import DictLoader +@@ -13,7 +14,16 @@ from jinja2.exceptions import UndefinedError + from jinja2.nativetypes import NativeEnvironment + + +-def test_basic_async(): ++def _asyncio_run(async_fn, *args): ++ return asyncio.run(async_fn(*args)) ++ ++ ++@pytest.fixture(params=[_asyncio_run, trio.run], ids=["asyncio", "trio"]) ++def run_async_fn(request): ++ return request.param ++ ++ ++def test_basic_async(run_async_fn): + t = Template( + "{% for item in [1, 2, 3] %}[{{ item }}]{% endfor %}", enable_async=True + ) +@@ -21,11 +31,11 @@ def test_basic_async(): + async def func(): + return await t.render_async() + +- rv = asyncio.run(func()) ++ rv = run_async_fn(func) + assert rv == "[1][2][3]" + + +-def test_await_on_calls(): ++def test_await_on_calls(run_async_fn): + t = Template("{{ async_func() + normal_func() }}", enable_async=True) + + async def async_func(): +@@ -37,7 +47,7 @@ def test_await_on_calls(): + async def func(): + return await t.render_async(async_func=async_func, normal_func=normal_func) + +- rv = asyncio.run(func()) ++ rv = run_async_fn(func) + assert rv == "65" + + +@@ -54,7 +64,7 @@ def test_await_on_calls_normal_render(): + assert rv == "65" + + +-def test_await_and_macros(): ++def test_await_and_macros(run_async_fn): + t = Template( + "{% macro foo(x) %}[{{ x }}][{{ async_func() }}]{% endmacro %}{{ foo(42) }}", + enable_async=True, +@@ -66,11 +76,11 @@ def test_await_and_macros(): + async def func(): + return await t.render_async(async_func=async_func) + +- rv = asyncio.run(func()) ++ rv = run_async_fn(func) + assert rv == "[42][42]" + + +-def test_async_blocks(): ++def test_async_blocks(run_async_fn): + t = Template( + "{% block foo %}{% endblock %}{{ self.foo() }}", + enable_async=True, +@@ -80,7 +90,7 @@ def test_async_blocks(): + async def func(): + return await t.render_async() + +- rv = asyncio.run(func()) ++ rv = run_async_fn(func) + assert rv == "" + + +@@ -156,8 +166,8 @@ class TestAsyncImports: + test_env_async.from_string('{% from "foo" import bar, with, context %}') + test_env_async.from_string('{% from "foo" import bar, with with context %}') + +- def test_exports(self, test_env_async): +- coro = test_env_async.from_string( ++ def test_exports(self, test_env_async, run_async_fn): ++ coro_fn = test_env_async.from_string( + """ + {% macro toplevel() %}...{% endmacro %} + {% macro __private() %}...{% endmacro %} +@@ -166,9 +176,9 @@ class TestAsyncImports: + {% macro notthere() %}{% endmacro %} + {% endfor %} + """ +- )._get_default_module_async() +- m = asyncio.run(coro) +- assert asyncio.run(m.toplevel()) == "..." ++ )._get_default_module_async ++ m = run_async_fn(coro_fn) ++ assert run_async_fn(m.toplevel) == "..." + assert not hasattr(m, "__missing") + assert m.variable == 42 + assert not hasattr(m, "notthere") +@@ -457,17 +467,19 @@ class TestAsyncForLoop: + ) + assert tmpl.render(items=reversed([3, 2, 1])) == "1,2,3" + +- def test_loop_errors(self, test_env_async): ++ def test_loop_errors(self, test_env_async, run_async_fn): + tmpl = test_env_async.from_string( + """{% for item in [1] if loop.index + == 0 %}...{% endfor %}""" + ) +- pytest.raises(UndefinedError, tmpl.render) ++ with pytest.raises(UndefinedError): ++ run_async_fn(tmpl.render_async) ++ + tmpl = test_env_async.from_string( + """{% for item in [] %}...{% else + %}{{ loop }}{% endfor %}""" + ) +- assert tmpl.render() == "" ++ assert run_async_fn(tmpl.render_async) == "" + + def test_loop_filter(self, test_env_async): + tmpl = test_env_async.from_string( +@@ -597,7 +609,7 @@ class TestAsyncForLoop: + assert t.render(a=dict(b=[1, 2, 3])) == "1" + + +-def test_namespace_awaitable(test_env_async): ++def test_namespace_awaitable(test_env_async, run_async_fn): + async def _test(): + t = test_env_async.from_string( + '{% set ns = namespace(foo="Bar") %}{{ ns.foo }}' +@@ -605,10 +617,10 @@ def test_namespace_awaitable(test_env_async): + actual = await t.render_async() + assert actual == "Bar" + +- asyncio.run(_test()) ++ run_async_fn(_test) + + +-def test_chainable_undefined_aiter(): ++def test_chainable_undefined_aiter(run_async_fn): + async def _test(): + t = Template( + "{% for x in a['b']['c'] %}{{ x }}{% endfor %}", +@@ -618,7 +630,7 @@ def test_chainable_undefined_aiter(): + rv = await t.render_async(a={}) + assert rv == "" + +- asyncio.run(_test()) ++ run_async_fn(_test) + + + @pytest.fixture +@@ -626,22 +638,22 @@ def async_native_env(): + return NativeEnvironment(enable_async=True) + + +-def test_native_async(async_native_env): ++def test_native_async(async_native_env, run_async_fn): + async def _test(): + t = async_native_env.from_string("{{ x }}") + rv = await t.render_async(x=23) + assert rv == 23 + +- asyncio.run(_test()) ++ run_async_fn(_test) + + +-def test_native_list_async(async_native_env): ++def test_native_list_async(async_native_env, run_async_fn): + async def _test(): + t = async_native_env.from_string("{{ x }}") + rv = await t.render_async(x=list(range(3))) + assert rv == [0, 1, 2] + +- asyncio.run(_test()) ++ run_async_fn(_test) + + + def test_getitem_after_filter(): +@@ -658,3 +670,65 @@ def test_getitem_after_call(): + t = env.from_string("{{ add_each(a, 2)[1:] }}") + out = t.render(a=range(3)) + assert out == "[3, 4]" ++ ++ ++def test_basic_generate_async(run_async_fn): ++ t = Template( ++ "{% for item in [1, 2, 3] %}[{{ item }}]{% endfor %}", enable_async=True ++ ) ++ ++ async def func(): ++ agen = t.generate_async() ++ try: ++ return await agen.__anext__() ++ finally: ++ await agen.aclose() ++ ++ rv = run_async_fn(func) ++ assert rv == "[" ++ ++ ++def test_include_generate_async(run_async_fn, test_env_async): ++ t = test_env_async.from_string('{% include "header" %}') ++ ++ async def func(): ++ agen = t.generate_async() ++ try: ++ return await agen.__anext__() ++ finally: ++ await agen.aclose() ++ ++ rv = run_async_fn(func) ++ assert rv == "[" ++ ++ ++def test_blocks_generate_async(run_async_fn): ++ t = Template( ++ "{% block foo %}{% endblock %}{{ self.foo() }}", ++ enable_async=True, ++ autoescape=True, ++ ) ++ ++ async def func(): ++ agen = t.generate_async() ++ try: ++ return await agen.__anext__() ++ finally: ++ await agen.aclose() ++ ++ rv = run_async_fn(func) ++ assert rv == "" ++ ++ ++def test_async_extend(run_async_fn, test_env_async): ++ t = test_env_async.from_string('{% extends "header" %}') ++ ++ async def func(): ++ agen = t.generate_async() ++ try: ++ return await agen.__anext__() ++ finally: ++ await agen.aclose() ++ ++ rv = run_async_fn(func) ++ assert rv == "[" +diff --git a/tests/test_async_filters.py b/tests/test_async_filters.py +index f5b2627..e8cc350 100644 +--- a/tests/test_async_filters.py ++++ b/tests/test_async_filters.py +@@ -1,6 +1,9 @@ ++import asyncio ++import contextlib + from collections import namedtuple + + import pytest ++import trio + from markupsafe import Markup + + from jinja2 import Environment +@@ -26,10 +29,39 @@ def env_async(): + return Environment(enable_async=True) + + ++def _asyncio_run(async_fn, *args): ++ return asyncio.run(async_fn(*args)) ++ ++ ++@pytest.fixture(params=[_asyncio_run, trio.run], ids=["asyncio", "trio"]) ++def run_async_fn(request): ++ return request.param ++ ++ ++@contextlib.asynccontextmanager ++async def closing_factory(): ++ async with contextlib.AsyncExitStack() as stack: ++ ++ def closing(maybe_agen): ++ try: ++ aclose = maybe_agen.aclose ++ except AttributeError: ++ pass ++ else: ++ stack.push_async_callback(aclose) ++ return maybe_agen ++ ++ yield closing ++ ++ + @mark_dualiter("foo", lambda: range(10)) +-def test_first(env_async, foo): +- tmpl = env_async.from_string("{{ foo()|first }}") +- out = tmpl.render(foo=foo) ++def test_first(env_async, foo, run_async_fn): ++ async def test(): ++ async with closing_factory() as closing: ++ tmpl = env_async.from_string("{{ closing(foo())|first }}") ++ return await tmpl.render_async(foo=foo, closing=closing) ++ ++ out = run_async_fn(test) + assert out == "0" + + +@@ -245,18 +277,23 @@ def test_slice(env_async, items): + ) + + +-def test_custom_async_filter(env_async): ++def test_custom_async_filter(env_async, run_async_fn): + async def customfilter(val): + return str(val) + +- env_async.filters["customfilter"] = customfilter +- tmpl = env_async.from_string("{{ 'static'|customfilter }} {{ arg|customfilter }}") +- out = tmpl.render(arg="dynamic") ++ async def test(): ++ env_async.filters["customfilter"] = customfilter ++ tmpl = env_async.from_string( ++ "{{ 'static'|customfilter }} {{ arg|customfilter }}" ++ ) ++ return await tmpl.render_async(arg="dynamic") ++ ++ out = run_async_fn(test) + assert out == "static dynamic" + + + @mark_dualiter("items", lambda: range(10)) +-def test_custom_async_iteratable_filter(env_async, items): ++def test_custom_async_iteratable_filter(env_async, items, run_async_fn): + async def customfilter(iterable): + items = [] + async for item in auto_aiter(iterable): +@@ -265,9 +302,13 @@ def test_custom_async_iteratable_filter(env_async, items): + break + return ",".join(items) + +- env_async.filters["customfilter"] = customfilter +- tmpl = env_async.from_string( +- "{{ items()|customfilter }} .. {{ [3, 4, 5, 6]|customfilter }}" +- ) +- out = tmpl.render(items=items) ++ async def test(): ++ async with closing_factory() as closing: ++ env_async.filters["customfilter"] = customfilter ++ tmpl = env_async.from_string( ++ "{{ closing(items())|customfilter }} .. {{ [3, 4, 5, 6]|customfilter }}" ++ ) ++ return await tmpl.render_async(items=items, closing=closing) ++ ++ out = run_async_fn(test) + assert out == "0,1,2 .. 3,4,5" +diff --git a/tests/test_loader.py b/tests/test_loader.py +index 77d686e..3e64f62 100644 +--- a/tests/test_loader.py ++++ b/tests/test_loader.py +@@ -2,7 +2,6 @@ import importlib.abc + import importlib.machinery + import importlib.util + import os +-import platform + import shutil + import sys + import tempfile +@@ -364,8 +363,8 @@ def test_package_zip_source(package_zip_loader, template, expect): + + + @pytest.mark.xfail( +- platform.python_implementation() == "PyPy", +- reason="PyPy's zipimporter doesn't have a '_files' attribute.", ++ sys.implementation.name == "pypy" or sys.version_info > (3, 13), ++ reason="zipimporter doesn't have a '_files' attribute", + raises=TypeError, + ) + def test_package_zip_list(package_zip_loader): +-- +2.45.0 + From 0aec2152b2acae1d1a1ab75ab1e951de15fdc2a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Sun, 26 May 2024 01:18:20 +0200 Subject: [PATCH 25/38] Make the build dependency on trio optional --- python-jinja2.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index 053e95d..4692a09 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -20,6 +20,8 @@ Patch: python3.13.patch %else %bcond_without docs %endif +# The dependency on trio is undesired on RHEL +%bcond asyncio_tests %{undefined rhel} BuildArch: noarch @@ -40,7 +42,9 @@ environments.} Summary: %{summary} BuildRequires: python3-devel BuildRequires: python3-pytest +%if %{with asyncio_tests} BuildRequires: python3-trio +%endif %if %{with docs} BuildRequires: %{_bindir}/sphinx-build-3 BuildRequires: make @@ -77,7 +81,7 @@ rm -rvf docs/_build/html/.buildinfo %check -%pytest tests +%pytest tests %{!?with_asyncio_tests:--ignore tests/test_async.py --ignore tests/test_async_filters.py} %files -n python3-jinja2 -f %{pyproject_files} From 566054026e9196e9525a67bbde02cc20ae90146e Mon Sep 17 00:00:00 2001 From: Python Maint Date: Fri, 7 Jun 2024 13:21:17 +0200 Subject: [PATCH 26/38] Bootstrap for Python 3.13 --- python-jinja2.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index 4692a09..dfda1d4 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -1,8 +1,10 @@ +%global _without_asyncio_tests 1 +%global _without_docs 1 %global srcname jinja2 Name: python-jinja2 Version: 3.1.4 -Release: 2%{?dist} +Release: 3%{?dist} Summary: General purpose template engine License: BSD-3-Clause URL: https://palletsprojects.com/p/jinja/ @@ -94,6 +96,9 @@ rm -rvf docs/_build/html/.buildinfo %changelog +* Fri Jun 07 2024 Python Maint - 3.1.4-3 +- Bootstrap for Python 3.13 + * Thu May 23 2024 Miro Hrončok - 3.1.4-2 - Python 3.13 fixes - Fixes: rhzb#2245265 From da0819f188471416143af39442cc5e790af143a4 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Sat, 8 Jun 2024 08:13:52 +0200 Subject: [PATCH 27/38] Rebuilt for Python 3.13 --- python-jinja2.spec | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index dfda1d4..e7e45da 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -1,10 +1,8 @@ -%global _without_asyncio_tests 1 -%global _without_docs 1 %global srcname jinja2 Name: python-jinja2 Version: 3.1.4 -Release: 3%{?dist} +Release: 4%{?dist} Summary: General purpose template engine License: BSD-3-Clause URL: https://palletsprojects.com/p/jinja/ @@ -96,6 +94,9 @@ rm -rvf docs/_build/html/.buildinfo %changelog +* Sat Jun 08 2024 Python Maint - 3.1.4-4 +- Rebuilt for Python 3.13 + * Fri Jun 07 2024 Python Maint - 3.1.4-3 - Bootstrap for Python 3.13 From 5d9a9d69be022d256c56d7b19dad5befdde42ffc Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 19 Jul 2024 12:31:17 +0000 Subject: [PATCH 28/38] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild --- python-jinja2.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index e7e45da..ff19dc9 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -2,7 +2,7 @@ Name: python-jinja2 Version: 3.1.4 -Release: 4%{?dist} +Release: 5%{?dist} Summary: General purpose template engine License: BSD-3-Clause URL: https://palletsprojects.com/p/jinja/ @@ -94,6 +94,9 @@ rm -rvf docs/_build/html/.buildinfo %changelog +* Fri Jul 19 2024 Fedora Release Engineering - 3.1.4-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + * Sat Jun 08 2024 Python Maint - 3.1.4-4 - Rebuilt for Python 3.13 From 46fea4b890cb5b3ed9eb0f255a58a17976f1e37c Mon Sep 17 00:00:00 2001 From: Lukas Zachar Date: Mon, 19 Jul 2021 09:50:49 +0200 Subject: [PATCH 29/38] Add tmt smoke test + plan Cherry-picked from c9s. Commit hash: 53acc26463e0248c91146bd2f6065d53fb845580 --- .fmf/version | 1 + plans.fmf | 4 ++++ tests/smoke.fmf | 7 +++++++ tests/smoke.py | 9 +++++++++ 4 files changed, 21 insertions(+) create mode 100644 .fmf/version create mode 100644 plans.fmf create mode 100644 tests/smoke.fmf create mode 100644 tests/smoke.py diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/plans.fmf b/plans.fmf new file mode 100644 index 0000000..e6427de --- /dev/null +++ b/plans.fmf @@ -0,0 +1,4 @@ +discover: + how: fmf +execute: + how: tmt diff --git a/tests/smoke.fmf b/tests/smoke.fmf new file mode 100644 index 0000000..19656ca --- /dev/null +++ b/tests/smoke.fmf @@ -0,0 +1,7 @@ +description: | + Runs very simple jinja2 template which should always work +test: python3 smoke.py +framework: shell +require: +- python3 +- python3-jinja2 diff --git a/tests/smoke.py b/tests/smoke.py new file mode 100644 index 0000000..99a000c --- /dev/null +++ b/tests/smoke.py @@ -0,0 +1,9 @@ +import jinja2 + + +TEMPLATE = "Text {{ variable }}" + +environment = jinja2.Environment() +template = environment.from_string(TEMPLATE) +output = template.render(variable="demo") +assert output == "Text demo", f"got: {output}" From 48d55f47425c0db2356b4b1df759f1083f13ff8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 8 Jan 2025 11:23:11 +0100 Subject: [PATCH 30/38] Update to 3.1.5 - Security fix for CVE-2024-56201 - Fixes: rhzb#2333688 - Fixes: rhzb#2336377 --- .gitignore | 1 + python-jinja2.spec | 15 +- python3.13.patch | 581 --------------------------------------------- sources | 2 +- 4 files changed, 10 insertions(+), 589 deletions(-) delete mode 100644 python3.13.patch diff --git a/.gitignore b/.gitignore index ced8d09..38359a3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /Jinja2-*.tar.gz /jinja2-3.1.4.tar.gz +/jinja2-3.1.5.tar.gz diff --git a/python-jinja2.spec b/python-jinja2.spec index ff19dc9..a5b4dd1 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -1,18 +1,13 @@ %global srcname jinja2 Name: python-jinja2 -Version: 3.1.4 -Release: 5%{?dist} +Version: 3.1.5 +Release: 1%{?dist} Summary: General purpose template engine License: BSD-3-Clause URL: https://palletsprojects.com/p/jinja/ Source0: %{pypi_source %srcname} -# Python 3.13 fixes -# https://github.com/pallets/jinja/pull/1960 -# https://github.com/pallets/jinja/pull/1977 -Patch: python3.13.patch - # Enable building without docs to avoid a circular dependency between this # and python-sphinx: %if 0%{?rhel} || 0%{?flatpak} @@ -94,6 +89,12 @@ rm -rvf docs/_build/html/.buildinfo %changelog +* Wed Jan 08 2025 Miro Hrončok - 3.1.5-1 +- Update to 3.1.5 +- Security fix for CVE-2024-56201 +- Fixes: rhzb#2333688 +- Fixes: rhzb#2336377 + * Fri Jul 19 2024 Fedora Release Engineering - 3.1.4-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild diff --git a/python3.13.patch b/python3.13.patch deleted file mode 100644 index d0b021e..0000000 --- a/python3.13.patch +++ /dev/null @@ -1,581 +0,0 @@ -From d44af7635fa97e980673f29c6192d9fc5cbfc85a Mon Sep 17 00:00:00 2001 -From: Thomas Grainger -Date: Thu, 23 May 2024 15:30:36 +0200 -Subject: [PATCH] Python 3.13 fixes - -Combined from: - - https://github.com/pallets/jinja/pull/1960 - - https://github.com/pallets/jinja/pull/1977 - -Co-Authored-By: David Lord ---- - src/jinja2/async_utils.py | 25 ++++++-- - src/jinja2/compiler.py | 46 +++++++++----- - src/jinja2/environment.py | 12 +++- - tests/test_async.py | 122 +++++++++++++++++++++++++++++------- - tests/test_async_filters.py | 67 ++++++++++++++++---- - tests/test_loader.py | 5 +- - 6 files changed, 214 insertions(+), 63 deletions(-) - -diff --git a/src/jinja2/async_utils.py b/src/jinja2/async_utils.py -index e65219e..b0d277d 100644 ---- a/src/jinja2/async_utils.py -+++ b/src/jinja2/async_utils.py -@@ -6,6 +6,9 @@ from functools import wraps - from .utils import _PassArg - from .utils import pass_eval_context - -+if t.TYPE_CHECKING: -+ import typing_extensions as te -+ - V = t.TypeVar("V") - - -@@ -67,15 +70,27 @@ async def auto_await(value: t.Union[t.Awaitable["V"], "V"]) -> "V": - return t.cast("V", value) - - --async def auto_aiter( -+class _IteratorToAsyncIterator(t.Generic[V]): -+ def __init__(self, iterator: "t.Iterator[V]"): -+ self._iterator = iterator -+ -+ def __aiter__(self) -> "te.Self": -+ return self -+ -+ async def __anext__(self) -> V: -+ try: -+ return next(self._iterator) -+ except StopIteration as e: -+ raise StopAsyncIteration(e.value) from e -+ -+ -+def auto_aiter( - iterable: "t.Union[t.AsyncIterable[V], t.Iterable[V]]", - ) -> "t.AsyncIterator[V]": - if hasattr(iterable, "__aiter__"): -- async for item in t.cast("t.AsyncIterable[V]", iterable): -- yield item -+ return iterable.__aiter__() - else: -- for item in iterable: -- yield item -+ return _IteratorToAsyncIterator(iter(iterable)) - - - async def auto_to_list( -diff --git a/src/jinja2/compiler.py b/src/jinja2/compiler.py -index 2740717..91720c5 100644 ---- a/src/jinja2/compiler.py -+++ b/src/jinja2/compiler.py -@@ -55,7 +55,7 @@ def optimizeconst(f: F) -> F: - - return f(self, node, frame, **kwargs) - -- return update_wrapper(t.cast(F, new_func), f) -+ return update_wrapper(new_func, f) # type: ignore[return-value] - - - def _make_binop(op: str) -> t.Callable[["CodeGenerator", nodes.BinExpr, "Frame"], None]: -@@ -902,12 +902,15 @@ class CodeGenerator(NodeVisitor): - if not self.environment.is_async: - self.writeline("yield from parent_template.root_render_func(context)") - else: -- self.writeline( -- "async for event in parent_template.root_render_func(context):" -- ) -+ self.writeline("agen = parent_template.root_render_func(context)") -+ self.writeline("try:") -+ self.indent() -+ self.writeline("async for event in agen:") - self.indent() - self.writeline("yield event") - self.outdent() -+ self.outdent() -+ self.writeline("finally: await agen.aclose()") - self.outdent(1 + (not self.has_known_extends)) - - # at this point we now have the blocks collected and can visit them too. -@@ -977,14 +980,20 @@ class CodeGenerator(NodeVisitor): - f"yield from context.blocks[{node.name!r}][0]({context})", node - ) - else: -+ self.writeline(f"gen = context.blocks[{node.name!r}][0]({context})") -+ self.writeline("try:") -+ self.indent() - self.writeline( -- f"{self.choose_async()}for event in" -- f" context.blocks[{node.name!r}][0]({context}):", -+ f"{self.choose_async()}for event in gen:", - node, - ) - self.indent() - self.simple_write("event", frame) - self.outdent() -+ self.outdent() -+ self.writeline( -+ f"finally: {self.choose_async('await gen.aclose()', 'gen.close()')}" -+ ) - - self.outdent(level) - -@@ -1057,26 +1066,33 @@ class CodeGenerator(NodeVisitor): - self.writeline("else:") - self.indent() - -- skip_event_yield = False -+ def loop_body() -> None: -+ self.indent() -+ self.simple_write("event", frame) -+ self.outdent() -+ - if node.with_context: - self.writeline( -- f"{self.choose_async()}for event in template.root_render_func(" -+ f"gen = template.root_render_func(" - "template.new_context(context.get_all(), True," -- f" {self.dump_local_context(frame)})):" -+ f" {self.dump_local_context(frame)}))" -+ ) -+ self.writeline("try:") -+ self.indent() -+ self.writeline(f"{self.choose_async()}for event in gen:") -+ loop_body() -+ self.outdent() -+ self.writeline( -+ f"finally: {self.choose_async('await gen.aclose()', 'gen.close()')}" - ) - elif self.environment.is_async: - self.writeline( - "for event in (await template._get_default_module_async())" - "._body_stream:" - ) -+ loop_body() - else: - self.writeline("yield from template._get_default_module()._body_stream") -- skip_event_yield = True -- -- if not skip_event_yield: -- self.indent() -- self.simple_write("event", frame) -- self.outdent() - - if node.ignore_missing: - self.outdent() -diff --git a/src/jinja2/environment.py b/src/jinja2/environment.py -index 1d3be0b..bdd6a2b 100644 ---- a/src/jinja2/environment.py -+++ b/src/jinja2/environment.py -@@ -1358,7 +1358,7 @@ class Template: - - async def generate_async( - self, *args: t.Any, **kwargs: t.Any -- ) -> t.AsyncIterator[str]: -+ ) -> t.AsyncGenerator[str, object]: - """An async version of :meth:`generate`. Works very similarly but - returns an async iterator instead. - """ -@@ -1370,8 +1370,14 @@ class Template: - ctx = self.new_context(dict(*args, **kwargs)) - - try: -- async for event in self.root_render_func(ctx): # type: ignore -- yield event -+ agen = self.root_render_func(ctx) -+ try: -+ async for event in agen: # type: ignore -+ yield event -+ finally: -+ # we can't use async with aclosing(...) because that's only -+ # in 3.10+ -+ await agen.aclose() # type: ignore - except Exception: - yield self.environment.handle_exception() - -diff --git a/tests/test_async.py b/tests/test_async.py -index c9ba70c..4edced9 100644 ---- a/tests/test_async.py -+++ b/tests/test_async.py -@@ -1,6 +1,7 @@ - import asyncio - - import pytest -+import trio - - from jinja2 import ChainableUndefined - from jinja2 import DictLoader -@@ -13,7 +14,16 @@ from jinja2.exceptions import UndefinedError - from jinja2.nativetypes import NativeEnvironment - - --def test_basic_async(): -+def _asyncio_run(async_fn, *args): -+ return asyncio.run(async_fn(*args)) -+ -+ -+@pytest.fixture(params=[_asyncio_run, trio.run], ids=["asyncio", "trio"]) -+def run_async_fn(request): -+ return request.param -+ -+ -+def test_basic_async(run_async_fn): - t = Template( - "{% for item in [1, 2, 3] %}[{{ item }}]{% endfor %}", enable_async=True - ) -@@ -21,11 +31,11 @@ def test_basic_async(): - async def func(): - return await t.render_async() - -- rv = asyncio.run(func()) -+ rv = run_async_fn(func) - assert rv == "[1][2][3]" - - --def test_await_on_calls(): -+def test_await_on_calls(run_async_fn): - t = Template("{{ async_func() + normal_func() }}", enable_async=True) - - async def async_func(): -@@ -37,7 +47,7 @@ def test_await_on_calls(): - async def func(): - return await t.render_async(async_func=async_func, normal_func=normal_func) - -- rv = asyncio.run(func()) -+ rv = run_async_fn(func) - assert rv == "65" - - -@@ -54,7 +64,7 @@ def test_await_on_calls_normal_render(): - assert rv == "65" - - --def test_await_and_macros(): -+def test_await_and_macros(run_async_fn): - t = Template( - "{% macro foo(x) %}[{{ x }}][{{ async_func() }}]{% endmacro %}{{ foo(42) }}", - enable_async=True, -@@ -66,11 +76,11 @@ def test_await_and_macros(): - async def func(): - return await t.render_async(async_func=async_func) - -- rv = asyncio.run(func()) -+ rv = run_async_fn(func) - assert rv == "[42][42]" - - --def test_async_blocks(): -+def test_async_blocks(run_async_fn): - t = Template( - "{% block foo %}{% endblock %}{{ self.foo() }}", - enable_async=True, -@@ -80,7 +90,7 @@ def test_async_blocks(): - async def func(): - return await t.render_async() - -- rv = asyncio.run(func()) -+ rv = run_async_fn(func) - assert rv == "" - - -@@ -156,8 +166,8 @@ class TestAsyncImports: - test_env_async.from_string('{% from "foo" import bar, with, context %}') - test_env_async.from_string('{% from "foo" import bar, with with context %}') - -- def test_exports(self, test_env_async): -- coro = test_env_async.from_string( -+ def test_exports(self, test_env_async, run_async_fn): -+ coro_fn = test_env_async.from_string( - """ - {% macro toplevel() %}...{% endmacro %} - {% macro __private() %}...{% endmacro %} -@@ -166,9 +176,9 @@ class TestAsyncImports: - {% macro notthere() %}{% endmacro %} - {% endfor %} - """ -- )._get_default_module_async() -- m = asyncio.run(coro) -- assert asyncio.run(m.toplevel()) == "..." -+ )._get_default_module_async -+ m = run_async_fn(coro_fn) -+ assert run_async_fn(m.toplevel) == "..." - assert not hasattr(m, "__missing") - assert m.variable == 42 - assert not hasattr(m, "notthere") -@@ -457,17 +467,19 @@ class TestAsyncForLoop: - ) - assert tmpl.render(items=reversed([3, 2, 1])) == "1,2,3" - -- def test_loop_errors(self, test_env_async): -+ def test_loop_errors(self, test_env_async, run_async_fn): - tmpl = test_env_async.from_string( - """{% for item in [1] if loop.index - == 0 %}...{% endfor %}""" - ) -- pytest.raises(UndefinedError, tmpl.render) -+ with pytest.raises(UndefinedError): -+ run_async_fn(tmpl.render_async) -+ - tmpl = test_env_async.from_string( - """{% for item in [] %}...{% else - %}{{ loop }}{% endfor %}""" - ) -- assert tmpl.render() == "" -+ assert run_async_fn(tmpl.render_async) == "" - - def test_loop_filter(self, test_env_async): - tmpl = test_env_async.from_string( -@@ -597,7 +609,7 @@ class TestAsyncForLoop: - assert t.render(a=dict(b=[1, 2, 3])) == "1" - - --def test_namespace_awaitable(test_env_async): -+def test_namespace_awaitable(test_env_async, run_async_fn): - async def _test(): - t = test_env_async.from_string( - '{% set ns = namespace(foo="Bar") %}{{ ns.foo }}' -@@ -605,10 +617,10 @@ def test_namespace_awaitable(test_env_async): - actual = await t.render_async() - assert actual == "Bar" - -- asyncio.run(_test()) -+ run_async_fn(_test) - - --def test_chainable_undefined_aiter(): -+def test_chainable_undefined_aiter(run_async_fn): - async def _test(): - t = Template( - "{% for x in a['b']['c'] %}{{ x }}{% endfor %}", -@@ -618,7 +630,7 @@ def test_chainable_undefined_aiter(): - rv = await t.render_async(a={}) - assert rv == "" - -- asyncio.run(_test()) -+ run_async_fn(_test) - - - @pytest.fixture -@@ -626,22 +638,22 @@ def async_native_env(): - return NativeEnvironment(enable_async=True) - - --def test_native_async(async_native_env): -+def test_native_async(async_native_env, run_async_fn): - async def _test(): - t = async_native_env.from_string("{{ x }}") - rv = await t.render_async(x=23) - assert rv == 23 - -- asyncio.run(_test()) -+ run_async_fn(_test) - - --def test_native_list_async(async_native_env): -+def test_native_list_async(async_native_env, run_async_fn): - async def _test(): - t = async_native_env.from_string("{{ x }}") - rv = await t.render_async(x=list(range(3))) - assert rv == [0, 1, 2] - -- asyncio.run(_test()) -+ run_async_fn(_test) - - - def test_getitem_after_filter(): -@@ -658,3 +670,65 @@ def test_getitem_after_call(): - t = env.from_string("{{ add_each(a, 2)[1:] }}") - out = t.render(a=range(3)) - assert out == "[3, 4]" -+ -+ -+def test_basic_generate_async(run_async_fn): -+ t = Template( -+ "{% for item in [1, 2, 3] %}[{{ item }}]{% endfor %}", enable_async=True -+ ) -+ -+ async def func(): -+ agen = t.generate_async() -+ try: -+ return await agen.__anext__() -+ finally: -+ await agen.aclose() -+ -+ rv = run_async_fn(func) -+ assert rv == "[" -+ -+ -+def test_include_generate_async(run_async_fn, test_env_async): -+ t = test_env_async.from_string('{% include "header" %}') -+ -+ async def func(): -+ agen = t.generate_async() -+ try: -+ return await agen.__anext__() -+ finally: -+ await agen.aclose() -+ -+ rv = run_async_fn(func) -+ assert rv == "[" -+ -+ -+def test_blocks_generate_async(run_async_fn): -+ t = Template( -+ "{% block foo %}{% endblock %}{{ self.foo() }}", -+ enable_async=True, -+ autoescape=True, -+ ) -+ -+ async def func(): -+ agen = t.generate_async() -+ try: -+ return await agen.__anext__() -+ finally: -+ await agen.aclose() -+ -+ rv = run_async_fn(func) -+ assert rv == "" -+ -+ -+def test_async_extend(run_async_fn, test_env_async): -+ t = test_env_async.from_string('{% extends "header" %}') -+ -+ async def func(): -+ agen = t.generate_async() -+ try: -+ return await agen.__anext__() -+ finally: -+ await agen.aclose() -+ -+ rv = run_async_fn(func) -+ assert rv == "[" -diff --git a/tests/test_async_filters.py b/tests/test_async_filters.py -index f5b2627..e8cc350 100644 ---- a/tests/test_async_filters.py -+++ b/tests/test_async_filters.py -@@ -1,6 +1,9 @@ -+import asyncio -+import contextlib - from collections import namedtuple - - import pytest -+import trio - from markupsafe import Markup - - from jinja2 import Environment -@@ -26,10 +29,39 @@ def env_async(): - return Environment(enable_async=True) - - -+def _asyncio_run(async_fn, *args): -+ return asyncio.run(async_fn(*args)) -+ -+ -+@pytest.fixture(params=[_asyncio_run, trio.run], ids=["asyncio", "trio"]) -+def run_async_fn(request): -+ return request.param -+ -+ -+@contextlib.asynccontextmanager -+async def closing_factory(): -+ async with contextlib.AsyncExitStack() as stack: -+ -+ def closing(maybe_agen): -+ try: -+ aclose = maybe_agen.aclose -+ except AttributeError: -+ pass -+ else: -+ stack.push_async_callback(aclose) -+ return maybe_agen -+ -+ yield closing -+ -+ - @mark_dualiter("foo", lambda: range(10)) --def test_first(env_async, foo): -- tmpl = env_async.from_string("{{ foo()|first }}") -- out = tmpl.render(foo=foo) -+def test_first(env_async, foo, run_async_fn): -+ async def test(): -+ async with closing_factory() as closing: -+ tmpl = env_async.from_string("{{ closing(foo())|first }}") -+ return await tmpl.render_async(foo=foo, closing=closing) -+ -+ out = run_async_fn(test) - assert out == "0" - - -@@ -245,18 +277,23 @@ def test_slice(env_async, items): - ) - - --def test_custom_async_filter(env_async): -+def test_custom_async_filter(env_async, run_async_fn): - async def customfilter(val): - return str(val) - -- env_async.filters["customfilter"] = customfilter -- tmpl = env_async.from_string("{{ 'static'|customfilter }} {{ arg|customfilter }}") -- out = tmpl.render(arg="dynamic") -+ async def test(): -+ env_async.filters["customfilter"] = customfilter -+ tmpl = env_async.from_string( -+ "{{ 'static'|customfilter }} {{ arg|customfilter }}" -+ ) -+ return await tmpl.render_async(arg="dynamic") -+ -+ out = run_async_fn(test) - assert out == "static dynamic" - - - @mark_dualiter("items", lambda: range(10)) --def test_custom_async_iteratable_filter(env_async, items): -+def test_custom_async_iteratable_filter(env_async, items, run_async_fn): - async def customfilter(iterable): - items = [] - async for item in auto_aiter(iterable): -@@ -265,9 +302,13 @@ def test_custom_async_iteratable_filter(env_async, items): - break - return ",".join(items) - -- env_async.filters["customfilter"] = customfilter -- tmpl = env_async.from_string( -- "{{ items()|customfilter }} .. {{ [3, 4, 5, 6]|customfilter }}" -- ) -- out = tmpl.render(items=items) -+ async def test(): -+ async with closing_factory() as closing: -+ env_async.filters["customfilter"] = customfilter -+ tmpl = env_async.from_string( -+ "{{ closing(items())|customfilter }} .. {{ [3, 4, 5, 6]|customfilter }}" -+ ) -+ return await tmpl.render_async(items=items, closing=closing) -+ -+ out = run_async_fn(test) - assert out == "0,1,2 .. 3,4,5" -diff --git a/tests/test_loader.py b/tests/test_loader.py -index 77d686e..3e64f62 100644 ---- a/tests/test_loader.py -+++ b/tests/test_loader.py -@@ -2,7 +2,6 @@ import importlib.abc - import importlib.machinery - import importlib.util - import os --import platform - import shutil - import sys - import tempfile -@@ -364,8 +363,8 @@ def test_package_zip_source(package_zip_loader, template, expect): - - - @pytest.mark.xfail( -- platform.python_implementation() == "PyPy", -- reason="PyPy's zipimporter doesn't have a '_files' attribute.", -+ sys.implementation.name == "pypy" or sys.version_info > (3, 13), -+ reason="zipimporter doesn't have a '_files' attribute", - raises=TypeError, - ) - def test_package_zip_list(package_zip_loader): --- -2.45.0 - diff --git a/sources b/sources index 04e4371..bcd8583 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (jinja2-3.1.4.tar.gz) = d07d68a2687af68c705d3b7f5a2c67aca7b9d125316b15085888b9d0d6e769981af76f6f524728b89b5501bd671d518fcb2638f9ae112e57ca2bf2a53482cd89 +SHA512 (jinja2-3.1.5.tar.gz) = 75ad0094482c69d45fcd3aa8ee32e249931e53fee3f804f6ddfd5b6da0ed16962d8f1fced811e7dcb4d8401fadd828e77528d6d1280547a7d4f5f77cccf9bbd4 From e78f795e7e1dbde1e05377a3e36bca78efa7542c Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 18 Jan 2025 15:24:14 +0000 Subject: [PATCH 31/38] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild --- python-jinja2.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index a5b4dd1..66f1903 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -2,7 +2,7 @@ Name: python-jinja2 Version: 3.1.5 -Release: 1%{?dist} +Release: 2%{?dist} Summary: General purpose template engine License: BSD-3-Clause URL: https://palletsprojects.com/p/jinja/ @@ -89,6 +89,9 @@ rm -rvf docs/_build/html/.buildinfo %changelog +* Sat Jan 18 2025 Fedora Release Engineering - 3.1.5-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + * Wed Jan 08 2025 Miro Hrončok - 3.1.5-1 - Update to 3.1.5 - Security fix for CVE-2024-56201 From ab04c1a35a443a58bd6ea6f1cd19c2f2d2c90e72 Mon Sep 17 00:00:00 2001 From: Thomas Moschny Date: Sun, 9 Mar 2025 17:46:42 +0100 Subject: [PATCH 32/38] Update to 3.1.6. --- .gitignore | 3 +-- python-jinja2.spec | 7 +++++-- sources | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 38359a3..e0fc652 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ /Jinja2-*.tar.gz -/jinja2-3.1.4.tar.gz -/jinja2-3.1.5.tar.gz +/jinja2-*.tar.gz diff --git a/python-jinja2.spec b/python-jinja2.spec index 66f1903..bf54187 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -1,8 +1,8 @@ %global srcname jinja2 Name: python-jinja2 -Version: 3.1.5 -Release: 2%{?dist} +Version: 3.1.6 +Release: 1%{?dist} Summary: General purpose template engine License: BSD-3-Clause URL: https://palletsprojects.com/p/jinja/ @@ -89,6 +89,9 @@ rm -rvf docs/_build/html/.buildinfo %changelog +* Sun Mar 9 2025 Thomas Moschny - 3.1.6-1 +- Update to 3.1.6. + * Sat Jan 18 2025 Fedora Release Engineering - 3.1.5-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild diff --git a/sources b/sources index bcd8583..17e3310 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (jinja2-3.1.5.tar.gz) = 75ad0094482c69d45fcd3aa8ee32e249931e53fee3f804f6ddfd5b6da0ed16962d8f1fced811e7dcb4d8401fadd828e77528d6d1280547a7d4f5f77cccf9bbd4 +SHA512 (jinja2-3.1.6.tar.gz) = bddd5e142f1462426c57b2efafdfafdfc6b66de257668707940896feae71eabdf19e0b6e34ef49b965153baf9b1eb59bb5a97349bb287ea0921dd2a751e967ab From 9a3178e4bafd414d1081c46466a6fb5fc2de1f91 Mon Sep 17 00:00:00 2001 From: Lumir Balhar Date: Thu, 27 Mar 2025 12:32:17 +0100 Subject: [PATCH 33/38] Skip flaky test_elif_deep https://github.com/pallets/jinja/issues/2079 --- python-jinja2.spec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index bf54187..d1f3d1c 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -76,7 +76,9 @@ rm -rvf docs/_build/html/.buildinfo %check -%pytest tests %{!?with_asyncio_tests:--ignore tests/test_async.py --ignore tests/test_async_filters.py} +# test_elif_deep is flaky for an unknown reason +# https://github.com/pallets/jinja/issues/2079 +%pytest tests -k "not test_elif_deep" %{!?with_asyncio_tests:--ignore tests/test_async.py --ignore tests/test_async_filters.py} %files -n python3-jinja2 -f %{pyproject_files} From 811a737fb9ce918be6741e18ffb6552948cfa61e Mon Sep 17 00:00:00 2001 From: Python Maint Date: Mon, 2 Jun 2025 23:22:52 +0200 Subject: [PATCH 34/38] Bootstrap for Python 3.14 --- python-jinja2.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index d1f3d1c..e24ca87 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -1,8 +1,10 @@ +%global _without_asyncio_tests 1 +%global _without_docs 1 %global srcname jinja2 Name: python-jinja2 Version: 3.1.6 -Release: 1%{?dist} +Release: 2%{?dist} Summary: General purpose template engine License: BSD-3-Clause URL: https://palletsprojects.com/p/jinja/ @@ -91,6 +93,9 @@ rm -rvf docs/_build/html/.buildinfo %changelog +* Mon Jun 02 2025 Python Maint - 3.1.6-2 +- Bootstrap for Python 3.14 + * Sun Mar 9 2025 Thomas Moschny - 3.1.6-1 - Update to 3.1.6. From 159d32e14344130cfa4ebd149a179cf296318510 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Tue, 3 Jun 2025 15:55:25 +0200 Subject: [PATCH 35/38] Rebuilt for Python 3.14 --- python-jinja2.spec | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index e24ca87..2dea906 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -1,10 +1,8 @@ -%global _without_asyncio_tests 1 -%global _without_docs 1 %global srcname jinja2 Name: python-jinja2 Version: 3.1.6 -Release: 2%{?dist} +Release: 3%{?dist} Summary: General purpose template engine License: BSD-3-Clause URL: https://palletsprojects.com/p/jinja/ @@ -93,6 +91,9 @@ rm -rvf docs/_build/html/.buildinfo %changelog +* Tue Jun 03 2025 Python Maint - 3.1.6-3 +- Rebuilt for Python 3.14 + * Mon Jun 02 2025 Python Maint - 3.1.6-2 - Bootstrap for Python 3.14 From 3fcf5e155d46fdda3f86a3933374327cb059dc33 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 25 Jul 2025 08:27:59 +0000 Subject: [PATCH 36/38] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- python-jinja2.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index 2dea906..752e703 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -2,7 +2,7 @@ Name: python-jinja2 Version: 3.1.6 -Release: 3%{?dist} +Release: 4%{?dist} Summary: General purpose template engine License: BSD-3-Clause URL: https://palletsprojects.com/p/jinja/ @@ -91,6 +91,9 @@ rm -rvf docs/_build/html/.buildinfo %changelog +* Fri Jul 25 2025 Fedora Release Engineering - 3.1.6-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Tue Jun 03 2025 Python Maint - 3.1.6-3 - Rebuilt for Python 3.14 From da96094071355fb759336154757e42f60eeb5181 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Fri, 15 Aug 2025 13:58:35 +0200 Subject: [PATCH 37/38] Rebuilt for Python 3.14.0rc2 bytecode --- python-jinja2.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index 752e703..28f26f9 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -2,7 +2,7 @@ Name: python-jinja2 Version: 3.1.6 -Release: 4%{?dist} +Release: 5%{?dist} Summary: General purpose template engine License: BSD-3-Clause URL: https://palletsprojects.com/p/jinja/ @@ -91,6 +91,9 @@ rm -rvf docs/_build/html/.buildinfo %changelog +* Fri Aug 15 2025 Python Maint - 3.1.6-5 +- Rebuilt for Python 3.14.0rc2 bytecode + * Fri Jul 25 2025 Fedora Release Engineering - 3.1.6-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild From 73b8db5fe8682a25bd1b2ab9e6c6131f1c37463a Mon Sep 17 00:00:00 2001 From: Python Maint Date: Fri, 19 Sep 2025 13:31:55 +0200 Subject: [PATCH 38/38] Rebuilt for Python 3.14.0rc3 bytecode --- python-jinja2.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index 28f26f9..410f2c0 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -2,7 +2,7 @@ Name: python-jinja2 Version: 3.1.6 -Release: 5%{?dist} +Release: 6%{?dist} Summary: General purpose template engine License: BSD-3-Clause URL: https://palletsprojects.com/p/jinja/ @@ -91,6 +91,9 @@ rm -rvf docs/_build/html/.buildinfo %changelog +* Fri Sep 19 2025 Python Maint - 3.1.6-6 +- Rebuilt for Python 3.14.0rc3 bytecode + * Fri Aug 15 2025 Python Maint - 3.1.6-5 - Rebuilt for Python 3.14.0rc2 bytecode