]> git.pld-linux.org Git - packages/python-nose.git/blob - python-nose.spec
rebuild with python 3.10
[packages/python-nose.git] / python-nose.spec
1 #
2 # Conditional build:
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
7 #
8 %define         module  nose
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}
12 Version:        1.3.7
13 Release:        7
14 License:        LGPL v2.1
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/
20 %if %{with python2}
21 BuildRequires:  python-devel >= 1:2.5
22 BuildRequires:  python-devel-tools >= 1:2.5
23 BuildRequires:  python-setuptools >= 1:0.6-0.c5
24 %endif
25 %if %{with python3}
26 BuildRequires:  python3-2to3 >= 1:3.2
27 BuildRequires:  python3-devel >= 1:3.2
28 BuildRequires:  python3-setuptools
29 %endif
30 BuildRequires:  rpm-pythonprov
31 BuildRequires:  rpmbuild(macros) >= 1.714
32 %if %{with tests}
33 BuildRequires:  sphinx-pdg-2 >= 1.0
34 %endif
35 Requires:       python-devel-tools >= 1:2.5
36 BuildArch:      noarch
37 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38
39 %description
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
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.
54
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
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
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
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.
87
88 %prep
89 %setup -qn %{module}-%{version}
90
91 %build
92 %if %{with python2}
93 %py_build
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
102 %endif
103
104 %if %{with python3}
105 %py3_build
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}
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
125 %endif
126
127 %install
128 rm -rf $RPM_BUILD_ROOT
129
130 %if %{with python2}
131 %py_install
132
133 %py_postclean
134 %endif
135
136 %if %{with python3}
137 %py3_install
138 %endif
139
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
143 done
144
145 %if %{with python2}
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
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
153
154 %clean
155 rm -rf $RPM_BUILD_ROOT
156
157 %if %{with python2}
158 %files
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*
167 %endif
168
169 %if %{with python3}
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*
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}
187 %endif
This page took 0.094143 seconds and 3 git commands to generate.