From ba0d2acff5af0d431603c6b5a570e3c5edcbfa94 Mon Sep 17 00:00:00 2001 From: zhanliwen Date: Wed, 24 Jun 2020 19:26:48 +0800 Subject: [PATCH] optimize make test --- back-optimize-make-test.patch | 58 ++++++ python-mako.spec | 322 ++++++++++++++++++++++++++++++---- 2 files changed, 345 insertions(+), 35 deletions(-) create mode 100644 back-optimize-make-test.patch diff --git a/back-optimize-make-test.patch b/back-optimize-make-test.patch new file mode 100644 index 0000000..d7fb18f --- /dev/null +++ b/back-optimize-make-test.patch @@ -0,0 +1,58 @@ +From 00a1c26aa072cd17de8a185d9afbc70070d3eab6 Mon Sep 17 00:00:00 2001 +From: Mike Bayer +Date: Wed, 20 Mar 2019 11:15:47 -0400 +Subject: [PATCH] Add Constant to _ast_util + +--- + doc/build/changelog.rst | 6 ++++++ + mako/_ast_util.py | 3 +++ + tox.ini | 2 +- + 3 files changed, 10 insertions(+), 1 deletion(-) + +diff --git a/doc/build/changelog.rst b/doc/build/changelog.rst +index 7d110f3..24c6100 100644 +--- a/doc/build/changelog.rst ++++ b/doc/build/changelog.rst +@@ -8,6 +8,12 @@ Changelog + .. changelog:: + :version: 1.0.6 + :released: Wed Nov 9 2016 ++.. changelog:: ++ :tags: bug ++ :tickets: 281 ++ ++ Fixed an element in the AST Python generator which changed ++ for Python 3.8, causing expression generation to fail. + + .. change:: + :tags: feature +diff --git a/mako/_ast_util.py b/mako/_ast_util.py +index 8d19b0d..d770451 100644 +--- a/mako/_ast_util.py ++++ b/mako/_ast_util.py +@@ -679,6 +679,9 @@ class SourceGenerator(NodeVisitor): + + def visit_Num(self, node): + self.write(repr(node.n)) ++ # newly needed in Python 3.8 ++ def visit_Constant(self, node): ++ self.write(repr(node.n)) + + def visit_Tuple(self, node): + self.write('(') +diff --git a/tox.ini b/tox.ini +index 19016de..45d7f00 100644 +--- a/tox.ini ++++ b/tox.ini +@@ -1,7 +1,7 @@ + # content of: tox.ini , put in same dir as setup.py + [tox] + minversion=1.8.dev1 +-envlist = py{26,27,34,35} ++envlist = py{26,27,34,35,36,37,38} + + [testenv] + cov_args=--cov=mako --cov-report term --cov-report xml +-- +2.23.0 + diff --git a/python-mako.spec b/python-mako.spec index 04d6fe0..3656fc4 100644 --- a/python-mako.spec +++ b/python-mako.spec @@ -1,89 +1,341 @@ +%if 0%{?fedora} || 0%{?rhel} >= 8 +%bcond_without python3 +%else +%bcond_with python3 +%endif + +%if 0%{?rhel} > 7 +%bcond_with python2 +%else +%bcond_without python2 +%endif + +%global upname Mako + Name: python-mako Version: 1.0.6 -Release: 12 -Summary: Mako template library for Python +Release: 12%{?dist} +BuildArch: noarch + +# Mostly MIT, but _ast_util.py is Python licensed. +# The documentation contains javascript for search licensed BSD or GPLv2 License: (MIT and Python) and (BSD or GPLv2) -Group: Development/Languages +Summary: Mako template library for Python URL: http://www.makotemplates.org/ Source0: https://bitbucket.org/zzzeek/mako/get/rel_%(echo %{version} | sed "s/\./_/g").tar.bz2 -BuildArch: noarch -BuildRequires: python2-devel python2-pytest python2-setuptools -BuildRequires: python2-markupsafe python2-nose python2-mock -BuildRequires: python3-devel python3-pytest python3-setuptools -BuildRequires: python3-markupsafe python3-mock python3-nose +Patch1: back-optimize-make-test.patch + +%if %{with python2} +BuildRequires: python2-devel +BuildRequires: python2-pytest +BuildRequires: python2-setuptools +BuildRequires: python2-markupsafe +#BuildRequires: python2-beaker +BuildRequires: python2-nose +BuildRequires: python2-mock +%endif #{with python2} + +%if %{with python3} +BuildRequires: python3-devel +BuildRequires: python3-pytest +BuildRequires: python3-setuptools +BuildRequires: python3-markupsafe +#BuildRequires: python3-beaker +BuildRequires: python3-mock +BuildRequires: python3-nose +%endif #{with python3} -%description -Python-mako is a template library for Python. It provides a familiar, non-XML -syntax which compiles into Python modules for maximum performance. Mako's syntax -and API borrows from the best ideas of many others, including Django templates, -Cheetah, Myghty, and Genshi. +%global _description\ +Mako is a template library written in Python. It provides a familiar, non-XML\ +syntax which compiles into Python modules for maximum performance. Mako's\ +syntax and API borrows from the best ideas of many others, including Django\ +templates, Cheetah, Myghty, and Genshi. Conceptually, Mako is an embedded\ +Python (i.e. Python Server Page) language, which refines the familiar ideas of\ +componentized layout and inheritance to produce one of the most straightforward\ +and flexible models available, while also maintaining close ties to Python\ +calling and scoping semantics. +%description %_description + +%if %{with python2} %package -n python2-mako -Summary: Mako library for python 2 +Summary: %summary Requires: python2-markupsafe + +# Beaker is the preferred caching backend, but is not strictly necessary Recommends: python2-beaker %{?python_provide:%python_provide python2-mako} -%description -n python2-mako -Mako library for python 2. +%description -n python2-mako %_description +%endif #{with python2} + +%package doc +Summary: Documentation for the Mako template library for Python +License: (MIT and Python) and (BSD or GPLv2) +%if %{with python3} +Requires: python3-mako = %{version}-%{release} +%else +Requires: python2-mako = %{version}-%{release} +%endif #{with python3} +%description doc +Mako is a template library written in Python. It provides a familiar, non-XML +syntax which compiles into Python modules for maximum performance. Mako's +syntax and API borrows from the best ideas of many others, including Django +templates, Cheetah, Myghty, and Genshi. Conceptually, Mako is an embedded +Python (i.e. Python Server Page) language, which refines the familiar ideas of +componentized layout and inheritance to produce one of the most straightforward +and flexible models available, while also maintaining close ties to Python +calling and scoping semantics. + +This package contains documentation in text and HTML formats. + + +%if %{with python3} %package -n python3-mako -Summary: Mako library for Python 3 +Summary: Mako template library for Python 3 Requires: python3-markupsafe + +# Beaker is the preferred caching backend, but is not strictly necessary Recommends: python3-beaker %{?python_provide:%python_provide python3-mako} -%description -n python3-mako -Mako library for Python 3. +%if %{without python2} +Obsoletes: python2-mako < %{version}-%{release} +%endif #{without python2} -%package help -Summary: Help file of Mako library for Python -Requires: python3-mako = %{version}-%{release} +%description -n python3-mako +Mako is a template library written in Python. It provides a familiar, non-XML +syntax which compiles into Python modules for maximum performance. Mako's +syntax and API borrows from the best ideas of many others, including Django +templates, Cheetah, Myghty, and Genshi. Conceptually, Mako is an embedded +Python (i.e. Python Server Page) language, which refines the familiar ideas of +componentized layout and inheritance to produce one of the most straightforward +and flexible models available, while also maintaining close ties to Python +calling and scoping semantics. -%description help -Help file of Mako library for Python in text and HTML formats. +This package contains the mako module built for use with python3. +%endif #{with python3} %prep -%autosetup -n zzzeek-mako-8e83c7561e3c +%autosetup -n zzzeek-mako-8e83c7561e3c -p1 %build %{?with_python2:%py2_build} %{?with_python3:%py3_build} + %install %{?with_python3:%py3_install} +%if %{with python2} mv %{buildroot}/%{_bindir}/mako-render %{buildroot}/%{_bindir}/python3-mako-render +%endif %{?with_python2:%py2_install} +# These are supporting files for building the docs. No need to ship rm -rf doc/build %check +%if %{with python2} %{__python2} setup.py test +%endif #{with python2} + +%if %{with python3} %{__python3} setup.py test +%endif +%if %{with python2} %files -n python2-mako -%license LICENSE AUTHORS -%doc CHANGES README.* examples +%license LICENSE +%doc CHANGES README.rst examples %{_bindir}/mako-render %{python2_sitelib}/* +%endif %{with python2} +%if %{with python3} %files -n python3-mako -%license LICENSE AUTHORS -%doc CHANGES README.* examples +%license LICENSE +%doc CHANGES README.rst examples +%if %{with python2} %{_bindir}/python3-mako-render +%else +%{_bindir}/mako-render +%endif %{python3_sitelib}/* +%endif -%files help +%files doc %doc doc + %changelog -* Sat Oct 19 2019 openEuler Buildteam - 1.0.6-12 -- Type:NA -- ID:NA -- SUG:NA -- DESC:Package Init +* Sat Feb 02 2019 Fedora Release Engineering - 1.0.6-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Sat Jul 14 2018 Fedora Release Engineering - 1.0.6-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Fri Jun 15 2018 Miro Hrončok - 1.0.6-10 +- Rebuilt for Python 3.7 + +* Wed Mar 28 2018 Petr Viktorin - 1.0.6-9 +- Make python-beaker an optional dependency +- Add missing python_provide for python3-mako +- Conditionalize the Python 2 subpackage +- Modernize the specfile + +* Mon Feb 12 2018 Iryna Shcherbina - 1.0.6-8 +- Update Python 2 dependency declarations to new packaging standards + (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3) + +* Fri Feb 09 2018 Fedora Release Engineering - 1.0.6-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Wed Sep 27 2017 Troy Dawson - 1.0.6-6 +- Cleanup spec file conditionals + +* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek - 1.0.6-5 +- Python 2 binary package renamed to python2-mako + See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3 + +* Thu Jul 27 2017 Fedora Release Engineering - 1.0.6-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Sat Feb 11 2017 Fedora Release Engineering - 1.0.6-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Mon Dec 19 2016 Miro Hrončok - 1.0.6-2 +- Rebuild for Python 3.6 + +* Sat Dec 17 2016 Randy Barlow - 1.0.6-1 +- Update to 1.0.6 (#1257376). +- Mark LICENSE as the license. +- Drop declaration of BuildRoot. +- Drop use of 2to3 since upstream supports Python 3 now. + +* Tue Jul 19 2016 Fedora Release Engineering - 1.0.3-3 +- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages + +* Thu Feb 04 2016 Fedora Release Engineering - 1.0.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Thu Nov 12 2015 Kevin Fenzi - 1.0.3-1 +- Update to 1.0.3 + +* Tue Nov 10 2015 Fedora Release Engineering - 1.0.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5 + +* Thu Jun 18 2015 Fedora Release Engineering - 1.0.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Wed Jan 28 2015 Matej Cepl - 1.0.1-1 +- Update to 1.0.1 (#1185339) + +* Wed Jun 18 2014 Luke Macken - 1.0.0-1 +- Update to 1.0.0 (#1106453) +- Add a BR on python-mock + +* Sat Jun 07 2014 Fedora Release Engineering - 0.9.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Tue May 27 2014 Kalev Lember - 0.9.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4 + +* Mon May 19 2014 Luke Macken - 0.9.1-2 +- Create a subpackage for the documentation (#1006259) + +* Mon May 19 2014 Luke Macken - 0.9.1-1 +- Update to 0.9.1 (#967837) + +* Sun Aug 04 2013 Fedora Release Engineering - 0.7.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Tue Apr 9 2013 Luke Macken - 0.7.3-1 +- Update to 0.7.3 (#784257) + +* Thu Feb 14 2013 Fedora Release Engineering - 0.5.0-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Sat Aug 04 2012 David Malcolm - 0.5.0-5 +- rebuild for https://fedoraproject.org/wiki/Features/Python_3.3 + +* Fri Aug 3 2012 David Malcolm - 0.5.0-4 +- remove rhel logic from with_python3 conditional + +* Sat Jul 21 2012 Fedora Release Engineering - 0.5.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Sat Jan 14 2012 Fedora Release Engineering - 0.5.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Tue Dec 13 2011 Luke Macken - 0.5.0-1 +- Update to 0.5.0 + +* Mon Sep 5 2011 Toshio Kuratomi - 0.4.2-2 +- Require beaker to run unittests since its required at runtime +- Fix license tag + +* Mon Sep 5 2011 Toshio Kuratomi - 0.4.2-1 +- Update to 0.4.2 +- Run unit tests on python3 + +* Thu Feb 24 2011 Luke Macken - 0.4.0-1 +- Update to 0.4.0 (#654779) + +* Wed Feb 09 2011 Fedora Release Engineering - 0.3.6-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Wed Feb 02 2011 Luke Macken - 0.3.6-1 +- Update to 0.3.6 +- Remove 2to3 patch + +* Wed Oct 27 2010 Toshio Kuratomi - 0.3.5-2 +- Use a patch from Debian submitted upstream to convert to python3 syntax + +* Thu Oct 21 2010 Luke Macken - 0.3.5-1 +- Update to 0.3.5 (#645063) + +* Wed Aug 25 2010 Thomas Spura - 0.3.4-3 +- rebuild with python3.2 + http://lists.fedoraproject.org/pipermail/devel/2010-August/141368.html + +* Thu Jul 22 2010 David Malcolm - 0.3.4-2 +- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild + +* Sun Jun 27 2010 Kyle VanderBeek - 0.3.4-1 +- Update to 0.3.4 security fix release +- Fix missing python3-beaker dependency + +* Sat Jun 5 2010 Kyle VanderBeek - 0.3.3-1 +- Update to upstream 0.3.3 + +* Tue May 4 2010 David Malcolm - 0.3.2-2 +- add python3 subpackage + +* Tue May 04 2010 Luke Macken - 0.3.2-1 +- Update to 0.3.2 +- Run the test suite in %%check + +* Sun Jul 26 2009 Fedora Release Engineering - 0.2.4-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Thu Feb 26 2009 Fedora Release Engineering - 0.2.4-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Tue Jan 06 2009 Luke Macken - 0.2.4-1 +- Update to 0.2.4 + +* Sat Nov 29 2008 Ignacio Vazquez-Abrams - 0.1.10-3 +- Rebuild for Python 2.6 + +* Sun May 11 2008 Kyle VanderBeek - 0.1.10-2 +- Fix rpmlint warnings. +- Add docs and examples. + +* Wed Apr 9 2008 Kyle VanderBeek - 0.1.10-1 +- Initial version. -- Gitee