]>
Commit | Line | Data |
---|---|---|
b712a5fd JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # CPython 2.x module | |
4 | %bcond_without python3 # CPython 3.x module | |
a3eec972 JB |
5 | %bcond_without doc # Sphinx documentation |
6 | %bcond_without tests # unit tests | |
b712a5fd | 7 | # |
4152e925 JB |
8 | %define module nose |
9 | Summary: A unittest extension with automatic discovery, simplified authoring, and output capture | |
17f3e186 | 10 | Summary(pl.UTF-8): Rozszerzenie testów jednostkowych z automatycznym wykrywaniem, prostym tworzeniem i przechwytywaniem wyjścia |
7a4b823d | 11 | Name: python-%{module} |
b712a5fd | 12 | Version: 1.3.7 |
87e9203f | 13 | Release: 7 |
47e2afb6 | 14 | License: LGPL v2.1 |
4152e925 | 15 | Group: Libraries/Python |
a3eec972 JB |
16 | #Source0Download: https://pypi.org/simple/nose/ |
17 | Source0: https://files.pythonhosted.org/packages/source/n/nose/%{module}-%{version}.tar.gz | |
b712a5fd | 18 | # Source0-md5: 4d3ad0ff07b61373d2cefc89c5d0b20b |
a3eec972 JB |
19 | URL: https://pypi.org/project/nose/ |
20 | %if %{with python2} | |
47e2afb6 | 21 | BuildRequires: python-devel >= 1:2.5 |
57dece19 | 22 | BuildRequires: python-devel-tools >= 1:2.5 |
9375bd70 | 23 | BuildRequires: python-setuptools >= 1:0.6-0.c5 |
a3eec972 JB |
24 | %endif |
25 | %if %{with python3} | |
26 | BuildRequires: python3-2to3 >= 1:3.2 | |
27 | BuildRequires: python3-devel >= 1:3.2 | |
b712a5fd | 28 | BuildRequires: python3-setuptools |
a3eec972 | 29 | %endif |
4152e925 | 30 | BuildRequires: rpm-pythonprov |
b712a5fd | 31 | BuildRequires: rpmbuild(macros) >= 1.714 |
a3eec972 | 32 | %if %{with tests} |
8da6a811 | 33 | BuildRequires: sphinx-pdg-2 >= 1.0 |
a3eec972 | 34 | %endif |
47e2afb6 | 35 | Requires: python-devel-tools >= 1:2.5 |
4152e925 | 36 | BuildArch: noarch |
7a4b823d | 37 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
38 | ||
39 | %description | |
4152e925 JB |
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. | |
46 | ||
dc177ea3 JR |
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. | |
7a4b823d | 54 | |
47e2afb6 JB |
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 | |
4d98eb48 | 58 | Group: Libraries/Python |
a3eec972 | 59 | Requires: python3-devel-tools >= 1:3.2 |
4d98eb48 | 60 | |
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. | |
68 | ||
47e2afb6 JB |
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. | |
76 | ||
a3eec972 JB |
77 | %package doc |
78 | Summary: Usage and API documentation for Python nose module | |
79 | Summary(pl.UTF-8): Dokumentacja użytkowa i API modułu Pythona nose | |
80 | Group: Documentation | |
81 | ||
82 | %description doc | |
83 | Usage and API documentation for Python nose module. | |
84 | ||
85 | %description doc -l pl.UTF-8 | |
86 | Dokumentacja użytkowa i API modułu Pythona nose. | |
d5647e41 | 87 | |
7a4b823d | 88 | %prep |
89 | %setup -qn %{module}-%{version} | |
90 | ||
91 | %build | |
a3eec972 | 92 | %if %{with python2} |
b712a5fd | 93 | %py_build |
a3eec972 JB |
94 | |
95 | %if %{with tests} | |
96 | cd build-2 | |
97 | cp -pr ../unit_tests . | |
98 | PYTHONPATH=$(pwd)/lib \ | |
99 | %{__python} -m nose unit_tests | |
100 | cd .. | |
101 | %endif | |
b712a5fd JB |
102 | %endif |
103 | ||
104 | %if %{with python3} | |
105 | %py3_build | |
a3eec972 JB |
106 | |
107 | %if %{with tests} | |
108 | cd build-3 | |
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 | |
114 | ||
115 | PYTHONPATH=$(pwd)/lib \ | |
116 | %{__python3} -m nose unit_tests | |
117 | cd .. | |
118 | %endif | |
119 | %endif | |
120 | ||
121 | %if %{with doc} | |
8da6a811 JB |
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 | |
b712a5fd | 125 | %endif |
552ed67c | 126 | |
7a4b823d | 127 | %install |
128 | rm -rf $RPM_BUILD_ROOT | |
129 | ||
b712a5fd JB |
130 | %if %{with python2} |
131 | %py_install | |
132 | ||
133 | %py_postclean | |
134 | %endif | |
4d98eb48 | 135 | |
b712a5fd JB |
136 | %if %{with python3} |
137 | %py3_install | |
138 | %endif | |
4152e925 | 139 | |
b712a5fd | 140 | %{__mv} $RPM_BUILD_ROOT%{_prefix}/man $RPM_BUILD_ROOT%{_datadir} |
47e2afb6 JB |
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 | |
143 | done | |
144 | ||
b712a5fd | 145 | %if %{with python2} |
47e2afb6 JB |
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 | |
b712a5fd JB |
149 | %else |
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 | |
152 | %endif | |
4152e925 | 153 | |
7a4b823d | 154 | %clean |
155 | rm -rf $RPM_BUILD_ROOT | |
156 | ||
b712a5fd | 157 | %if %{with python2} |
7a4b823d | 158 | %files |
159 | %defattr(644,root,root,755) | |
47e2afb6 JB |
160 | %doc AUTHORS CHANGELOG NEWS README.txt |
161 | %attr(755,root,root) %{_bindir}/nosetests-%{py_ver} | |
162 | %attr(755,root,root) %{_bindir}/nosetests | |
7a4b823d | 163 | %{py_sitescriptdir}/%{module} |
7502f64b | 164 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info |
47e2afb6 JB |
165 | %{_mandir}/man1/nosetests-%{py_ver}.1* |
166 | %{_mandir}/man1/nosetests.1* | |
b712a5fd | 167 | %endif |
4d98eb48 | 168 | |
b712a5fd | 169 | %if %{with python3} |
4d98eb48 | 170 | %files -n python3-%{module} |
171 | %defattr(644,root,root,755) | |
b712a5fd | 172 | %doc AUTHORS CHANGELOG NEWS README.txt |
47e2afb6 | 173 | %attr(755,root,root) %{_bindir}/nosetests-%{py3_ver} |
4d98eb48 | 174 | %{py3_sitescriptdir}/%{module} |
175 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
47e2afb6 | 176 | %{_mandir}/man1/nosetests-%{py3_ver}.1* |
a3eec972 JB |
177 | %if %{without python2} |
178 | %attr(755,root,root) %{_bindir}/nosetests | |
179 | %{_mandir}/man1/nosetests.1* | |
180 | %endif | |
181 | %endif | |
182 | ||
183 | %if %{with doc} | |
184 | %files doc | |
185 | %defattr(644,root,root,755) | |
186 | %doc doc/.build/html/{_static,api,plugins,*.html,*.js} | |
b712a5fd | 187 | %endif |