]>
Commit | Line | Data |
---|---|---|
aaa1c662 ER |
1 | # |
2 | # Conditional build: | |
337b28ee JB |
3 | %bcond_without doc # HTML (sphinx-based) documentation |
4 | %bcond_without python2 # CPython 2.x module | |
5 | %bcond_without python3 # CPython 3.x module | |
6 | %bcond_without tests # do not perform tests | |
aaa1c662 ER |
7 | |
8 | Summary: Extensions to the Python unit testing framework | |
0011d28a | 9 | Summary(pl.UTF-8): Rozszerzenie szkieletu testów jednostkowych Pythona |
aaa1c662 | 10 | Name: python-testtools |
65dcb6f7 JB |
11 | # keep 2.4.x here for python2 support |
12 | Version: 2.4.0 | |
07175385 | 13 | Release: 2 |
aaa1c662 ER |
14 | License: MIT |
15 | Group: Development/Tools | |
d839dbe8 JB |
16 | #Source0Download: https://pypi.org/simple/testtools/ |
17 | Source0: https://files.pythonhosted.org/packages/source/t/testtools/testtools-%{version}.tar.gz | |
65dcb6f7 | 18 | # Source0-md5: e8fc7185b47cfb908c641f8c4b2a6add |
ecce750f | 19 | Patch0: %{name}-tests-nosource.patch |
d839dbe8 | 20 | Patch1: %{name}-deps.patch |
f4bc9067 | 21 | URL: https://github.com/testing-cabal/testtools |
337b28ee | 22 | %if %{with python2} |
d839dbe8 JB |
23 | BuildRequires: python-devel >= 1:2.7 |
24 | BuildRequires: python-pbr >= 0.11 | |
f4bc9067 | 25 | BuildRequires: python-setuptools |
0011d28a | 26 | %if %{with tests} |
d839dbe8 JB |
27 | BuildRequires: python-devel-tools >= 1:2.7 |
28 | BuildRequires: python-extras >= 1.0.0 | |
29 | BuildRequires: python-fixtures >= 1.3.0 | |
0011d28a | 30 | BuildRequires: python-mimeparse |
18e5479a | 31 | BuildRequires: python-modules |
d839dbe8 JB |
32 | BuildRequires: python-six >= 1.4.0 |
33 | BuildRequires: python-testresources | |
34 | BuildRequires: python-testscenarios | |
18e5479a | 35 | BuildRequires: python-traceback2 |
d839dbe8 | 36 | BuildRequires: python-unittest2 >= 1.0.0 |
0011d28a | 37 | %endif |
337b28ee JB |
38 | %endif |
39 | %if %{with python3} | |
d839dbe8 JB |
40 | BuildRequires: python3-devel >= 1:3.3 |
41 | BuildRequires: python3-pbr >= 0.11 | |
f4bc9067 | 42 | BuildRequires: python3-setuptools |
337b28ee | 43 | %if %{with tests} |
d839dbe8 JB |
44 | BuildRequires: python3-devel-tools >= 1:3.3 |
45 | BuildRequires: python3-extras >= 1.0.0 | |
46 | BuildRequires: python3-fixtures >= 1.3.0 | |
337b28ee | 47 | BuildRequires: python3-mimeparse |
d839dbe8 JB |
48 | BuildRequires: python3-six >= 1.4.0 |
49 | BuildRequires: python3-testresources | |
50 | BuildRequires: python3-testscenarios | |
51 | %if "%{py3_ver}" < "3.5" | |
18e5479a | 52 | BuildRequires: python3-traceback2 |
d839dbe8 JB |
53 | BuildRequires: python3-unittest2 >= 1.0.0 |
54 | %endif | |
337b28ee JB |
55 | %endif |
56 | %endif | |
f4bc9067 | 57 | BuildRequires: rpmbuild(macros) >= 1.714 |
d839dbe8 | 58 | BuildRequires: sed >= 4.0 |
337b28ee | 59 | %{?with_doc:BuildRequires: sphinx-pdg} |
aaa1c662 ER |
60 | BuildArch: noarch |
61 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
62 | ||
63 | %description | |
64 | testtools is a set of extensions to the Python standard library's unit | |
65 | testing framework. | |
66 | ||
0011d28a JB |
67 | %description -l pl.UTF-8 |
68 | testtools to zestaw rozszerzeń szkieletu testów jednostkowych z | |
69 | biblioteki standardowej Pythona. | |
70 | ||
337b28ee JB |
71 | %package -n python3-testtools |
72 | Summary: Extensions to the Python unit testing framework | |
73 | Summary(pl.UTF-8): Rozszerzenie szkieletu testów jednostkowych Pythona | |
74 | Group: Development/Tools | |
337b28ee JB |
75 | |
76 | %description -n python3-testtools | |
77 | testtools is a set of extensions to the Python standard library's unit | |
78 | testing framework. | |
79 | ||
80 | %description -n python3-testtools -l pl.UTF-8 | |
81 | testtools to zestaw rozszerzeń szkieletu testów jednostkowych z | |
82 | biblioteki standardowej Pythona. | |
83 | ||
aaa1c662 | 84 | %package doc |
d839dbe8 JB |
85 | Summary: Documentation for Python testttools module |
86 | Summary(pl.UTF-8): Dokumentacja do pakietu Pythona testttools | |
aaa1c662 ER |
87 | Group: Documentation |
88 | Requires: %{name} = %{version}-%{release} | |
89 | ||
90 | %description doc | |
d839dbe8 | 91 | This package contains HTML documentation for Python testttools module. |
aaa1c662 | 92 | |
0011d28a | 93 | %description doc -l pl.UTF-8 |
d839dbe8 | 94 | Dokumentacja HTML do pakietu Pythona testttools. |
0011d28a | 95 | |
aaa1c662 ER |
96 | %prep |
97 | %setup -q -n testtools-%{version} | |
ecce750f | 98 | %patch0 -p1 |
d839dbe8 | 99 | %patch1 -p1 |
aaa1c662 ER |
100 | |
101 | %build | |
337b28ee | 102 | %if %{with python2} |
a3d231f0 JB |
103 | %py_build |
104 | ||
105 | %if %{with tests} | |
106 | PYTHONPATH=$(pwd) \ | |
107 | %{__python} -m testtools.run testtools.tests.test_suite | |
108 | %endif | |
337b28ee | 109 | %endif |
aaa1c662 | 110 | |
337b28ee | 111 | %if %{with python3} |
a3d231f0 JB |
112 | %py3_build |
113 | ||
114 | %if %{with tests} | |
115 | PYTHONPATH=$(pwd) \ | |
116 | %{__python3} -m testtools.run testtools.tests.test_suite | |
117 | %endif | |
337b28ee JB |
118 | %endif |
119 | ||
120 | %if %{with doc} | |
121 | %{__make} -C doc html | |
aaa1c662 ER |
122 | %endif |
123 | ||
124 | %install | |
125 | rm -rf $RPM_BUILD_ROOT | |
aaa1c662 | 126 | |
337b28ee | 127 | %if %{with python2} |
ee01c435 | 128 | %py_install |
aaa1c662 | 129 | |
d839dbe8 JB |
130 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/testtools/tests/{matchers,twistedsupport} |
131 | %{__rm} $RPM_BUILD_ROOT%{py_sitescriptdir}/testtools/tests/{__init__,samplecases,test_*}.py* | |
132 | ||
133 | # replace selftests __init__ by empty stub | |
134 | touch $RPM_BUILD_ROOT%{py_sitescriptdir}/testtools/tests/__init__.py | |
135 | %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}/testtools/tests | |
136 | %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}/testtools/tests | |
137 | ||
aaa1c662 | 138 | %py_postclean |
337b28ee JB |
139 | %endif |
140 | ||
141 | %if %{with python3} | |
ee01c435 | 142 | %py3_install |
337b28ee | 143 | |
d839dbe8 JB |
144 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/testtools/tests/{matchers,twistedsupport} |
145 | %{__rm} $RPM_BUILD_ROOT%{py3_sitescriptdir}/testtools/tests/{__init__,samplecases,test_*}.py* \ | |
146 | $RPM_BUILD_ROOT%{py3_sitescriptdir}/testtools/tests/__pycache__/{__init__,samplecases,test_*}.*.py* | |
147 | ||
148 | # replace selftests __init__ by empty stub | |
149 | touch $RPM_BUILD_ROOT%{py3_sitescriptdir}/testtools/tests/__init__.py | |
150 | %py3_comp $RPM_BUILD_ROOT%{py3_sitescriptdir}/testtools/tests | |
151 | %py3_ocomp $RPM_BUILD_ROOT%{py3_sitescriptdir}/testtools/tests | |
337b28ee | 152 | %endif |
aaa1c662 ER |
153 | |
154 | %clean | |
155 | rm -rf $RPM_BUILD_ROOT | |
156 | ||
337b28ee | 157 | %if %{with python2} |
aaa1c662 ER |
158 | %files |
159 | %defattr(644,root,root,755) | |
d839dbe8 | 160 | %doc AUTHORS ChangeLog LICENSE NEWS README.rst |
00bf0c3b | 161 | %dir %{py_sitescriptdir}/testtools |
aaa1c662 | 162 | %{py_sitescriptdir}/testtools/*.py[co] |
18e5479a AM |
163 | %{py_sitescriptdir}/testtools/matchers |
164 | %{py_sitescriptdir}/testtools/testresult | |
165 | %{py_sitescriptdir}/testtools/tests | |
166 | %{py_sitescriptdir}/testtools/twistedsupport | |
0011d28a | 167 | %{py_sitescriptdir}/testtools-%{version}-py*.egg-info |
337b28ee JB |
168 | %endif |
169 | ||
170 | %if %{with python3} | |
171 | %files -n python3-testtools | |
172 | %defattr(644,root,root,755) | |
d839dbe8 | 173 | %doc AUTHORS ChangeLog LICENSE NEWS README.rst |
337b28ee JB |
174 | %dir %{py3_sitescriptdir}/testtools |
175 | %{py3_sitescriptdir}/testtools/*.py | |
176 | %{py3_sitescriptdir}/testtools/__pycache__ | |
18e5479a AM |
177 | %{py3_sitescriptdir}/testtools/matchers |
178 | %{py3_sitescriptdir}/testtools/testresult | |
179 | %{py3_sitescriptdir}/testtools/tests | |
180 | %{py3_sitescriptdir}/testtools/twistedsupport | |
337b28ee JB |
181 | %{py3_sitescriptdir}/testtools-%{version}-py*.egg-info |
182 | %endif | |
aaa1c662 | 183 | |
337b28ee | 184 | %if %{with doc} |
aaa1c662 ER |
185 | %files doc |
186 | %defattr(644,root,root,755) | |
187 | %doc doc/_build/html/* | |
337b28ee | 188 | %endif |