]> git.pld-linux.org Git - packages/python-unittest2.git/blame - python-unittest2.spec
- does not build on python 3.10, tests are also flaky, rel 6
[packages/python-unittest2.git] / python-unittest2.spec
CommitLineData
9194026a
JB
1# NOTE: unittest2 1.1.0 is backport of unittest from cpython between 3.4.0/3.5.0
2# unittest from cpython>=3.5.0 seems more robust
4c16811f
JB
3#
4# Conditional build:
5%bcond_without python2 # CPython 2.x module
e110ba30
JR
6%bcond_with python3 # CPython 3.x module
7%bcond_with tests # test target
4c16811f
JB
8
9Summary: New features in unittest backported to older Python versions
10Summary(pl.UTF-8): Backport nowych funkcji modułu unittest do starszych wersji Pythona
11Name: python-unittest2
12Version: 1.1.0
e110ba30 13Release: 6
4c16811f
JB
14License: MIT
15Group: Development/Tools
9194026a
JB
16#Source0Download: https://pypi.org/simple/unittest2/
17Source0: https://files.pythonhosted.org/packages/source/u/unittest2/unittest2-%{version}.tar.gz
4c16811f 18# Source0-md5: f72dae5d44f091df36b6b513305ea000
9194026a 19URL: https://pypi.org/project/unittest2/
4c16811f
JB
20%if %{with python2}
21BuildRequires: python-devel >= 1:2.6
22BuildRequires: python-setuptools
3c2cb9aa 23BuildRequires: python-traceback2
4c16811f
JB
24%if %{with tests}
25%if "%{py_ver}" < "2.7"
26BuildRequires: python-argparse
27%endif
28BuildRequires: python-six >= 1.4
4c16811f
JB
29%endif
30%endif
31%if %{with python3}
32BuildRequires: python3-devel >= 1:3.2
33BuildRequires: python3-setuptools
3c2cb9aa 34BuildRequires: python3-traceback2
4c16811f
JB
35%if %{with tests}
36BuildRequires: python3-six >= 1.4
4c16811f
JB
37%endif
38%endif
39BuildRequires: rpmbuild(macros) >= 1.714
4c16811f
JB
40BuildArch: noarch
41BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
42
43%description
44unittest2 is a backport of the new features added to the unittest
45testing framework in Python 2.7 and onwards.
46
47%description -l pl.UTF-8
48unittest2 to backport nowych funkcji dodanych do szkieletu testów
49unittest w Pythonie 2.7 i nowszych.
50
51%package -n python3-unittest2
52Summary: New features in unittest backported to older Python versions
53Summary(pl.UTF-8): Backport nowych funkcji modułu unittest do starszych wersji Pythona
54Group: Development/Tools
4c16811f
JB
55
56%description -n python3-unittest2
57unittest2 is a backport of the new features added to the unittest
58testing framework in Python 2.7 and onwards.
59
60%description -n python3-unittest2 -l pl.UTF-8
61unittest2 to backport nowych funkcji dodanych do szkieletu testów
62unittest w Pythonie 2.7 i nowszych.
63
64%prep
65%setup -q -n unittest2-%{version}
66
67%if "%{py_ver}" >= "2.7"
68# argparse is in base distribution
69%{__sed} -i -e "/^REQUIRES/s@'argparse', @@" setup.py
70%endif
71
72%build
73%if %{with python2}
74%py_build %{?with_tests:test}
75%endif
76
77%if %{with python3}
78%py_build %{?with_tests:test}
79%endif
80
81%install
82rm -rf $RPM_BUILD_ROOT
83
84%if %{with python2}
85%py_install
86
87%{__mv} $RPM_BUILD_ROOT%{_bindir}/unit2{,-2}
88
89%py_postclean
90%{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/unittest2/test
91%endif
92
93%if %{with python3}
94%py3_install
95
96%{__mv} $RPM_BUILD_ROOT%{_bindir}/unit2{,-3}
97
98%{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/unittest2/test
99%endif
100
101%if %{with python2}
102ln -sf unit2-2 $RPM_BUILD_ROOT%{_bindir}/unit2
103%endif
104
105%clean
106rm -rf $RPM_BUILD_ROOT
107
108%if %{with python2}
109%files
110%defattr(644,root,root,755)
111%doc README.txt
112%attr(755,root,root) %{_bindir}/unit2
113%attr(755,root,root) %{_bindir}/unit2-2
114%dir %{py_sitescriptdir}/unittest2
115%{py_sitescriptdir}/unittest2/*.py[co]
116%{py_sitescriptdir}/unittest2-%{version}-py*.egg-info
117%endif
118
119%if %{with python3}
120%files -n python3-unittest2
121%defattr(644,root,root,755)
122%doc README.txt
123%attr(755,root,root) %{_bindir}/unit2-3
124%dir %{py3_sitescriptdir}/unittest2
125%{py3_sitescriptdir}/unittest2/*.py
126%{py3_sitescriptdir}/unittest2/__pycache__
127%{py3_sitescriptdir}/unittest2-%{version}-py*.egg-info
128%endif
This page took 0.166239 seconds and 4 git commands to generate.