]> git.pld-linux.org Git - packages/python-testtools.git/blame - python-testtools.spec
rebuild with python 3.10
[packages/python-testtools.git] / python-testtools.spec
CommitLineData
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
8Summary: Extensions to the Python unit testing framework
0011d28a 9Summary(pl.UTF-8): Rozszerzenie szkieletu testów jednostkowych Pythona
aaa1c662 10Name: python-testtools
65dcb6f7
JB
11# keep 2.4.x here for python2 support
12Version: 2.4.0
07175385 13Release: 2
aaa1c662
ER
14License: MIT
15Group: Development/Tools
d839dbe8
JB
16#Source0Download: https://pypi.org/simple/testtools/
17Source0: https://files.pythonhosted.org/packages/source/t/testtools/testtools-%{version}.tar.gz
65dcb6f7 18# Source0-md5: e8fc7185b47cfb908c641f8c4b2a6add
ecce750f 19Patch0: %{name}-tests-nosource.patch
d839dbe8 20Patch1: %{name}-deps.patch
f4bc9067 21URL: https://github.com/testing-cabal/testtools
337b28ee 22%if %{with python2}
d839dbe8
JB
23BuildRequires: python-devel >= 1:2.7
24BuildRequires: python-pbr >= 0.11
f4bc9067 25BuildRequires: python-setuptools
0011d28a 26%if %{with tests}
d839dbe8
JB
27BuildRequires: python-devel-tools >= 1:2.7
28BuildRequires: python-extras >= 1.0.0
29BuildRequires: python-fixtures >= 1.3.0
0011d28a 30BuildRequires: python-mimeparse
18e5479a 31BuildRequires: python-modules
d839dbe8
JB
32BuildRequires: python-six >= 1.4.0
33BuildRequires: python-testresources
34BuildRequires: python-testscenarios
18e5479a 35BuildRequires: python-traceback2
d839dbe8 36BuildRequires: python-unittest2 >= 1.0.0
0011d28a 37%endif
337b28ee
JB
38%endif
39%if %{with python3}
d839dbe8
JB
40BuildRequires: python3-devel >= 1:3.3
41BuildRequires: python3-pbr >= 0.11
f4bc9067 42BuildRequires: python3-setuptools
337b28ee 43%if %{with tests}
d839dbe8
JB
44BuildRequires: python3-devel-tools >= 1:3.3
45BuildRequires: python3-extras >= 1.0.0
46BuildRequires: python3-fixtures >= 1.3.0
337b28ee 47BuildRequires: python3-mimeparse
d839dbe8
JB
48BuildRequires: python3-six >= 1.4.0
49BuildRequires: python3-testresources
50BuildRequires: python3-testscenarios
51%if "%{py3_ver}" < "3.5"
18e5479a 52BuildRequires: python3-traceback2
d839dbe8
JB
53BuildRequires: python3-unittest2 >= 1.0.0
54%endif
337b28ee
JB
55%endif
56%endif
f4bc9067 57BuildRequires: rpmbuild(macros) >= 1.714
d839dbe8 58BuildRequires: sed >= 4.0
337b28ee 59%{?with_doc:BuildRequires: sphinx-pdg}
aaa1c662
ER
60BuildArch: noarch
61BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
62
63%description
64testtools is a set of extensions to the Python standard library's unit
65testing framework.
66
0011d28a
JB
67%description -l pl.UTF-8
68testtools to zestaw rozszerzeń szkieletu testów jednostkowych z
69biblioteki standardowej Pythona.
70
337b28ee
JB
71%package -n python3-testtools
72Summary: Extensions to the Python unit testing framework
73Summary(pl.UTF-8): Rozszerzenie szkieletu testów jednostkowych Pythona
74Group: Development/Tools
337b28ee
JB
75
76%description -n python3-testtools
77testtools is a set of extensions to the Python standard library's unit
78testing framework.
79
80%description -n python3-testtools -l pl.UTF-8
81testtools to zestaw rozszerzeń szkieletu testów jednostkowych z
82biblioteki standardowej Pythona.
83
aaa1c662 84%package doc
d839dbe8
JB
85Summary: Documentation for Python testttools module
86Summary(pl.UTF-8): Dokumentacja do pakietu Pythona testttools
aaa1c662
ER
87Group: Documentation
88Requires: %{name} = %{version}-%{release}
89
90%description doc
d839dbe8 91This package contains HTML documentation for Python testttools module.
aaa1c662 92
0011d28a 93%description doc -l pl.UTF-8
d839dbe8 94Dokumentacja 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}
106PYTHONPATH=$(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}
115PYTHONPATH=$(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
125rm -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
134touch $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
149touch $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
155rm -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
This page took 0.703217 seconds and 4 git commands to generate.