[packages/python-nose] - run tests, added -doc; release 4

qboosh qboosh at pld-linux.org
Sun Jul 15 12:41:49 CEST 2018


commit a3eec9729b6cbb536b211ec4a417d8d65a6bbbcb
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Jul 15 12:43:38 2018 +0200

    - run tests, added -doc; release 4

 python-nose.spec | 70 +++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 62 insertions(+), 8 deletions(-)
---
diff --git a/python-nose.spec b/python-nose.spec
index 377a5da..c492e0a 100644
--- a/python-nose.spec
+++ b/python-nose.spec
@@ -2,26 +2,36 @@
 # Conditional build:
 %bcond_without	python2	# CPython 2.x module
 %bcond_without	python3	# CPython 3.x module
+%bcond_without	doc	# Sphinx documentation
+%bcond_without	tests	# unit tests
 #
 %define		module	nose
 Summary:	A unittest extension with automatic discovery, simplified authoring, and output capture
 Summary(pl.UTF-8):	Rozszerzenie testów jednostkowych z automatycznym wykrywaniem, prostym tworzeniem i przechwytywaniem wyjścia
 Name:		python-%{module}
 Version:	1.3.7
-Release:	3
+Release:	4
 License:	LGPL v2.1
 Group:		Libraries/Python
-#Source0Download:	https://pypi.python.org/pypi/nose
-Source0:	https://pypi.python.org/packages/source/n/nose/%{module}-%{version}.tar.gz
+#Source0Download: https://pypi.org/simple/nose/
+Source0:	https://files.pythonhosted.org/packages/source/n/nose/%{module}-%{version}.tar.gz
 # Source0-md5:	4d3ad0ff07b61373d2cefc89c5d0b20b
-URL:		https://pypi.python.org/pypi/nose
+URL:		https://pypi.org/project/nose/
+%if %{with python2}
 BuildRequires:	python-devel >= 1:2.5
 BuildRequires:	python-devel-tools >= 1:2.5
 BuildRequires:	python-setuptools >= 0.6-0.c5
-BuildRequires:	python3-devel
+%endif
+%if %{with python3}
+BuildRequires:	python3-2to3 >= 1:3.2
+BuildRequires:	python3-devel >= 1:3.2
 BuildRequires:	python3-setuptools
+%endif
 BuildRequires:	rpm-pythonprov
 BuildRequires:	rpmbuild(macros) >= 1.714
+%if %{with tests}
+BuildRequires:	sphinx-pdg >= 1.0
+%endif
 Requires:	python-devel-tools >= 1:2.5
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -46,7 +56,7 @@ opcjonalnie przedstawia raport pokrycia testów.
 Summary:	A unittest extension with automatic discovery, simplified authoring, and output capture
 Summary(pl.UTF-8):	Rozszerzenie testów jednostkowych z automatycznym wykrywaniem, prostym tworzeniem i przechwytywaniem wyjścia
 Group:		Libraries/Python
-Requires:	python3-devel-tools
+Requires:	python3-devel-tools >= 1:3.2
 
 %description -n python3-%{module}
 nose provides an alternate test discovery and running process for
@@ -64,18 +74,52 @@ uruchamia testy z tych plików lub katalogów od bieżącego katalogu,
 których nazwa zawiera "test". Obsługuje także testy doctest i
 opcjonalnie przedstawia raport pokrycia testów.
 
-%define	_duplicate_files_terminate_build	0
+%package doc
+Summary:	Usage and API documentation for Python nose module
+Summary(pl.UTF-8):	Dokumentacja użytkowa i API modułu Pythona nose
+Group:		Documentation
+
+%description doc
+Usage and API documentation for Python nose module.
+
+%description doc -l pl.UTF-8
+Dokumentacja użytkowa i API modułu Pythona nose.
 
 %prep
 %setup -qn %{module}-%{version}
 
 %build
-%if %{with pyhton2}
+%if %{with python2}
 %py_build
+
+%if %{with tests}
+cd build-2
+cp -pr ../unit_tests .
+PYTHONPATH=$(pwd)/lib \
+%{__python} -m nose unit_tests
+cd ..
+%endif
 %endif
 
 %if %{with python3}
 %py3_build
+
+%if %{with tests}
+cd build-3
+cp -pr ../unit_tests .
+2to3-%{py3_ver} -w -n --no-diffs unit_tests
+# as of nose 1.3.7/python 3.7.0 test_xunit fails with:
+# AssertionError: 'test_xunit.mktest.<locals>.TC' != 'test_xunit.TC'
+%{__rm} unit_tests/test_xunit.py
+
+PYTHONPATH=$(pwd)/lib \
+%{__python3} -m nose unit_tests
+cd ..
+%endif
+%endif
+
+%if %{with doc}
+%{__make} -C doc html
 %endif
 
 %install
@@ -128,4 +172,14 @@ rm -rf $RPM_BUILD_ROOT
 %{py3_sitescriptdir}/%{module}
 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
 %{_mandir}/man1/nosetests-%{py3_ver}.1*
+%if %{without python2}
+%attr(755,root,root) %{_bindir}/nosetests
+%{_mandir}/man1/nosetests.1*
+%endif
+%endif
+
+%if %{with doc}
+%files doc
+%defattr(644,root,root,755)
+%doc doc/.build/html/{_static,api,plugins,*.html,*.js}
 %endif
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-nose.git/commitdiff/a3eec9729b6cbb536b211ec4a417d8d65a6bbbcb



More information about the pld-cvs-commit mailing list