From 8e45c9e7bb6643eacb7d038ce510a866e09bd9b7 Mon Sep 17 00:00:00 2001 From: Thomas Moschny Date: Sat, 14 Jan 2017 00:12:13 +0100 Subject: [PATCH 01/83] Update to 2.9.4. --- python-jinja2.spec | 19 ++++++++++++++++++- sources | 2 +- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index ee51979..8dc12ab 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -6,8 +6,12 @@ # and python-sphinx: %global with_docs 1 +%if 0%{?fedora} > 25 +%global with_async 1 +%endif + Name: python-jinja2 -Version: 2.8.1 +Version: 2.9.4 Release: 1%{?dist} Summary: General purpose template engine Group: Development/Languages @@ -93,6 +97,7 @@ find . -name '*.pyo' -o -name '*.pyc' -delete # fix EOL sed -i 's|\r$||g' LICENSE + %build %py2_build @@ -113,8 +118,17 @@ make -C docs html PYTHONPATH=$(pwd) # remove hidden file rm -rf docs/_build/html/.buildinfo +# these files are valid only on Python 3.6+ +rm %{buildroot}%{python2_sitelib}/jinja2/asyncsupport.py +rm %{buildroot}%{python2_sitelib}/jinja2/asyncfilters.py + %if 0%{?with_python3} %py3_install + +%if ! 0%{?with_async} +rm %{buildroot}%{python3_sitelib}/jinja2/asyncsupport.py +rm %{buildroot}%{python3_sitelib}/jinja2/asyncfilters.py +%endif %endif # with_python3 @@ -160,6 +174,9 @@ rm -rf docs/_build/html/.buildinfo %changelog +* Fri Jan 13 2017 Thomas Moschny - 2.9.4-1 +- Update to 2.9.4. + * Sat Dec 31 2016 Thomas Moschny - 2.8.1-1 - Update to 2.8.1. diff --git a/sources b/sources index bbfe628..1f70de5 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Jinja2-2.8.1.tar.gz) = 0a2e2aa94f5c2f04f79d59d34d5324d2a440385b71192e85e960c761b4a073400e4ab0458e57305650f696a474593d6fbf398fb1d9518be261bb2a5cb866e163 +SHA512 (Jinja2-2.9.4.tar.gz) = a44ea6876837238e5c744988b94f551fa20f3d4565c1f97afec89bb89da3da5507cdbc554a95ac49b80613cf4086a2465b90aa7c64578e1f952321a27c962c8b From 27ce420a311bef1dc06ff6c2db4b618923a50f9f Mon Sep 17 00:00:00 2001 From: Thomas Moschny Date: Sun, 29 Jan 2017 12:41:30 +0100 Subject: [PATCH 02/83] Update to 2.9.5. --- python-jinja2.spec | 5 ++++- sources | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index 8dc12ab..93c3640 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -11,7 +11,7 @@ %endif Name: python-jinja2 -Version: 2.9.4 +Version: 2.9.5 Release: 1%{?dist} Summary: General purpose template engine Group: Development/Languages @@ -174,6 +174,9 @@ rm %{buildroot}%{python3_sitelib}/jinja2/asyncfilters.py %changelog +* Sun Jan 29 2017 Thomas Moschny - 2.9.5-1 +- Update to 2.9.5. + * Fri Jan 13 2017 Thomas Moschny - 2.9.4-1 - Update to 2.9.4. diff --git a/sources b/sources index 1f70de5..95c83cd 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Jinja2-2.9.4.tar.gz) = a44ea6876837238e5c744988b94f551fa20f3d4565c1f97afec89bb89da3da5507cdbc554a95ac49b80613cf4086a2465b90aa7c64578e1f952321a27c962c8b +SHA512 (Jinja2-2.9.5.tar.gz) = 4002f9617aea9f317e5a81b686fe5aa00bcb886762d5f52a21ae907445ffc606046cfe6557d9720ee28b27e62e44039d46ef535d3e53032c94ce783fd6c43a2a From 5130bca21ceed692ad1ce4009e1151a40a1edb20 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 11 Feb 2017 09:21:33 +0000 Subject: [PATCH 03/83] - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild --- python-jinja2.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index 93c3640..997e583 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -12,7 +12,7 @@ Name: python-jinja2 Version: 2.9.5 -Release: 1%{?dist} +Release: 2%{?dist} Summary: General purpose template engine Group: Development/Languages License: BSD @@ -174,6 +174,9 @@ rm %{buildroot}%{python3_sitelib}/jinja2/asyncfilters.py %changelog +* Sat Feb 11 2017 Fedora Release Engineering - 2.9.5-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + * Sun Jan 29 2017 Thomas Moschny - 2.9.5-1 - Update to 2.9.5. From dd39a13309d2005eb08be1588f30425fc5d04aa8 Mon Sep 17 00:00:00 2001 From: Thomas Moschny Date: Wed, 5 Apr 2017 20:32:27 +0200 Subject: [PATCH 04/83] Update to 2.9.6. --- python-jinja2.spec | 7 +++++-- sources | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index 997e583..ed53316 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -11,8 +11,8 @@ %endif Name: python-jinja2 -Version: 2.9.5 -Release: 2%{?dist} +Version: 2.9.6 +Release: 1%{?dist} Summary: General purpose template engine Group: Development/Languages License: BSD @@ -174,6 +174,9 @@ rm %{buildroot}%{python3_sitelib}/jinja2/asyncfilters.py %changelog +* Wed Apr 5 2017 Thomas Moschny - 2.9.6-1 +- Update to 2.9.6. + * Sat Feb 11 2017 Fedora Release Engineering - 2.9.5-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild diff --git a/sources b/sources index 95c83cd..3d05ce5 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Jinja2-2.9.5.tar.gz) = 4002f9617aea9f317e5a81b686fe5aa00bcb886762d5f52a21ae907445ffc606046cfe6557d9720ee28b27e62e44039d46ef535d3e53032c94ce783fd6c43a2a +SHA512 (Jinja2-2.9.6.tar.gz) = b41b4e83bfe1ed2c5170e78bc6fb1ac3abb73df1b360c28e8011d430c3369efb49b923ede1f32c84c47c4bfa8a030ed24fc86700f2a8f777d54ee09c0fdee3c2 From b33ff757001244a02dd8c82c7495a41db206fef3 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 27 Jul 2017 10:40:53 +0000 Subject: [PATCH 05/83] - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild --- python-jinja2.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index ed53316..7551ffe 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -12,7 +12,7 @@ Name: python-jinja2 Version: 2.9.6 -Release: 1%{?dist} +Release: 2%{?dist} Summary: General purpose template engine Group: Development/Languages License: BSD @@ -174,6 +174,9 @@ rm %{buildroot}%{python3_sitelib}/jinja2/asyncfilters.py %changelog +* Thu Jul 27 2017 Fedora Release Engineering - 2.9.6-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + * Wed Apr 5 2017 Thomas Moschny - 2.9.6-1 - Update to 2.9.6. From 6b13162d603c21614c80b5658ac623bdc59e09fc Mon Sep 17 00:00:00 2001 From: Troy Dawson Date: Fri, 29 Sep 2017 08:41:13 -0700 Subject: [PATCH 06/83] Cleanup spec file conditionals --- python-jinja2.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index 7551ffe..595ea09 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -1,4 +1,4 @@ -%if 0%{?fedora} +%if 0%{?fedora} || 0%{?rhel} > 7 %global with_python3 1 %endif @@ -12,7 +12,7 @@ Name: python-jinja2 Version: 2.9.6 -Release: 2%{?dist} +Release: 3%{?dist} Summary: General purpose template engine Group: Development/Languages License: BSD @@ -174,6 +174,9 @@ rm %{buildroot}%{python3_sitelib}/jinja2/asyncfilters.py %changelog +* Fri Sep 29 2017 Troy Dawson - 2.9.6-3 +- Cleanup spec file conditionals + * Thu Jul 27 2017 Fedora Release Engineering - 2.9.6-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild From aca2e1769cd9d412a5ee96deefb891ce6dee01e1 Mon Sep 17 00:00:00 2001 From: Troy Dawson Date: Fri, 20 Oct 2017 09:09:06 -0500 Subject: [PATCH 07/83] Really cleanup spec file conditionals --- python-jinja2.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index 595ea09..40c4138 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -6,13 +6,13 @@ # and python-sphinx: %global with_docs 1 -%if 0%{?fedora} > 25 +%if 0%{?fedora} > 25 || 0%{?rhel} > 7 %global with_async 1 %endif Name: python-jinja2 Version: 2.9.6 -Release: 3%{?dist} +Release: 4%{?dist} Summary: General purpose template engine Group: Development/Languages License: BSD @@ -174,6 +174,9 @@ rm %{buildroot}%{python3_sitelib}/jinja2/asyncfilters.py %changelog +* Fri Oct 20 2017 Troy Dawson - 2.9.6-4 +- Really cleanup spec file conditionals + * Fri Sep 29 2017 Troy Dawson - 2.9.6-3 - Cleanup spec file conditionals From 1ad67ab31dd171794fad00db56480be62b908632 Mon Sep 17 00:00:00 2001 From: Thomas Moschny Date: Thu, 16 Nov 2017 01:49:34 +0100 Subject: [PATCH 08/83] Update to 2.10. Use %bcond. Move BRs to their respective subpackages. --- python-jinja2.spec | 181 +++++++++++++++++++++++++++------------------ sources | 2 +- 2 files changed, 112 insertions(+), 71 deletions(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index 40c4138..332978f 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -1,39 +1,31 @@ -%if 0%{?fedora} || 0%{?rhel} > 7 -%global with_python3 1 -%endif - -# Enable building without docs to avoid a circular dependency between this -# and python-sphinx: -%global with_docs 1 - -%if 0%{?fedora} > 25 || 0%{?rhel} > 7 -%global with_async 1 -%endif - Name: python-jinja2 -Version: 2.9.6 -Release: 4%{?dist} +Version: 2.10 +Release: 1%{?dist} Summary: General purpose template engine Group: Development/Languages License: BSD URL: http://jinja.pocoo.org/ Source0: https://files.pythonhosted.org/packages/source/J/Jinja2/Jinja2-%{version}.tar.gz -BuildArch: noarch -BuildRequires: python2-devel -BuildRequires: python2-setuptools -BuildRequires: python-markupsafe -BuildRequires: python2-pytest -%if 0%{?with_docs} -BuildRequires: python-sphinx -%endif # with_docs -%if 0%{?with_python3} -BuildRequires: python3-devel -BuildRequires: python3-setuptools -BuildRequires: python3-markupsafe -#BuildRequires: python3-pytest -%endif # with_python3 +%bcond_without python2 +%if 0%{?fedora} || 0%{?rhel} > 7 +%bcond_without python3 +%else +%bcond_with python3 +%endif + +# Enable building without docs to avoid a circular dependency between this +# and python-sphinx: +%bcond_without docs + +%if 0%{?fedora} > 25 || 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 @@ -47,11 +39,19 @@ principles and adding functionality useful for templating environments. +%if %{with python2} %package -n python2-jinja2 Summary: General purpose template engine for python2 -Group: Development/Languages +BuildRequires: python2-devel +BuildRequires: python2-setuptools +BuildRequires: python2-babel >= 0.8 +BuildRequires: python2-markupsafe +BuildRequires: python2-pytest +%if %{with docs} +BuildRequires: %{_bindir}/sphinx-build-2 +%endif Requires: python2-babel >= 0.8 -Requires: python-markupsafe +Requires: python2-markupsafe Requires: python2-setuptools %{?python_provide:%python_provide python2-jinja2} @@ -65,15 +65,24 @@ 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 0%{?with_python3} + +%if %{with python3} %package -n python3-jinja2 Summary: General purpose template engine for python3 Group: Development/Languages +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-babel >= 0.8 +BuildRequires: python3-markupsafe +BuildRequires: python3-pytest +%if %{with docs} +BuildRequires: %{_bindir}/sphinx-build-3 +%endif +Requires: python3-babel >= 0.8 Requires: python3-markupsafe Requires: python3-setuptools -# babel isn't py3k ready yet, and is only a weak dependency -#Requires: python3-babel >= 0.8 %{?python_provide:%python_provide python3-jinja2} %description -n python3-jinja2 @@ -86,94 +95,126 @@ 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_python3 +%endif # with python3 %prep -%setup -q -n Jinja2-%{version} +%setup -qc -n Jinja2-%{version} # cleanup -find . -name '*.pyo' -o -name '*.pyc' -delete +find Jinja2-%{version} -name '*.pyo' -o -name '*.pyc' -delete # fix EOL -sed -i 's|\r$||g' LICENSE +sed -i 's|\r$||g' Jinja2-%{version}/LICENSE + +mv Jinja2-%{version} python2 +cp -av python2 python3 %build +%if %{with python2} +pushd python2 %py2_build -# for now, we build docs using Python 2.x and use that for both -# packages. -%if 0%{?with_docs} -make -C docs html PYTHONPATH=$(pwd) -%endif # with_docs +%if %{with docs} +make -C docs html PYTHONPATH=$(pwd) SPHINXBUILD=sphinx-build-2 +%endif # with docs +popd +%endif # with python2 %if 0%{?with_python3} +pushd python3 %py3_build -%endif # with_python3 +%if %{with docs} +make -C docs html PYTHONPATH=$(pwd) SPHINXBUILD=sphinx-build-3 +%endif # with docs +popd +%endif # with python3 %install +%if %{with python2} +pushd python2 %py2_install # remove hidden file rm -rf docs/_build/html/.buildinfo +%if ! %{with async} # 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 async +popd +%endif # with python2 -%if 0%{?with_python3} +%if %{with python3} +pushd python3 %py3_install -%if ! 0%{?with_async} +# remove hidden file +rm -rf docs/_build/html/.buildinfo + +%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 -%endif # with_python3 +%endif # ! with async +popd +%endif # with python3 %check +%if %{with python2} +pushd python2 # there are currently no tests in the jinja2 tarball # make test +popd +%endif # with python2 -%if 0%{?with_python3} +%if %{with python3} +pushd python3 # there are currently no tests in the jinja2 tarball # make test -%endif # with_python3 +popd +%endif # with python3 +%if %{with python2} %files -n python2-jinja2 -%doc AUTHORS -%doc CHANGES -%license LICENSE -%if 0%{?with_docs} -%doc docs/_build/html -%endif # with_docs -%doc ext -%doc examples +%doc python2/AUTHORS +%doc python2/CHANGES.rst +%doc python2/ext +%doc python2/examples +%license python2/LICENSE +%if %{with docs} +%doc python2/docs/_build/html +%endif %{python2_sitelib}/jinja2 %{python2_sitelib}/Jinja2-%{version}-py?.?.egg-info -%exclude %{python2_sitelib}/jinja2/_debugsupport.c +%endif # with python2 -%if 0%{?with_python3} +%if %{with python3} %files -n python3-jinja2 -%doc AUTHORS -%doc CHANGES -%license LICENSE -%if 0%{?with_docs} -# docs are built with python2 -%doc docs/_build/html -%endif # with_docs -%doc ext -%doc examples +%doc python3/AUTHORS +%doc python3/CHANGES.rst +%doc python3/ext +%doc python3/examples +%license python3/LICENSE +%if %{with docs} +%doc python3/docs/_build/html +%endif %{python3_sitelib}/jinja2 %{python3_sitelib}/Jinja2-%{version}-py?.?.egg-info -%exclude %{python3_sitelib}/jinja2/_debugsupport.c -%endif # with_python3 +%endif # with python3 %changelog +* Thu Nov 16 2017 Thomas Moschny - 2.10-1 +- Update to 2.10. +- Use %%bcond. +- Move BRs to their respective subpackages. + * Fri Oct 20 2017 Troy Dawson - 2.9.6-4 - Really cleanup spec file conditionals diff --git a/sources b/sources index 3d05ce5..e96d5fb 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Jinja2-2.9.6.tar.gz) = b41b4e83bfe1ed2c5170e78bc6fb1ac3abb73df1b360c28e8011d430c3369efb49b923ede1f32c84c47c4bfa8a030ed24fc86700f2a8f777d54ee09c0fdee3c2 +SHA512 (Jinja2-2.10.tar.gz) = 0ea7371be67ffcf19e46dfd06523a45a0806e678a407d54f5f2f3e573982f0959cf82ec5d07b203670309928a62ef71109701ab16547a9bba2ebcdc178cb67f2 From 28114ac50424a2449b3d34ce63351120392e6a2a Mon Sep 17 00:00:00 2001 From: Thomas Moschny Date: Thu, 16 Nov 2017 02:00:02 +0100 Subject: [PATCH 09/83] Prevent byte-compilation errors on Python 2. --- python-jinja2.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index 332978f..b1894fe 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -139,11 +139,9 @@ pushd python2 # remove hidden file rm -rf docs/_build/html/.buildinfo -%if ! %{with async} # 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 async popd %endif # with python2 From e1414d036a84a9884274886129495b20abea8548 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 9 Feb 2018 08:29:33 +0000 Subject: [PATCH 10/83] - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_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 b1894fe..2fa2580 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -1,6 +1,6 @@ Name: python-jinja2 Version: 2.10 -Release: 1%{?dist} +Release: 2%{?dist} Summary: General purpose template engine Group: Development/Languages License: BSD @@ -208,6 +208,9 @@ popd %changelog +* Fri Feb 09 2018 Fedora Release Engineering - 2.10-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + * Thu Nov 16 2017 Thomas Moschny - 2.10-1 - Update to 2.10. - Use %%bcond. From 4320e1dd944eb8ac14cf47863023a24615a65ef1 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Mon, 16 Apr 2018 12:32:01 +0200 Subject: [PATCH 11/83] Don't build the Python 2 subpackage on EL > 7 --- python-jinja2.spec | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index 2fa2580..e7c2b76 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -1,20 +1,26 @@ Name: python-jinja2 Version: 2.10 -Release: 2%{?dist} +Release: 3%{?dist} Summary: General purpose template engine Group: Development/Languages License: BSD URL: http://jinja.pocoo.org/ Source0: https://files.pythonhosted.org/packages/source/J/Jinja2/Jinja2-%{version}.tar.gz -%bcond_without python2 - %if 0%{?fedora} || 0%{?rhel} > 7 +# Enable python3 build by default %bcond_without python3 %else %bcond_with python3 %endif +%if 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 @@ -106,9 +112,10 @@ find Jinja2-%{version} -name '*.pyo' -o -name '*.pyc' -delete # fix EOL sed -i 's|\r$||g' Jinja2-%{version}/LICENSE -mv Jinja2-%{version} python2 -cp -av python2 python3 - +mv Jinja2-%{version} python3 +%if %{with python2} +cp -av python3 python2 +%endif # with python2 %build %if %{with python2} @@ -121,7 +128,7 @@ make -C docs html PYTHONPATH=$(pwd) SPHINXBUILD=sphinx-build-2 popd %endif # with python2 -%if 0%{?with_python3} +%if %{?with_python3} pushd python3 %py3_build %if %{with docs} @@ -208,6 +215,9 @@ popd %changelog +* Mon Apr 16 2018 Charalampos Stratakis - 2.10-3 +- Don't build the Python 2 subpackage on EL > 7 + * Fri Feb 09 2018 Fedora Release Engineering - 2.10-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild From 791d2814e3dd2d24a79c64b3ec572f59f043952f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 14 Jun 2018 13:40:03 +0200 Subject: [PATCH 12/83] Bootstrap for Python 3.7 --- python-jinja2.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index e7c2b76..0e86318 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -1,6 +1,7 @@ +%global _without_docs 1 Name: python-jinja2 Version: 2.10 -Release: 3%{?dist} +Release: 4%{?dist} Summary: General purpose template engine Group: Development/Languages License: BSD @@ -215,6 +216,9 @@ popd %changelog +* Thu Jun 14 2018 Miro Hrončok - 2.10-4 +- Bootstrap for Python 3.7 + * Mon Apr 16 2018 Charalampos Stratakis - 2.10-3 - Don't build the Python 2 subpackage on EL > 7 From a4e963867bb182cddb48f10fbc5074c805dcb523 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 18 Jun 2018 20:14:40 +0200 Subject: [PATCH 13/83] Rebuilt for Python 3.7 --- python-jinja2.spec | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index 0e86318..2678aa9 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -1,7 +1,6 @@ -%global _without_docs 1 Name: python-jinja2 Version: 2.10 -Release: 4%{?dist} +Release: 5%{?dist} Summary: General purpose template engine Group: Development/Languages License: BSD @@ -216,6 +215,9 @@ popd %changelog +* Mon Jun 18 2018 Miro Hrončok - 2.10-5 +- Rebuilt for Python 3.7 + * Thu Jun 14 2018 Miro Hrončok - 2.10-4 - Bootstrap for Python 3.7 From 7dff9619856e903220d5b0d371cbcaa72fafd2d8 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 14 Jul 2018 00:40:44 +0000 Subject: [PATCH 14/83] - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_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 2678aa9..66860f3 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -1,6 +1,6 @@ Name: python-jinja2 Version: 2.10 -Release: 5%{?dist} +Release: 6%{?dist} Summary: General purpose template engine Group: Development/Languages License: BSD @@ -215,6 +215,9 @@ popd %changelog +* Sat Jul 14 2018 Fedora Release Engineering - 2.10-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + * Mon Jun 18 2018 Miro Hrončok - 2.10-5 - Rebuilt for Python 3.7 From cbdc9606dc13ddc01a34c6087d3b52f2847c1490 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Mon, 28 Jan 2019 20:18:16 +0100 Subject: [PATCH 15/83] Remove obsolete Group tag References: https://fedoraproject.org/wiki/Changes/Remove_Group_Tag --- python-jinja2.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index 66860f3..5f27c36 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -2,7 +2,6 @@ Name: python-jinja2 Version: 2.10 Release: 6%{?dist} Summary: General purpose template engine -Group: Development/Languages License: BSD URL: http://jinja.pocoo.org/ Source0: https://files.pythonhosted.org/packages/source/J/Jinja2/Jinja2-%{version}.tar.gz @@ -77,7 +76,6 @@ environments. %if %{with python3} %package -n python3-jinja2 Summary: General purpose template engine for python3 -Group: Development/Languages BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-babel >= 0.8 From 894b4990612a247f9af2a0b802f7fc5e1e513b37 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 2 Feb 2019 07:23:26 +0000 Subject: [PATCH 16/83] - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_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 5f27c36..57b3733 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -1,6 +1,6 @@ Name: python-jinja2 Version: 2.10 -Release: 6%{?dist} +Release: 7%{?dist} Summary: General purpose template engine License: BSD URL: http://jinja.pocoo.org/ @@ -213,6 +213,9 @@ popd %changelog +* Sat Feb 02 2019 Fedora Release Engineering - 2.10-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + * Sat Jul 14 2018 Fedora Release Engineering - 2.10-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild From 9a2954fc5a9b3838a89e3d74054c7079e91721f0 Mon Sep 17 00:00:00 2001 From: Phil Wyett Date: Wed, 27 Feb 2019 14:07:51 +0000 Subject: [PATCH 17/83] Fix FTBS due to bad conditional --- python-jinja2.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index 57b3733..7321c6e 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -1,6 +1,6 @@ Name: python-jinja2 Version: 2.10 -Release: 7%{?dist} +Release: 8%{?dist} Summary: General purpose template engine License: BSD URL: http://jinja.pocoo.org/ @@ -126,7 +126,7 @@ make -C docs html PYTHONPATH=$(pwd) SPHINXBUILD=sphinx-build-2 popd %endif # with python2 -%if %{?with_python3} +%if %{with python3} pushd python3 %py3_build %if %{with docs} @@ -213,6 +213,9 @@ popd %changelog +* Wed Feb 27 2019 Phil Wyett - 2.10-8 +- Fix FTBS due to bad conditional + * Sat Feb 02 2019 Fedora Release Engineering - 2.10-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild From 8c81a7dfe468087b2d1e18b983df3a79f04f4ce6 Mon Sep 17 00:00:00 2001 From: Phil Wyett Date: Thu, 28 Feb 2019 09:10:03 +0000 Subject: [PATCH 18/83] Add version requirement for markupsafe --- python-jinja2.spec | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index 7321c6e..faa89f1 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -50,13 +50,13 @@ Summary: General purpose template engine for python2 BuildRequires: python2-devel BuildRequires: python2-setuptools BuildRequires: python2-babel >= 0.8 -BuildRequires: python2-markupsafe +BuildRequires: python2-markupsafe >= 0.23 BuildRequires: python2-pytest %if %{with docs} BuildRequires: %{_bindir}/sphinx-build-2 %endif Requires: python2-babel >= 0.8 -Requires: python2-markupsafe +Requires: python2-markupsafe >= 0.23 Requires: python2-setuptools %{?python_provide:%python_provide python2-jinja2} @@ -79,13 +79,13 @@ Summary: General purpose template engine for python3 BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-babel >= 0.8 -BuildRequires: python3-markupsafe +BuildRequires: python3-markupsafe >= 0.23 BuildRequires: python3-pytest %if %{with docs} BuildRequires: %{_bindir}/sphinx-build-3 %endif Requires: python3-babel >= 0.8 -Requires: python3-markupsafe +Requires: python3-markupsafe >= 0.23 Requires: python3-setuptools %{?python_provide:%python_provide python3-jinja2} @@ -215,6 +215,7 @@ popd %changelog * Wed Feb 27 2019 Phil Wyett - 2.10-8 - Fix FTBS due to bad conditional +- Add version requirement for markupsafe * Sat Feb 02 2019 Fedora Release Engineering - 2.10-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild From 13da8e68ac79eca36a2282925d2eb09054683201 Mon Sep 17 00:00:00 2001 From: Thomas Moschny Date: Wed, 10 Apr 2019 10:22:56 +0200 Subject: [PATCH 19/83] Update to 2.10.1. --- python-jinja2.spec | 9 ++++++--- sources | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index faa89f1..aef3e53 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -1,6 +1,6 @@ Name: python-jinja2 -Version: 2.10 -Release: 8%{?dist} +Version: 2.10.1 +Release: 1%{?dist} Summary: General purpose template engine License: BSD URL: http://jinja.pocoo.org/ @@ -24,7 +24,7 @@ Source0: https://files.pythonhosted.org/packages/source/J/Jinja2/Jinja2-% # and python-sphinx: %bcond_without docs -%if 0%{?fedora} > 25 || 0%{?rhel} > 7 +%if 0%{?fedora} || 0%{?rhel} > 7 %bcond_without async %else %bcond_with async @@ -213,6 +213,9 @@ popd %changelog +* Wed Apr 10 2019 Thomas Moschny - 2.10.1-1 +- Update to 2.10.1. + * Wed Feb 27 2019 Phil Wyett - 2.10-8 - Fix FTBS due to bad conditional - Add version requirement for markupsafe diff --git a/sources b/sources index e96d5fb..2321a7f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Jinja2-2.10.tar.gz) = 0ea7371be67ffcf19e46dfd06523a45a0806e678a407d54f5f2f3e573982f0959cf82ec5d07b203670309928a62ef71109701ab16547a9bba2ebcdc178cb67f2 +SHA512 (Jinja2-2.10.1.tar.gz) = a00153a0e07bb7d67f301b4eaf7af657726a1985e9ffc7ae2d76bdbb4c062d672efc8065e398767e1039b18a483a0092e206deac91e4047aad64920b56869623 From 6145eda64bef24ab1f289a62fdedb75480440732 Mon Sep 17 00:00:00 2001 From: Thomas Moschny Date: Thu, 11 Apr 2019 07:54:06 +0200 Subject: [PATCH 20/83] Update to 2.10.1. Update specfile. --- python-jinja2.spec | 67 +++++++++++++++------------------------------- 1 file changed, 22 insertions(+), 45 deletions(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index aef3e53..22e8005 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -1,10 +1,12 @@ +%global srcname Jinja2 + Name: python-jinja2 Version: 2.10.1 Release: 1%{?dist} Summary: General purpose template engine License: BSD URL: http://jinja.pocoo.org/ -Source0: https://files.pythonhosted.org/packages/source/J/Jinja2/Jinja2-%{version}.tar.gz +Source0: %{pypi_source} %if 0%{?fedora} || 0%{?rhel} > 7 # Enable python3 build by default @@ -52,9 +54,6 @@ BuildRequires: python2-setuptools BuildRequires: python2-babel >= 0.8 BuildRequires: python2-markupsafe >= 0.23 BuildRequires: python2-pytest -%if %{with docs} -BuildRequires: %{_bindir}/sphinx-build-2 -%endif Requires: python2-babel >= 0.8 Requires: python2-markupsafe >= 0.23 Requires: python2-setuptools @@ -103,94 +102,71 @@ environments. %prep -%setup -qc -n Jinja2-%{version} +%autosetup -n %{srcname}-%{version} + # cleanup -find Jinja2-%{version} -name '*.pyo' -o -name '*.pyc' -delete +find . -name '*.pyo' -o -name '*.pyc' -delete # fix EOL -sed -i 's|\r$||g' Jinja2-%{version}/LICENSE +sed -i 's|\r$||g' LICENSE -mv Jinja2-%{version} python3 -%if %{with python2} -cp -av python3 python2 -%endif # with python2 %build %if %{with python2} -pushd python2 %py2_build - -%if %{with docs} -make -C docs html PYTHONPATH=$(pwd) SPHINXBUILD=sphinx-build-2 -%endif # with docs -popd %endif # with python2 %if %{with python3} -pushd python3 %py3_build %if %{with docs} make -C docs html PYTHONPATH=$(pwd) SPHINXBUILD=sphinx-build-3 +# remove hidden file +rm -rf docs/_build/html/.buildinfo %endif # with docs -popd %endif # with python3 %install %if %{with python2} -pushd python2 %py2_install -# remove hidden file -rm -rf docs/_build/html/.buildinfo - # these files are valid only on Python 3.6+ rm %{buildroot}%{python2_sitelib}/jinja2/asyncsupport.py rm %{buildroot}%{python2_sitelib}/jinja2/asyncfilters.py -popd %endif # with python2 %if %{with python3} -pushd python3 %py3_install -# remove hidden file -rm -rf docs/_build/html/.buildinfo - %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 -popd %endif # with python3 %check %if %{with python2} -pushd python2 # there are currently no tests in the jinja2 tarball # make test -popd %endif # with python2 %if %{with python3} -pushd python3 # there are currently no tests in the jinja2 tarball # make test -popd %endif # with python3 %if %{with python2} %files -n python2-jinja2 -%doc python2/AUTHORS -%doc python2/CHANGES.rst -%doc python2/ext -%doc python2/examples -%license python2/LICENSE +%doc AUTHORS +%doc CHANGES.rst +%doc ext +%doc examples +%license LICENSE %if %{with docs} -%doc python2/docs/_build/html +%doc docs/_build/html %endif %{python2_sitelib}/jinja2 %{python2_sitelib}/Jinja2-%{version}-py?.?.egg-info @@ -199,13 +175,13 @@ popd %if %{with python3} %files -n python3-jinja2 -%doc python3/AUTHORS -%doc python3/CHANGES.rst -%doc python3/ext -%doc python3/examples -%license python3/LICENSE +%doc AUTHORS +%doc CHANGES.rst +%doc ext +%doc examples +%license LICENSE %if %{with docs} -%doc python3/docs/_build/html +%doc docs/_build/html %endif %{python3_sitelib}/jinja2 %{python3_sitelib}/Jinja2-%{version}-py?.?.egg-info @@ -215,6 +191,7 @@ popd %changelog * Wed Apr 10 2019 Thomas Moschny - 2.10.1-1 - Update to 2.10.1. +- Update specfile. * Wed Feb 27 2019 Phil Wyett - 2.10-8 - Fix FTBS due to bad conditional From ca6d0f0cbc7e3e61b1f16559cfe10ceebc9dda17 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 26 Jul 2019 14:08:29 +0000 Subject: [PATCH 21/83] - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_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 22e8005..199d788 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -2,7 +2,7 @@ Name: python-jinja2 Version: 2.10.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: General purpose template engine License: BSD URL: http://jinja.pocoo.org/ @@ -189,6 +189,9 @@ rm %{buildroot}%{python3_sitelib}/jinja2/asyncfilters.py %changelog +* Fri Jul 26 2019 Fedora Release Engineering - 2.10.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + * Wed Apr 10 2019 Thomas Moschny - 2.10.1-1 - Update to 2.10.1. - Update specfile. From ea3a4f098274b78b6e1d3c854ae5206211488dcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 15 Aug 2019 16:24:24 +0200 Subject: [PATCH 22/83] Bootstrap for Python 3.8 --- python-jinja2.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index 199d788..80cb1dd 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -1,8 +1,9 @@ +%global _without_docs 1 %global srcname Jinja2 Name: python-jinja2 Version: 2.10.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: General purpose template engine License: BSD URL: http://jinja.pocoo.org/ @@ -189,6 +190,9 @@ rm %{buildroot}%{python3_sitelib}/jinja2/asyncfilters.py %changelog +* Thu Aug 15 2019 Miro Hrončok - 2.10.1-3 +- Bootstrap for Python 3.8 + * Fri Jul 26 2019 Fedora Release Engineering - 2.10.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild From 10cc679c9fd8c2ac629e9cb809fa0dc5111498aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Sat, 17 Aug 2019 18:47:11 +0200 Subject: [PATCH 23/83] Rebuilt for Python 3.8 --- python-jinja2.spec | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index 80cb1dd..7a37c7f 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -1,9 +1,8 @@ -%global _without_docs 1 %global srcname Jinja2 Name: python-jinja2 Version: 2.10.1 -Release: 3%{?dist} +Release: 4%{?dist} Summary: General purpose template engine License: BSD URL: http://jinja.pocoo.org/ @@ -190,6 +189,9 @@ rm %{buildroot}%{python3_sitelib}/jinja2/asyncfilters.py %changelog +* Sat Aug 17 2019 Miro Hrončok - 2.10.1-4 +- Rebuilt for Python 3.8 + * Thu Aug 15 2019 Miro Hrončok - 2.10.1-3 - Bootstrap for Python 3.8 From c215abd79cbdbda7ffa6bc99f1d0f5324647b4c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 3 Oct 2019 14:16:08 +0200 Subject: [PATCH 24/83] Rebuilt for Python 3.8.0rc1 (#1748018) --- python-jinja2.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index 7a37c7f..e7a8928 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -2,7 +2,7 @@ Name: python-jinja2 Version: 2.10.1 -Release: 4%{?dist} +Release: 5%{?dist} Summary: General purpose template engine License: BSD URL: http://jinja.pocoo.org/ @@ -189,6 +189,9 @@ rm %{buildroot}%{python3_sitelib}/jinja2/asyncfilters.py %changelog +* Thu Oct 03 2019 Miro Hrončok - 2.10.1-5 +- Rebuilt for Python 3.8.0rc1 (#1748018) + * Sat Aug 17 2019 Miro Hrončok - 2.10.1-4 - Rebuilt for Python 3.8 From acdee8786ff1920a4eb32c539eb866353ec33611 Mon Sep 17 00:00:00 2001 From: Lumir Balhar Date: Mon, 11 Nov 2019 09:05:32 +0100 Subject: [PATCH 25/83] New upstream version (2.10.3) --- python-jinja2.spec | 29 +++++++++++------------------ sources | 2 +- 2 files changed, 12 insertions(+), 19 deletions(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index e7a8928..66feea6 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -1,8 +1,8 @@ %global srcname Jinja2 Name: python-jinja2 -Version: 2.10.1 -Release: 5%{?dist} +Version: 2.10.3 +Release: 1%{?dist} Summary: General purpose template engine License: BSD URL: http://jinja.pocoo.org/ @@ -53,7 +53,6 @@ BuildRequires: python2-devel BuildRequires: python2-setuptools BuildRequires: python2-babel >= 0.8 BuildRequires: python2-markupsafe >= 0.23 -BuildRequires: python2-pytest Requires: python2-babel >= 0.8 Requires: python2-markupsafe >= 0.23 Requires: python2-setuptools @@ -82,6 +81,9 @@ BuildRequires: python3-markupsafe >= 0.23 BuildRequires: python3-pytest %if %{with docs} BuildRequires: %{_bindir}/sphinx-build-3 +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 @@ -107,10 +109,6 @@ environments. # cleanup find . -name '*.pyo' -o -name '*.pyc' -delete -# fix EOL -sed -i 's|\r$||g' LICENSE - - %build %if %{with python2} %py2_build @@ -147,24 +145,17 @@ rm %{buildroot}%{python3_sitelib}/jinja2/asyncfilters.py %check -%if %{with python2} -# there are currently no tests in the jinja2 tarball -# make test -%endif # with python2 - %if %{with python3} -# there are currently no tests in the jinja2 tarball -# make test +%{__python3} -m pytest tests %endif # with python3 %if %{with python2} %files -n python2-jinja2 -%doc AUTHORS %doc CHANGES.rst %doc ext %doc examples -%license LICENSE +%license LICENSE.rst %if %{with docs} %doc docs/_build/html %endif @@ -175,11 +166,10 @@ rm %{buildroot}%{python3_sitelib}/jinja2/asyncfilters.py %if %{with python3} %files -n python3-jinja2 -%doc AUTHORS %doc CHANGES.rst %doc ext %doc examples -%license LICENSE +%license LICENSE.rst %if %{with docs} %doc docs/_build/html %endif @@ -189,6 +179,9 @@ rm %{buildroot}%{python3_sitelib}/jinja2/asyncfilters.py %changelog +* Mon Nov 11 2019 Lumír Balhar - 2.10.3-1 +- New upstream version (2.10.3) + * Thu Oct 03 2019 Miro Hrončok - 2.10.1-5 - Rebuilt for Python 3.8.0rc1 (#1748018) diff --git a/sources b/sources index 2321a7f..c8153cb 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Jinja2-2.10.1.tar.gz) = a00153a0e07bb7d67f301b4eaf7af657726a1985e9ffc7ae2d76bdbb4c062d672efc8065e398767e1039b18a483a0092e206deac91e4047aad64920b56869623 +SHA512 (Jinja2-2.10.3.tar.gz) = c51c335450f46a467b0d40de1a51c149bdb4eb961ea888b64ff141e11b592b32e05040bfd9aa4a39892dda8d9d8cbf5a35b386ea16a247484d31b5b52eda1b8f From 4ca346baef81955b7de171249af1c08e7ad65baa Mon Sep 17 00:00:00 2001 From: Thomas Moschny Date: Wed, 20 Nov 2019 08:22:32 +0100 Subject: [PATCH 26/83] Add missing BR on make. --- python-jinja2.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index 66feea6..b4c4fba 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -2,7 +2,7 @@ Name: python-jinja2 Version: 2.10.3 -Release: 1%{?dist} +Release: 2%{?dist} Summary: General purpose template engine License: BSD URL: http://jinja.pocoo.org/ @@ -81,6 +81,7 @@ BuildRequires: python3-markupsafe >= 0.23 BuildRequires: python3-pytest %if %{with docs} BuildRequires: %{_bindir}/sphinx-build-3 +BuildRequires: make BuildRequires: python3-Pallets-Sphinx-Themes BuildRequires: python3-sphinxcontrib-log-cabinet BuildRequires: python3-sphinx-issues @@ -179,6 +180,9 @@ rm %{buildroot}%{python3_sitelib}/jinja2/asyncfilters.py %changelog +* Wed Nov 20 2019 Thomas Moschny - 2.10.3-2 +- Add missing BR on make. + * Mon Nov 11 2019 Lumír Balhar - 2.10.3-1 - New upstream version (2.10.3) From f251b7fc91846c535256dfc2f7d135ca15b17879 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 30 Jan 2020 12:53:44 +0000 Subject: [PATCH 27/83] - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_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 b4c4fba..493bc7e 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -2,7 +2,7 @@ Name: python-jinja2 Version: 2.10.3 -Release: 2%{?dist} +Release: 3%{?dist} Summary: General purpose template engine License: BSD URL: http://jinja.pocoo.org/ @@ -180,6 +180,9 @@ rm %{buildroot}%{python3_sitelib}/jinja2/asyncfilters.py %changelog +* Thu Jan 30 2020 Fedora Release Engineering - 2.10.3-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + * Wed Nov 20 2019 Thomas Moschny - 2.10.3-2 - Add missing BR on make. From d2671171edce8fc375ec71dcf53b9a3478e9dd94 Mon Sep 17 00:00:00 2001 From: Thomas Moschny Date: Sat, 8 Feb 2020 18:27:48 +0100 Subject: [PATCH 28/83] Update to 2.11.1. --- python-jinja2.spec | 13 ++++++++----- sources | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index 493bc7e..fcfc204 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -1,11 +1,11 @@ %global srcname Jinja2 Name: python-jinja2 -Version: 2.10.3 -Release: 3%{?dist} +Version: 2.11.1 +Release: 1%{?dist} Summary: General purpose template engine License: BSD -URL: http://jinja.pocoo.org/ +URL: https://palletsprojects.com/p/jinja/ Source0: %{pypi_source} %if 0%{?fedora} || 0%{?rhel} > 7 @@ -118,7 +118,7 @@ find . -name '*.pyo' -o -name '*.pyc' -delete %if %{with python3} %py3_build %if %{with docs} -make -C docs html PYTHONPATH=$(pwd) SPHINXBUILD=sphinx-build-3 +make -C docs html PYTHONPATH=$(pwd)/src SPHINXBUILD=sphinx-build-3 # remove hidden file rm -rf docs/_build/html/.buildinfo %endif # with docs @@ -147,7 +147,7 @@ rm %{buildroot}%{python3_sitelib}/jinja2/asyncfilters.py %check %if %{with python3} -%{__python3} -m pytest tests +PYTHONPATH=$(pwd)/src %{__python3} -m pytest tests %endif # with python3 @@ -180,6 +180,9 @@ rm %{buildroot}%{python3_sitelib}/jinja2/asyncfilters.py %changelog +* Sat Feb 8 2020 Thomas Moschny - 2.11.1-1 +- Update to 2.11.1. + * Thu Jan 30 2020 Fedora Release Engineering - 2.10.3-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild diff --git a/sources b/sources index c8153cb..ed54984 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Jinja2-2.10.3.tar.gz) = c51c335450f46a467b0d40de1a51c149bdb4eb961ea888b64ff141e11b592b32e05040bfd9aa4a39892dda8d9d8cbf5a35b386ea16a247484d31b5b52eda1b8f +SHA512 (Jinja2-2.11.1.tar.gz) = a9b7c1c0151f3b1a0764dc36f489104f30cc84f61d81cf018d7a5e9b5390ad07eb27d3d3d497812ea4130ddbd9142060117947c3283b1a646ce196709183ada6 From 2d369f8f0e7b112b71288a9fbc234ec7ff5b34b6 Mon Sep 17 00:00:00 2001 From: Igor Raits Date: Mon, 6 Apr 2020 09:06:21 +0200 Subject: [PATCH 29/83] Drop unneeded R: pythonX-setuptools This is not needed anymore since 2.11. Signed-off-by: Igor Raits --- python-jinja2.spec | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index fcfc204..2a1b61d 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -2,7 +2,7 @@ Name: python-jinja2 Version: 2.11.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: General purpose template engine License: BSD URL: https://palletsprojects.com/p/jinja/ @@ -55,7 +55,6 @@ 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 @@ -88,7 +87,6 @@ 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 @@ -160,8 +158,8 @@ PYTHONPATH=$(pwd)/src %{__python3} -m pytest tests %if %{with docs} %doc docs/_build/html %endif -%{python2_sitelib}/jinja2 -%{python2_sitelib}/Jinja2-%{version}-py?.?.egg-info +%{python2_sitelib}/jinja2/ +%{python2_sitelib}/Jinja2-*.egg-info/ %endif # with python2 @@ -174,12 +172,15 @@ PYTHONPATH=$(pwd)/src %{__python3} -m pytest tests %if %{with docs} %doc docs/_build/html %endif -%{python3_sitelib}/jinja2 -%{python3_sitelib}/Jinja2-%{version}-py?.?.egg-info +%{python3_sitelib}/jinja2/ +%{python3_sitelib}/Jinja2-*.egg-info/ %endif # with python3 %changelog +* Mon Apr 06 2020 Igor Raits - 2.11.1-2 +- Drop unneeded R: pythonX-setuptools + * Sat Feb 8 2020 Thomas Moschny - 2.11.1-1 - Update to 2.11.1. From 83e53b6271727587d6d0859fe28b7decbeab7532 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Hor=C3=A1k?= Date: Wed, 15 Apr 2020 09:56:06 +0200 Subject: [PATCH 30/83] - Update to 2.11.2 --- python-jinja2.spec | 7 +++++-- sources | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index 2a1b61d..4dd088d 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -1,8 +1,8 @@ %global srcname Jinja2 Name: python-jinja2 -Version: 2.11.1 -Release: 2%{?dist} +Version: 2.11.2 +Release: 1%{?dist} Summary: General purpose template engine License: BSD URL: https://palletsprojects.com/p/jinja/ @@ -178,6 +178,9 @@ PYTHONPATH=$(pwd)/src %{__python3} -m pytest tests %changelog +* Wed Apr 15 2020 Dan Horák - 2.11.2-1 +- Update to 2.11.2 + * Mon Apr 06 2020 Igor Raits - 2.11.1-2 - Drop unneeded R: pythonX-setuptools diff --git a/sources b/sources index ed54984..1a05893 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Jinja2-2.11.1.tar.gz) = a9b7c1c0151f3b1a0764dc36f489104f30cc84f61d81cf018d7a5e9b5390ad07eb27d3d3d497812ea4130ddbd9142060117947c3283b1a646ce196709183ada6 +SHA512 (Jinja2-2.11.2.tar.gz) = baf62118702a7e113e6a22d9af58a5fa66af8017ded08f18705107a4cb93c9727c7fa118436aadfe0729d7f496241ca7bcce27863c5b19deaee3852eda68c082 From b887c5baafddf26cabde1378d2f83b28dc50fe81 Mon Sep 17 00:00:00 2001 From: Thomas Moschny Date: Wed, 15 Apr 2020 22:55:27 +0200 Subject: [PATCH 31/83] Re-add dependency on python-setuptools. --- python-jinja2.spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python-jinja2.spec b/python-jinja2.spec index 4dd088d..fd2a6c1 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -55,6 +55,7 @@ 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 @@ -87,6 +88,7 @@ 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 @@ -178,6 +180,9 @@ PYTHONPATH=$(pwd)/src %{__python3} -m pytest tests %changelog +* Wed Apr 15 2020 Thomas Moschny - 2.11.2-1 +- Re-add dependency on python-setuptools. + * Wed Apr 15 2020 Dan Horák - 2.11.2-1 - Update to 2.11.2 From 1535c3bd308728ffb9a0640d6a932c66bd85ae5f Mon Sep 17 00:00:00 2001 From: Thomas Moschny Date: Wed, 6 May 2020 08:54:00 +0200 Subject: [PATCH 32/83] Drop python2 subpackage from F33 on (#1832057). --- python-jinja2.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index fd2a6c1..ef9b0a9 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -2,7 +2,7 @@ Name: python-jinja2 Version: 2.11.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: General purpose template engine License: BSD URL: https://palletsprojects.com/p/jinja/ @@ -15,7 +15,7 @@ Source0: %{pypi_source} %bcond_with python3 %endif -%if 0%{?rhel} > 7 +%if 0%{?fedora} > 32 || 0%{?rhel} > 7 # Disable python2 build by default %bcond_with python2 %else @@ -180,6 +180,9 @@ PYTHONPATH=$(pwd)/src %{__python3} -m pytest tests %changelog +* Wed May 6 2020 Thomas Moschny - 2.11.2-2 +- Drop python2 subpackage from F33 on (#1832057). + * Wed Apr 15 2020 Thomas Moschny - 2.11.2-1 - Re-add dependency on python-setuptools. From 66365eda174aa0cf069e921a7491d5ff8dc56b05 Mon Sep 17 00:00:00 2001 From: Thomas Moschny Date: Fri, 22 May 2020 10:18:08 +0200 Subject: [PATCH 33/83] Revert "Drop python2 subpackage from F33 on (#1832057)." This reverts commit 1535c3bd308728ffb9a0640d6a932c66bd85ae5f. --- python-jinja2.spec | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index ef9b0a9..fd2a6c1 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -2,7 +2,7 @@ Name: python-jinja2 Version: 2.11.2 -Release: 2%{?dist} +Release: 1%{?dist} Summary: General purpose template engine License: BSD URL: https://palletsprojects.com/p/jinja/ @@ -15,7 +15,7 @@ Source0: %{pypi_source} %bcond_with python3 %endif -%if 0%{?fedora} > 32 || 0%{?rhel} > 7 +%if 0%{?rhel} > 7 # Disable python2 build by default %bcond_with python2 %else @@ -180,9 +180,6 @@ PYTHONPATH=$(pwd)/src %{__python3} -m pytest tests %changelog -* Wed May 6 2020 Thomas Moschny - 2.11.2-2 -- Drop python2 subpackage from F33 on (#1832057). - * Wed Apr 15 2020 Thomas Moschny - 2.11.2-1 - Re-add dependency on python-setuptools. From 6aa957c8eff9b7c4a3f34d7c1a44cc045c816d8d Mon Sep 17 00:00:00 2001 From: Thomas Moschny Date: Fri, 22 May 2020 10:20:35 +0200 Subject: [PATCH 34/83] (Re-)Add changelog. --- python-jinja2.spec | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index fd2a6c1..1f1f1e7 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -2,7 +2,7 @@ Name: python-jinja2 Version: 2.11.2 -Release: 1%{?dist} +Release: 3%{?dist} Summary: General purpose template engine License: BSD URL: https://palletsprojects.com/p/jinja/ @@ -180,6 +180,12 @@ PYTHONPATH=$(pwd)/src %{__python3} -m pytest tests %changelog +* Fri May 22 2020 Thomas Moschny - 2.11.2-3 +- Re-add python2 subpackage (#1832057). + +* Wed May 6 2020 Thomas Moschny - 2.11.2-2 +- Drop python2 subpackage from F33 on (#1832057). + * Wed Apr 15 2020 Thomas Moschny - 2.11.2-1 - Re-add dependency on python-setuptools. From 00956d349d867a278ef6be903e70dceec12a5b24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 22 May 2020 17:04:46 +0200 Subject: [PATCH 35/83] Bootstrap for Python 3.9 --- python-jinja2.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index 1f1f1e7..35bb896 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -1,8 +1,9 @@ +%global _without_docs 1 %global srcname Jinja2 Name: python-jinja2 Version: 2.11.2 -Release: 3%{?dist} +Release: 4%{?dist} Summary: General purpose template engine License: BSD URL: https://palletsprojects.com/p/jinja/ @@ -180,6 +181,9 @@ PYTHONPATH=$(pwd)/src %{__python3} -m pytest tests %changelog +* Fri May 22 2020 Miro Hrončok - 2.11.2-4 +- Bootstrap for Python 3.9 + * Fri May 22 2020 Thomas Moschny - 2.11.2-3 - Re-add python2 subpackage (#1832057). From 622b488116edf1f97e84f6af1af49f65022b2d92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Sun, 24 May 2020 10:05:24 +0200 Subject: [PATCH 36/83] Rebuilt for Python 3.9 --- python-jinja2.spec | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index 35bb896..f8525c0 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -1,9 +1,8 @@ -%global _without_docs 1 %global srcname Jinja2 Name: python-jinja2 Version: 2.11.2 -Release: 4%{?dist} +Release: 5%{?dist} Summary: General purpose template engine License: BSD URL: https://palletsprojects.com/p/jinja/ @@ -181,6 +180,9 @@ PYTHONPATH=$(pwd)/src %{__python3} -m pytest tests %changelog +* Sun May 24 2020 Miro Hrončok - 2.11.2-5 +- Rebuilt for Python 3.9 + * Fri May 22 2020 Miro Hrončok - 2.11.2-4 - Bootstrap for Python 3.9 From 43a69b9aaf527ce47bc125416e8677989b29fd3c Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 29 Jul 2020 01:42:23 +0000 Subject: [PATCH 37/83] - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_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 f8525c0..17e2598 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -2,7 +2,7 @@ Name: python-jinja2 Version: 2.11.2 -Release: 5%{?dist} +Release: 6%{?dist} Summary: General purpose template engine License: BSD URL: https://palletsprojects.com/p/jinja/ @@ -180,6 +180,9 @@ PYTHONPATH=$(pwd)/src %{__python3} -m pytest tests %changelog +* Wed Jul 29 2020 Fedora Release Engineering - 2.11.2-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + * Sun May 24 2020 Miro Hrončok - 2.11.2-5 - Rebuilt for Python 3.9 From 3e72b873ffe7ae71f3da63f4a7715d67c9f6149b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 21 Dec 2020 16:09:04 +0100 Subject: [PATCH 38/83] Drop python2-jinja2 on Fedora 34+ --- python-jinja2.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index 17e2598..b6a486a 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -2,7 +2,7 @@ Name: python-jinja2 Version: 2.11.2 -Release: 6%{?dist} +Release: 7%{?dist} Summary: General purpose template engine License: BSD URL: https://palletsprojects.com/p/jinja/ @@ -15,7 +15,7 @@ Source0: %{pypi_source} %bcond_with python3 %endif -%if 0%{?rhel} > 7 +%if 0%{?fedora} > 33 || 0%{?rhel} > 7 # Disable python2 build by default %bcond_with python2 %else @@ -180,6 +180,9 @@ PYTHONPATH=$(pwd)/src %{__python3} -m pytest tests %changelog +* Mon Dec 21 2020 Miro Hrončok - 2.11.2-7 +- Drop python2-jinja2 on Fedora 34+ + * Wed Jul 29 2020 Fedora Release Engineering - 2.11.2-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild From 88ca56fd31c6e32c1123e0cfc48a9fae78fdc573 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 27 Jan 2021 11:17:33 +0000 Subject: [PATCH 39/83] - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_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 b6a486a..5375b73 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -2,7 +2,7 @@ Name: python-jinja2 Version: 2.11.2 -Release: 7%{?dist} +Release: 8%{?dist} Summary: General purpose template engine License: BSD URL: https://palletsprojects.com/p/jinja/ @@ -180,6 +180,9 @@ PYTHONPATH=$(pwd)/src %{__python3} -m pytest tests %changelog +* Wed Jan 27 2021 Fedora Release Engineering - 2.11.2-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + * Mon Dec 21 2020 Miro Hrončok - 2.11.2-7 - Drop python2-jinja2 on Fedora 34+ From 93898ae45c1e90f2e9c41a49126884cb5be93ffc Mon Sep 17 00:00:00 2001 From: Thomas Moschny Date: Sat, 6 Feb 2021 14:00:59 +0100 Subject: [PATCH 40/83] Update to 2.11.3. Add patches to build with Python 3.10 (#1907442). --- ...-the-preserved-CodeType-attributes-1.patch | 27 ++++++++++ ...at-pass-only-strings-to-literal_eval.patch | 49 +++++++++++++++++++ python-jinja2.spec | 13 +++-- sources | 2 +- 4 files changed, 87 insertions(+), 4 deletions(-) create mode 100644 0001-add-linetable-to-the-preserved-CodeType-attributes-1.patch create mode 100644 0002-native_concat-pass-only-strings-to-literal_eval.patch diff --git a/0001-add-linetable-to-the-preserved-CodeType-attributes-1.patch b/0001-add-linetable-to-the-preserved-CodeType-attributes-1.patch new file mode 100644 index 0000000..7840d4f --- /dev/null +++ b/0001-add-linetable-to-the-preserved-CodeType-attributes-1.patch @@ -0,0 +1,27 @@ +From 9a99db929323f60553b391c80d0395821121d593 Mon Sep 17 00:00:00 2001 +From: Thomas Moschny +Date: Tue, 19 Jan 2021 21:01:18 +0100 +Subject: [PATCH] add 'linetable' to the preserved CodeType attributes (#1334) + +add 'linetable' to the preserved CodeType attributes + +co_linetable replaces co_lnotab as part of PEP 626 in Python 3.10. +--- + src/jinja2/debug.py | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/jinja2/debug.py b/src/jinja2/debug.py +index 5d8aec3..e256617 100644 +--- a/src/jinja2/debug.py ++++ b/src/jinja2/debug.py +@@ -137,6 +137,7 @@ def fake_traceback(exc_value, tb, filename, lineno): + "lnotab", + "freevars", + "cellvars", ++ "linetable", # Python 3.10 + ): + if isinstance(attr, tuple): + # Replace with given value. +-- +2.29.2 + diff --git a/0002-native_concat-pass-only-strings-to-literal_eval.patch b/0002-native_concat-pass-only-strings-to-literal_eval.patch new file mode 100644 index 0000000..3e0e76a --- /dev/null +++ b/0002-native_concat-pass-only-strings-to-literal_eval.patch @@ -0,0 +1,49 @@ +From 58250a709532ccb3e6d92ca65b3d305d1464cb68 Mon Sep 17 00:00:00 2001 +From: Martin Krizek +Date: Thu, 28 Jan 2021 10:08:50 +0100 +Subject: [PATCH] native_concat: pass only strings to literal_eval + +If there is only single node and it is not a string, there is no point +in passing it into ``literal_eval``, just return it immediately. + +One of the examples where passing a non-string node into +``literal_eval`` would actually cause problems is when the node is +``Undefined``. On Python 3.10 this would cause ``UndefinedError`` +instead of just ``Undefined`` being returned. + +Fixes #1335 +--- + CHANGES.rst | 3 +++ + src/jinja2/nativetypes.py | 2 ++ + 2 files changed, 5 insertions(+) + +diff --git a/CHANGES.rst b/CHANGES.rst +index 511b22b..a8a66ea 100644 +--- a/CHANGES.rst ++++ b/CHANGES.rst +@@ -8,6 +8,9 @@ Released 2021-01-31 + - Improve the speed of the ``urlize`` filter by reducing regex + backtracking. Email matching requires a word character at the start + of the domain part, and only word characters in the TLD. :pr:`1343` ++- Fix UndefinedError incorrectly being thrown on an undefined variable ++ instead of ``Undefined`` being returned on ++ ``NativeEnvironment`` on Python 3.10. :issue:`1335` + + + Version 2.11.2 +diff --git a/src/jinja2/nativetypes.py b/src/jinja2/nativetypes.py +index a9ead4e..2fee17f 100644 +--- a/src/jinja2/nativetypes.py ++++ b/src/jinja2/nativetypes.py +@@ -26,6 +26,8 @@ def native_concat(nodes): + + if len(head) == 1: + raw = head[0] ++ if not isinstance(raw, str): ++ return raw + else: + raw = u"".join([text_type(v) for v in chain(head, nodes)]) + +-- +2.29.2 + diff --git a/python-jinja2.spec b/python-jinja2.spec index 5375b73..3cb3a79 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -1,12 +1,15 @@ %global srcname Jinja2 Name: python-jinja2 -Version: 2.11.2 -Release: 8%{?dist} +Version: 2.11.3 +Release: 1%{?dist} Summary: General purpose template engine License: BSD URL: https://palletsprojects.com/p/jinja/ Source0: %{pypi_source} +# cherry-picked patches to build with Python 3.10 (#1907442) +Patch1: 0001-add-linetable-to-the-preserved-CodeType-attributes-1.patch +Patch2: 0002-native_concat-pass-only-strings-to-literal_eval.patch %if 0%{?fedora} || 0%{?rhel} > 7 # Enable python3 build by default @@ -105,7 +108,7 @@ environments. %prep -%autosetup -n %{srcname}-%{version} +%autosetup -p1 -n %{srcname}-%{version} # cleanup find . -name '*.pyo' -o -name '*.pyc' -delete @@ -180,6 +183,10 @@ PYTHONPATH=$(pwd)/src %{__python3} -m pytest tests %changelog +* Sat Feb 6 2021 Thomas Moschny - 2.11.3-1 +- Update to 2.11.3. +- Add patches to build with Python 3.10 (#1907442). + * Wed Jan 27 2021 Fedora Release Engineering - 2.11.2-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild diff --git a/sources b/sources index 1a05893..a742c89 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Jinja2-2.11.2.tar.gz) = baf62118702a7e113e6a22d9af58a5fa66af8017ded08f18705107a4cb93c9727c7fa118436aadfe0729d7f496241ca7bcce27863c5b19deaee3852eda68c082 +SHA512 (Jinja2-2.11.3.tar.gz) = fce4f835795fe9afb622f8106f60344032a811f3f693806f31ba482f9b7c1400f93dfa1701b4db0b472cbed4b0793cb329778c8091811ef0e3b577150d28e004 From 94e6de8860de51f71a30bdae3439a8b93b62bcd3 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Wed, 2 Jun 2021 17:31:07 +0200 Subject: [PATCH 41/83] Bootstrap for Python 3.10 --- python-jinja2.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index 3cb3a79..0826c13 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -1,8 +1,9 @@ +%global _without_docs 1 %global srcname Jinja2 Name: python-jinja2 Version: 2.11.3 -Release: 1%{?dist} +Release: 2%{?dist} Summary: General purpose template engine License: BSD URL: https://palletsprojects.com/p/jinja/ @@ -183,6 +184,9 @@ PYTHONPATH=$(pwd)/src %{__python3} -m pytest tests %changelog +* Wed Jun 02 2021 Python Maint - 2.11.3-2 +- Bootstrap for Python 3.10 + * Sat Feb 6 2021 Thomas Moschny - 2.11.3-1 - Update to 2.11.3. - Add patches to build with Python 3.10 (#1907442). From 6be37c33e6030eb62be9e90a7208e00f8167c194 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 2 Jun 2021 18:04:00 +0200 Subject: [PATCH 42/83] Temporarily ignore DeprecationWarning in get_event_loop() in tests --- 0003-ignore-get_event_loop-DeprecationWarning.patch | 12 ++++++++++++ python-jinja2.spec | 2 ++ 2 files changed, 14 insertions(+) create mode 100644 0003-ignore-get_event_loop-DeprecationWarning.patch diff --git a/0003-ignore-get_event_loop-DeprecationWarning.patch b/0003-ignore-get_event_loop-DeprecationWarning.patch new file mode 100644 index 0000000..f8586ed --- /dev/null +++ b/0003-ignore-get_event_loop-DeprecationWarning.patch @@ -0,0 +1,12 @@ +diff --git a/setup.cfg b/setup.cfg +index 3387720..fa69df8 100644 +--- a/setup.cfg ++++ b/setup.cfg +@@ -10,6 +10,7 @@ testpaths = tests + filterwarnings = + error + ignore:the sets module:DeprecationWarning:jinja2.sandbox ++ ignore:There is no current event loop:DeprecationWarning + + [coverage:run] + branch = True diff --git a/python-jinja2.spec b/python-jinja2.spec index 0826c13..22ef28e 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -11,6 +11,8 @@ Source0: %{pypi_source} # cherry-picked patches to build with Python 3.10 (#1907442) Patch1: 0001-add-linetable-to-the-preserved-CodeType-attributes-1.patch Patch2: 0002-native_concat-pass-only-strings-to-literal_eval.patch +# temporarily ignore DeprecationWarning in get_event_loop() in tests +Patch3: 0003-ignore-get_event_loop-DeprecationWarning.patch %if 0%{?fedora} || 0%{?rhel} > 7 # Enable python3 build by default From eb8d02cae6d7afeb48512a1f05a99ef7e3306095 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Fri, 4 Jun 2021 10:16:10 +0200 Subject: [PATCH 43/83] Rebuilt for Python 3.10 --- python-jinja2.spec | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/python-jinja2.spec b/python-jinja2.spec index 22ef28e..cf9da7c 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -1,9 +1,8 @@ -%global _without_docs 1 %global srcname Jinja2 Name: python-jinja2 Version: 2.11.3 -Release: 2%{?dist} +Release: 3%{?dist} Summary: General purpose template engine License: BSD URL: https://palletsprojects.com/p/jinja/ @@ -186,6 +185,9 @@ PYTHONPATH=$(pwd)/src %{__python3} -m pytest tests %changelog +* Fri Jun 04 2021 Python Maint - 2.11.3-3 +- Rebuilt for Python 3.10 + * Wed Jun 02 2021 Python Maint - 2.11.3-2 - Bootstrap for Python 3.10 From 81f300b434ec3e8031b5520deb56d16f76150ecb Mon Sep 17 00:00:00 2001 From: Lumir Balhar Date: Tue, 22 Jun 2021 23:03:10 +0200 Subject: [PATCH 44/83] Update to 3.0.1 --- ...-the-preserved-CodeType-attributes-1.patch | 27 ---------- ...at-pass-only-strings-to-literal_eval.patch | 49 ------------------- ...re-get_event_loop-DeprecationWarning.patch | 12 ----- python-jinja2.spec | 14 +++--- sources | 2 +- 5 files changed, 7 insertions(+), 97 deletions(-) delete mode 100644 0001-add-linetable-to-the-preserved-CodeType-attributes-1.patch delete mode 100644 0002-native_concat-pass-only-strings-to-literal_eval.patch delete mode 100644 0003-ignore-get_event_loop-DeprecationWarning.patch diff --git a/0001-add-linetable-to-the-preserved-CodeType-attributes-1.patch b/0001-add-linetable-to-the-preserved-CodeType-attributes-1.patch deleted file mode 100644 index 7840d4f..0000000 --- a/0001-add-linetable-to-the-preserved-CodeType-attributes-1.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 9a99db929323f60553b391c80d0395821121d593 Mon Sep 17 00:00:00 2001 -From: Thomas Moschny -Date: Tue, 19 Jan 2021 21:01:18 +0100 -Subject: [PATCH] add 'linetable' to the preserved CodeType attributes (#1334) - -add 'linetable' to the preserved CodeType attributes - -co_linetable replaces co_lnotab as part of PEP 626 in Python 3.10. ---- - src/jinja2/debug.py | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/jinja2/debug.py b/src/jinja2/debug.py -index 5d8aec3..e256617 100644 ---- a/src/jinja2/debug.py -+++ b/src/jinja2/debug.py -@@ -137,6 +137,7 @@ def fake_traceback(exc_value, tb, filename, lineno): - "lnotab", - "freevars", - "cellvars", -+ "linetable", # Python 3.10 - ): - if isinstance(attr, tuple): - # Replace with given value. --- -2.29.2 - diff --git a/0002-native_concat-pass-only-strings-to-literal_eval.patch b/0002-native_concat-pass-only-strings-to-literal_eval.patch deleted file mode 100644 index 3e0e76a..0000000 --- a/0002-native_concat-pass-only-strings-to-literal_eval.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 58250a709532ccb3e6d92ca65b3d305d1464cb68 Mon Sep 17 00:00:00 2001 -From: Martin Krizek -Date: Thu, 28 Jan 2021 10:08:50 +0100 -Subject: [PATCH] native_concat: pass only strings to literal_eval - -If there is only single node and it is not a string, there is no point -in passing it into ``literal_eval``, just return it immediately. - -One of the examples where passing a non-string node into -``literal_eval`` would actually cause problems is when the node is -``Undefined``. On Python 3.10 this would cause ``UndefinedError`` -instead of just ``Undefined`` being returned. - -Fixes #1335 ---- - CHANGES.rst | 3 +++ - src/jinja2/nativetypes.py | 2 ++ - 2 files changed, 5 insertions(+) - -diff --git a/CHANGES.rst b/CHANGES.rst -index 511b22b..a8a66ea 100644 ---- a/CHANGES.rst -+++ b/CHANGES.rst -@@ -8,6 +8,9 @@ Released 2021-01-31 - - Improve the speed of the ``urlize`` filter by reducing regex - backtracking. Email matching requires a word character at the start - of the domain part, and only word characters in the TLD. :pr:`1343` -+- Fix UndefinedError incorrectly being thrown on an undefined variable -+ instead of ``Undefined`` being returned on -+ ``NativeEnvironment`` on Python 3.10. :issue:`1335` - - - Version 2.11.2 -diff --git a/src/jinja2/nativetypes.py b/src/jinja2/nativetypes.py -index a9ead4e..2fee17f 100644 ---- a/src/jinja2/nativetypes.py -+++ b/src/jinja2/nativetypes.py -@@ -26,6 +26,8 @@ def native_concat(nodes): - - if len(head) == 1: - raw = head[0] -+ if not isinstance(raw, str): -+ return raw - else: - raw = u"".join([text_type(v) for v in chain(head, nodes)]) - --- -2.29.2 - diff --git a/0003-ignore-get_event_loop-DeprecationWarning.patch b/0003-ignore-get_event_loop-DeprecationWarning.patch deleted file mode 100644 index f8586ed..0000000 --- a/0003-ignore-get_event_loop-DeprecationWarning.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/setup.cfg b/setup.cfg -index 3387720..fa69df8 100644 ---- a/setup.cfg -+++ b/setup.cfg -@@ -10,6 +10,7 @@ testpaths = tests - filterwarnings = - error - ignore:the sets module:DeprecationWarning:jinja2.sandbox -+ ignore:There is no current event loop:DeprecationWarning - - [coverage:run] - branch = True diff --git a/python-jinja2.spec b/python-jinja2.spec index cf9da7c..1133f78 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -1,17 +1,12 @@ %global srcname Jinja2 Name: python-jinja2 -Version: 2.11.3 -Release: 3%{?dist} +Version: 3.0.1 +Release: 1%{?dist} Summary: General purpose template engine License: BSD URL: https://palletsprojects.com/p/jinja/ Source0: %{pypi_source} -# cherry-picked patches to build with Python 3.10 (#1907442) -Patch1: 0001-add-linetable-to-the-preserved-CodeType-attributes-1.patch -Patch2: 0002-native_concat-pass-only-strings-to-literal_eval.patch -# temporarily ignore DeprecationWarning in get_event_loop() in tests -Patch3: 0003-ignore-get_event_loop-DeprecationWarning.patch %if 0%{?fedora} || 0%{?rhel} > 7 # Enable python3 build by default @@ -173,7 +168,6 @@ PYTHONPATH=$(pwd)/src %{__python3} -m pytest tests %if %{with python3} %files -n python3-jinja2 %doc CHANGES.rst -%doc ext %doc examples %license LICENSE.rst %if %{with docs} @@ -185,6 +179,10 @@ PYTHONPATH=$(pwd)/src %{__python3} -m pytest tests %changelog +* Tue Jun 22 2021 Lumír Balhar - 3.0.1-1 +- Update to 3.0.1 +- Resolves: rhbz#1961862 + * Fri Jun 04 2021 Python Maint - 2.11.3-3 - Rebuilt for Python 3.10 diff --git a/sources b/sources index a742c89..166072d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Jinja2-2.11.3.tar.gz) = fce4f835795fe9afb622f8106f60344032a811f3f693806f31ba482f9b7c1400f93dfa1701b4db0b472cbed4b0793cb329778c8091811ef0e3b577150d28e004 +SHA512 (Jinja2-3.0.1.tar.gz) = 18ca56fb2271885c41982d2a3b2daa8bdc7a95191f54d8eec96ddbe001ac995b3fae766b603d8c9287413e5227062b771575012cd92a3f64ed76067d5f168701 From 5fea5530818c17c54c6ed03f82794f8950f32591 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 23 Jul 2021 07:01:44 +0000 Subject: [PATCH 45/83] - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_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 1133f78..4b68047 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -2,7 +2,7 @@ Name: python-jinja2 Version: 3.0.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: General purpose template engine License: BSD URL: https://palletsprojects.com/p/jinja/ @@ -179,6 +179,9 @@ PYTHONPATH=$(pwd)/src %{__python3} -m pytest tests %changelog +* Fri Jul 23 2021 Fedora Release Engineering - 3.0.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + * Tue Jun 22 2021 Lumír Balhar - 3.0.1-1 - Update to 3.0.1 - Resolves: rhbz#1961862 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 46/83] 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 47/83] 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 48/83] 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 49/83] 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 50/83] 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 51/83] - 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 52/83] 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 53/83] 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 54/83] 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 55/83] 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 56/83] 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 57/83] 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 58/83] 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 59/83] 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 60/83] 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 61/83] 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 62/83] 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 63/83] 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 64/83] 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 65/83] 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 66/83] 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 67/83] 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 68/83] 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 69/83] 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 70/83] 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 71/83] 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 72/83] 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 73/83] 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 74/83] 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 75/83] 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 76/83] 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 77/83] 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 78/83] 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 79/83] 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 80/83] 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 81/83] 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 82/83] 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 83/83] 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