3 %bcond_without python2 # CPython 2.x module
4 %bcond_without python3 # CPython 3.x module
5 %bcond_without doc # Sphinx documentation
6 %bcond_without tests # unit tests
9 Summary: A unittest extension with automatic discovery, simplified authoring, and output capture
10 Summary(pl.UTF-8): Rozszerzenie testów jednostkowych z automatycznym wykrywaniem, prostym tworzeniem i przechwytywaniem wyjścia
11 Name: python-%{module}
15 Group: Libraries/Python
16 #Source0Download: https://pypi.org/simple/nose/
17 Source0: https://files.pythonhosted.org/packages/source/n/nose/%{module}-%{version}.tar.gz
18 # Source0-md5: 4d3ad0ff07b61373d2cefc89c5d0b20b
19 URL: https://pypi.org/project/nose/
21 BuildRequires: python-devel >= 1:2.5
22 BuildRequires: python-devel-tools >= 1:2.5
23 BuildRequires: python-setuptools >= 1:0.6-0.c5
26 BuildRequires: python3-2to3 >= 1:3.2
27 BuildRequires: python3-devel >= 1:3.2
28 BuildRequires: python3-setuptools
30 BuildRequires: rpm-pythonprov
31 BuildRequires: rpmbuild(macros) >= 1.714
33 BuildRequires: sphinx-pdg-2 >= 1.0
35 Requires: python-devel-tools >= 1:2.5
37 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40 nose provides an alternate test discovery and running process for
41 unittest, one that is intended to mimic the behavior of py.test as
42 much as is reasonably possible without resorting to magic. By default,
43 nose will run tests in files or directories under the current working
44 directory whose names include "test". nose also supports doctest tests
45 and may optionally provide a test coverage report.
47 %description -l pl.UTF-8
48 nose dostarcza alternatywny proces wykrywania i uruchamiania testów
49 dla testów jednostkowych (unittest), mający przypominać zachowanie
50 py.test na ile to możliwe bez uciekania się do magii. Domyślnie nose
51 uruchamia testy z tych plików lub katalogów od bieżącego katalogu,
52 których nazwa zawiera "test". Obsługuje także testy doctest i
53 opcjonalnie przedstawia raport pokrycia testów.
55 %package -n python3-%{module}
56 Summary: A unittest extension with automatic discovery, simplified authoring, and output capture
57 Summary(pl.UTF-8): Rozszerzenie testów jednostkowych z automatycznym wykrywaniem, prostym tworzeniem i przechwytywaniem wyjścia
58 Group: Libraries/Python
59 Requires: python3-devel-tools >= 1:3.2
61 %description -n python3-%{module}
62 nose provides an alternate test discovery and running process for
63 unittest, one that is intended to mimic the behavior of py.test as
64 much as is reasonably possible without resorting to magic. By default,
65 nose will run tests in files or directories under the current working
66 directory whose names include "test". nose also supports doctest tests
67 and may optionally provide a test coverage report.
69 %description -n python3-%{module} -l pl.UTF-8
70 nose dostarcza alternatywny proces wykrywania i uruchamiania testów
71 dla testów jednostkowych (unittest), mający przypominać zachowanie
72 py.test na ile to możliwe bez uciekania się do magii. Domyślnie nose
73 uruchamia testy z tych plików lub katalogów od bieżącego katalogu,
74 których nazwa zawiera "test". Obsługuje także testy doctest i
75 opcjonalnie przedstawia raport pokrycia testów.
78 Summary: Usage and API documentation for Python nose module
79 Summary(pl.UTF-8): Dokumentacja użytkowa i API modułu Pythona nose
83 Usage and API documentation for Python nose module.
85 %description doc -l pl.UTF-8
86 Dokumentacja użytkowa i API modułu Pythona nose.
89 %setup -qn %{module}-%{version}
97 cp -pr ../unit_tests .
98 PYTHONPATH=$(pwd)/lib \
99 %{__python} -m nose unit_tests
109 cp -pr ../unit_tests .
110 2to3-%{py3_ver} -w -n --no-diffs unit_tests
111 # as of nose 1.3.7/python 3.7.0 test_xunit fails with:
112 # AssertionError: 'test_xunit.mktest.<locals>.TC' != 'test_xunit.TC'
113 %{__rm} unit_tests/test_xunit.py
115 PYTHONPATH=$(pwd)/lib \
116 %{__python3} -m nose unit_tests
122 # force python 2: sources are in python2 syntax (2to3 would be required for sphinx-build-3)
123 %{__make} -C doc html \
124 SPHINXBUILD=sphinx-build-2
128 rm -rf $RPM_BUILD_ROOT
140 %{__mv} $RPM_BUILD_ROOT%{_prefix}/man $RPM_BUILD_ROOT%{_datadir}
141 for v in %{py_ver} %{py3_ver} ; do
142 cp -p $RPM_BUILD_ROOT%{_mandir}/man1/nosetests.1 $RPM_BUILD_ROOT%{_mandir}/man1/nosetests-${v}.1
146 # default to python2 for now
147 ln -sf nosetests-%{py_ver} $RPM_BUILD_ROOT%{_bindir}/nosetests
148 echo '.so nosetests-%{py_ver}.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nosetests.1
150 ln -sf nosetests-%{py3_ver} $RPM_BUILD_ROOT%{_bindir}/nosetests
151 echo '.so nosetests-%{py3_ver}.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nosetests.1
155 rm -rf $RPM_BUILD_ROOT
159 %defattr(644,root,root,755)
160 %doc AUTHORS CHANGELOG NEWS README.txt
161 %attr(755,root,root) %{_bindir}/nosetests-%{py_ver}
162 %attr(755,root,root) %{_bindir}/nosetests
163 %{py_sitescriptdir}/%{module}
164 %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
165 %{_mandir}/man1/nosetests-%{py_ver}.1*
166 %{_mandir}/man1/nosetests.1*
170 %files -n python3-%{module}
171 %defattr(644,root,root,755)
172 %doc AUTHORS CHANGELOG NEWS README.txt
173 %attr(755,root,root) %{_bindir}/nosetests-%{py3_ver}
174 %{py3_sitescriptdir}/%{module}
175 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
176 %{_mandir}/man1/nosetests-%{py3_ver}.1*
177 %if %{without python2}
178 %attr(755,root,root) %{_bindir}/nosetests
179 %{_mandir}/man1/nosetests.1*
185 %defattr(644,root,root,755)
186 %doc doc/.build/html/{_static,api,plugins,*.html,*.js}