]>
Commit | Line | Data |
---|---|---|
c129f656 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # CPython 2.x module | |
4 | %bcond_without python3 # CPython 3.x module | |
5 | ||
6 | Summary: Test discovery for unittest (backport from Python 2.7) | |
7 | Summary(pl.UTF-8): Wykrywanie testów dla modułu unittest (backport z Pythona 2.7) | |
8 | Name: python-discover | |
9 | Version: 0.4.0 | |
6bded4a9 | 10 | Release: 5 |
77a2a3fe | 11 | License: BSD |
c129f656 | 12 | Group: Development/Languages/Python |
3a656ac9 JB |
13 | #Source0Download: https://pypi.org/simple/discover/ |
14 | Source0: https://files.pythonhosted.org/packages/source/d/discover/discover-%{version}.tar.gz | |
c129f656 | 15 | # Source0-md5: 30bb643af4f5ea47fff572b5c346207d |
3a656ac9 | 16 | URL: https://pypi.org/project/discover/ |
c129f656 JB |
17 | BuildRequires: rpm-pythonprov |
18 | BuildRequires: rpmbuild(macros) >= 1.714 | |
19 | %if %{with python2} | |
20 | BuildRequires: python-devel >= 1:2.4 | |
21 | %endif | |
22 | %if %{with python3} | |
23 | BuildRequires: python3-devel >= 1:3.2 | |
24 | %endif | |
25 | Requires: python-modules >= 1:2.4 | |
6bded4a9 | 26 | BuildArch: noarch |
c129f656 JB |
27 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
28 | ||
29 | %description | |
30 | This is the test discovery mechanism and ``load_tests`` protocol for | |
31 | unittest backported from Python 2.7 to work with Python 2.4 or more | |
32 | recent (including Python 3). | |
33 | ||
34 | %description -l pl.UTF-8 | |
35 | Ten moduł zawiera mechanizm znajdowania testów oraz protokół | |
36 | "load_tests" dla modułu unittest przeniesiony z Pythona 2.7 tak, aby | |
37 | działał z Pythonem 2.4 i nowszymi (włącznie z Pythonem 3). | |
38 | ||
39 | %package -n python3-discover | |
40 | Summary: Test discovery for unittest (backport from Python 2.7) | |
41 | Summary(pl.UTF-8): Wykrywanie testów dla modułu unittest (backport z Pythona 2.7) | |
42 | Group: Development/Languages/Python | |
43 | Requires: python3-modules >= 1:3.2 | |
44 | ||
45 | %description -n python3-discover | |
46 | This is the test discovery mechanism and ``load_tests`` protocol for | |
47 | unittest backported from Python 2.7 to work with Python 2.4 or more | |
48 | recent (including Python 3). | |
49 | ||
50 | %description -n python3-discover -l pl.UTF-8 | |
51 | Ten moduł zawiera mechanizm znajdowania testów oraz protokół | |
52 | "load_tests" dla modułu unittest przeniesiony z Pythona 2.7 tak, aby | |
53 | działał z Pythonem 2.4 i nowszymi (włącznie z Pythonem 3). | |
54 | ||
55 | %prep | |
56 | %setup -q -n discover-%{version} | |
57 | ||
58 | %build | |
59 | %if %{with python2} | |
60 | %py_build | |
61 | %endif | |
62 | ||
63 | %if %{with python3} | |
64 | %py3_build | |
65 | %endif | |
66 | ||
67 | %install | |
68 | rm -rf $RPM_BUILD_ROOT | |
69 | ||
70 | %if %{with python2} | |
71 | %py_install | |
72 | ||
73 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/discover{,-2} | |
74 | %py_postclean | |
75 | %endif | |
76 | ||
77 | %if %{with python3} | |
78 | %py3_install | |
79 | ||
80 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/discover{,-3} | |
81 | %endif | |
82 | ||
83 | %if %{with python2} | |
84 | ln -sf discover-2 $RPM_BUILD_ROOT%{_bindir}/discover | |
85 | %endif | |
86 | ||
87 | %clean | |
88 | rm -rf $RPM_BUILD_ROOT | |
89 | ||
90 | %if %{with python2} | |
91 | %files | |
92 | %defattr(644,root,root,755) | |
93 | %doc README.txt | |
94 | %attr(755,root,root) %{_bindir}/discover | |
95 | %attr(755,root,root) %{_bindir}/discover-2 | |
96 | %{py_sitescriptdir}/discover.py[co] | |
97 | %if "%{py_ver}" > "2.4" | |
98 | %{py_sitescriptdir}/discover-%{version}-py*.egg-info | |
99 | %endif | |
100 | %endif | |
101 | ||
102 | %if %{with python3} | |
103 | %files -n python3-discover | |
104 | %defattr(644,root,root,755) | |
105 | %doc README.txt | |
106 | %attr(755,root,root) %{_bindir}/discover-3 | |
107 | %{py3_sitescriptdir}/discover.py | |
108 | %{py3_sitescriptdir}/__pycache__/discover.cpython-*.py[co] | |
109 | %{py3_sitescriptdir}/discover-%{version}-py*.egg-info | |
110 | %endif |