[packages/python-Mako] - updated to 1.0.7 - run unit tests; added mock patch to avoid redundant python3-mock dependency - a
qboosh
qboosh at pld-linux.org
Sun Jun 24 11:15:40 CEST 2018
commit 792a53ec00e89e3d5caa647dbc4ab171e08c03fd
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Sun Jun 24 11:17:02 2018 +0200
- updated to 1.0.7
- run unit tests; added mock patch to avoid redundant python3-mock dependency
- added -doc subpackage; drop examples todo, they take just 44kB
python-Mako-mock.patch | 20 ++++++++++++++++++++
python-Mako.spec | 46 ++++++++++++++++++++++++++++++++++++----------
2 files changed, 56 insertions(+), 10 deletions(-)
---
diff --git a/python-Mako.spec b/python-Mako.spec
index 90718ca..97d32cf 100644
--- a/python-Mako.spec
+++ b/python-Mako.spec
@@ -1,34 +1,44 @@
-# TODO:
-# - examples subpackage
#
+# Conditional build:
%bcond_without python2 # CPython 2.x module
%bcond_without python3 # CPython 3.x module
+%bcond_without tests # unit tests
%define fname Mako
Summary: Templating system for Python
Summary(pl.UTF-8): System szablonów dla języka Python
Name: python-%{fname}
-Version: 1.0.4
-Release: 2
+Version: 1.0.7
+Release: 1
License: MIT
Group: Libraries/Python
-#Source0Download: https://pypi.python.org/simple/Mako/
-Source0: https://pypi.python.org/packages/source/M/Mako/%{fname}-%{version}.tar.gz
-# Source0-md5: c5fc31a323dd4990683d2f2da02d4e20
+#Source0Download: https://pypi.org/simple/mako/
+Source0: https://files.pythonhosted.org/packages/source/M/Mako/%{fname}-%{version}.tar.gz
+# Source0-md5: 5836cc997b1b773ef389bf6629c30e65
+Patch0: %{name}-mock.patch
URL: http://www.makotemplates.org/
%if %{with python2}
BuildRequires: python >= 1:2.6
BuildRequires: python-devel >= 1:2.6
BuildRequires: python-setuptools
+%if %{with tests}
+BuildRequires: python-markupsafe >= 0.9.2
+BuildRequires: python-mock
+BuildRequires: python-pytest
+%endif
%endif
%if %{with python3}
BuildRequires: python3 >= 1:3.3
BuildRequires: python3-devel >= 1:3.3
BuildRequires: python3-modules >= 1:3.3
BuildRequires: python3-setuptools
+%if %{with tests}
+BuildRequires: python3-markupsafe >= 0.9.2
+BuildRequires: python3-pytest
+%endif
%endif
BuildRequires: rpm-pythonprov
-BuildRequires: rpmbuild(macros) >= 1.710
+BuildRequires: rpmbuild(macros) >= 1.714
Requires: python-modules >= 1:2.6
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -59,16 +69,28 @@ Mako jest biblioteką szablonów napisaną w języku Python. Zapewnia
przyjazną, nie XML-ową składnię, która jest kompilowana do modułów
Pythona dla zwiększenia wydajności.
+%package doc
+Summary: Documentation for Python Mako module
+Summary(pl.UTF-8): Dokumentacja do modułu Pythona Mako
+Group: Documentation
+
+%description doc
+Documentation for Python Mako module.
+
+%description doc -l pl.UTF-8
+Dokumentacja do modułu Pythona Mako.
+
%prep
%setup -qn %{fname}-%{version}
+%patch0 -p1
%build
%if %{with python2}
-%py_build
+%py_build %{?with_tests:test}
%endif
%if %{with python3}
-%py3_build
+%py3_build %{?with_tests:test}
%endif
%install
@@ -115,3 +137,7 @@ rm -rf $RPM_BUILD_ROOT
%{py3_sitescriptdir}/mako
%{py3_sitescriptdir}/%{fname}-%{version}-py*.egg-info
%endif
+
+%files doc
+%defattr(644,root,root,755)
+%doc doc/{_static,*.html,*.js}
diff --git a/python-Mako-mock.patch b/python-Mako-mock.patch
new file mode 100644
index 0000000..abe094e
--- /dev/null
+++ b/python-Mako-mock.patch
@@ -0,0 +1,20 @@
+--- Mako-1.0.7/setup.py.orig 2017-07-13 18:12:05.000000000 +0200
++++ Mako-1.0.7/setup.py 2018-06-24 11:10:04.082459984 +0200
+@@ -47,6 +47,8 @@
+ sys.exit(errno)
+
+
++mock_deps = ["mock"] if sys.version_info < (3, 3) else []
++
+ setup(name='Mako',
+ version=VERSION,
+ description="A super-fast templating language that borrows the \
+@@ -68,7 +70,7 @@
+ url='http://www.makotemplates.org/',
+ license='MIT',
+ packages=find_packages('.', exclude=['examples*', 'test*']),
+- tests_require=['pytest', 'mock'],
++ tests_require=['pytest'] + mock_deps,
+ cmdclass={'test': PyTest},
+ zip_safe=False,
+ install_requires=install_requires,
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python-Mako.git/commitdiff/792a53ec00e89e3d5caa647dbc4ab171e08c03fd
More information about the pld-cvs-commit
mailing list