]> git.pld-linux.org Git - packages/python-nose.git/blame - python-nose.spec
rebuild with python 3.10
[packages/python-nose.git] / python-nose.spec
CommitLineData
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
9Summary: A unittest extension with automatic discovery, simplified authoring, and output capture
17f3e186 10Summary(pl.UTF-8): Rozszerzenie testów jednostkowych z automatycznym wykrywaniem, prostym tworzeniem i przechwytywaniem wyjścia
7a4b823d 11Name: python-%{module}
b712a5fd 12Version: 1.3.7
87e9203f 13Release: 7
47e2afb6 14License: LGPL v2.1
4152e925 15Group: Libraries/Python
a3eec972
JB
16#Source0Download: https://pypi.org/simple/nose/
17Source0: https://files.pythonhosted.org/packages/source/n/nose/%{module}-%{version}.tar.gz
b712a5fd 18# Source0-md5: 4d3ad0ff07b61373d2cefc89c5d0b20b
a3eec972
JB
19URL: https://pypi.org/project/nose/
20%if %{with python2}
47e2afb6 21BuildRequires: python-devel >= 1:2.5
57dece19 22BuildRequires: python-devel-tools >= 1:2.5
9375bd70 23BuildRequires: python-setuptools >= 1:0.6-0.c5
a3eec972
JB
24%endif
25%if %{with python3}
26BuildRequires: python3-2to3 >= 1:3.2
27BuildRequires: python3-devel >= 1:3.2
b712a5fd 28BuildRequires: python3-setuptools
a3eec972 29%endif
4152e925 30BuildRequires: rpm-pythonprov
b712a5fd 31BuildRequires: rpmbuild(macros) >= 1.714
a3eec972 32%if %{with tests}
8da6a811 33BuildRequires: sphinx-pdg-2 >= 1.0
a3eec972 34%endif
47e2afb6 35Requires: python-devel-tools >= 1:2.5
4152e925 36BuildArch: noarch
7a4b823d 37BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38
39%description
4152e925
JB
40nose provides an alternate test discovery and running process for
41unittest, one that is intended to mimic the behavior of py.test as
42much as is reasonably possible without resorting to magic. By default,
43nose will run tests in files or directories under the current working
44directory whose names include "test". nose also supports doctest tests
45and may optionally provide a test coverage report.
46
dc177ea3
JR
47%description -l pl.UTF-8
48nose dostarcza alternatywny proces wykrywania i uruchamiania testów
49dla testów jednostkowych (unittest), mający przypominać zachowanie
50py.test na ile to możliwe bez uciekania się do magii. Domyślnie nose
51uruchamia testy z tych plików lub katalogów od bieżącego katalogu,
52których nazwa zawiera "test". Obsługuje także testy doctest i
53opcjonalnie przedstawia raport pokrycia testów.
7a4b823d 54
47e2afb6
JB
55%package -n python3-%{module}
56Summary: A unittest extension with automatic discovery, simplified authoring, and output capture
57Summary(pl.UTF-8): Rozszerzenie testów jednostkowych z automatycznym wykrywaniem, prostym tworzeniem i przechwytywaniem wyjścia
4d98eb48 58Group: Libraries/Python
a3eec972 59Requires: python3-devel-tools >= 1:3.2
4d98eb48 60
61%description -n python3-%{module}
62nose provides an alternate test discovery and running process for
63unittest, one that is intended to mimic the behavior of py.test as
64much as is reasonably possible without resorting to magic. By default,
65nose will run tests in files or directories under the current working
66directory whose names include "test". nose also supports doctest tests
67and may optionally provide a test coverage report.
68
47e2afb6
JB
69%description -n python3-%{module} -l pl.UTF-8
70nose dostarcza alternatywny proces wykrywania i uruchamiania testów
71dla testów jednostkowych (unittest), mający przypominać zachowanie
72py.test na ile to możliwe bez uciekania się do magii. Domyślnie nose
73uruchamia testy z tych plików lub katalogów od bieżącego katalogu,
74których nazwa zawiera "test". Obsługuje także testy doctest i
75opcjonalnie przedstawia raport pokrycia testów.
76
a3eec972
JB
77%package doc
78Summary: Usage and API documentation for Python nose module
79Summary(pl.UTF-8): Dokumentacja użytkowa i API modułu Pythona nose
80Group: Documentation
81
82%description doc
83Usage and API documentation for Python nose module.
84
85%description doc -l pl.UTF-8
86Dokumentacja 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}
96cd build-2
97cp -pr ../unit_tests .
98PYTHONPATH=$(pwd)/lib \
99%{__python} -m nose unit_tests
100cd ..
101%endif
b712a5fd
JB
102%endif
103
104%if %{with python3}
105%py3_build
a3eec972
JB
106
107%if %{with tests}
108cd build-3
109cp -pr ../unit_tests .
1102to3-%{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
115PYTHONPATH=$(pwd)/lib \
116%{__python3} -m nose unit_tests
117cd ..
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
128rm -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
141for 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
143done
144
b712a5fd 145%if %{with python2}
47e2afb6
JB
146# default to python2 for now
147ln -sf nosetests-%{py_ver} $RPM_BUILD_ROOT%{_bindir}/nosetests
148echo '.so nosetests-%{py_ver}.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nosetests.1
b712a5fd
JB
149%else
150ln -sf nosetests-%{py3_ver} $RPM_BUILD_ROOT%{_bindir}/nosetests
151echo '.so nosetests-%{py3_ver}.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nosetests.1
152%endif
4152e925 153
7a4b823d 154%clean
155rm -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
This page took 0.107091 seconds and 4 git commands to generate.