]>
Commit | Line | Data |
---|---|---|
f2fc5f74 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without doc # Sphinx documentation | |
4 | %bcond_with tests # unit tests (6 failing as of 0.8.1) | |
5 | %bcond_without python2 # CPython 2.x module | |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
8 | Summary: VCR imitation for python-requests | |
9 | Summary(pl.UTF-8): Imitacja VCR dla python-requests | |
10 | Name: python-betamax | |
11 | Version: 0.8.1 | |
8bc4f375 | 12 | Release: 2 |
f2fc5f74 JB |
13 | License: Apache v2.0 |
14 | Group: Libraries/Python | |
15 | #Source0Download: https://pypi.org/simple/betamax/ | |
16 | Source0: https://files.pythonhosted.org/packages/source/b/betamax/betamax-%{version}.tar.gz | |
17 | # Source0-md5: b8182d43a200fc126a3bf7555626f964 | |
18 | URL: https://pypi.org/project/betamax/ | |
19 | %if %{with python2} | |
20 | BuildRequires: python-modules >= 1:2.7 | |
21 | BuildRequires: python-setuptools | |
22 | %if %{with tests} | |
23 | BuildRequires: python-pytest | |
24 | %endif | |
25 | %endif | |
26 | %if %{with python3} | |
27 | BuildRequires: python3-modules >= 1:3.3 | |
28 | BuildRequires: python3-setuptools | |
29 | %if %{with tests} | |
30 | BuildRequires: python3-pytest | |
31 | %endif | |
32 | %endif | |
33 | BuildRequires: rpm-pythonprov | |
34 | BuildRequires: rpmbuild(macros) >= 1.714 | |
35 | %if %{with doc} | |
36 | BuildRequires: sphinx-pdg | |
37 | %endif | |
38 | Requires: python-modules >= 1:2.7 | |
39 | BuildArch: noarch | |
40 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
41 | ||
42 | %description | |
43 | Betamax is a VCR imitation for requests. This will make mocking out | |
44 | requests much easier. | |
45 | ||
46 | %description -l pl.UTF-8 | |
47 | Betamax to imitacja magnetowidu dla żądań HTTP (pakietu requests). | |
48 | Znacząco ułatwia to podstawianie atrap dla requests. | |
49 | ||
50 | %package -n python3-betamax | |
51 | Summary: VCR imitation for python-requests | |
52 | Summary(pl.UTF-8): Imitacja VCR dla python-requests | |
53 | Group: Libraries/Python | |
54 | Requires: python3-modules >= 1:3.3 | |
55 | ||
56 | %description -n python3-betamax | |
57 | Betamax is a VCR imitation for requests. This will make mocking out | |
58 | requests much easier. | |
59 | ||
60 | %description -n python3-betamax -l pl.UTF-8 | |
61 | Betamax to imitacja magnetowidu dla żądań HTTP (pakietu requests). | |
62 | Znacząco ułatwia to podstawianie atrap dla requests. | |
63 | ||
64 | %package apidocs | |
65 | Summary: API documentation for Python betamax module | |
66 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona betamax | |
67 | Group: Documentation | |
68 | ||
69 | %description apidocs | |
70 | API documentation for Python betamax module. | |
71 | ||
72 | %description apidocs -l pl.UTF-8 | |
73 | Dokumentacja API modułu Pythona betamax. | |
74 | ||
75 | %prep | |
76 | %setup -q -n betamax-%{version} | |
77 | ||
78 | %build | |
79 | %if %{with python2} | |
80 | %py_build | |
81 | ||
82 | %if %{with tests} | |
83 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
84 | PYTEST_PLUGINS="betamax.fixtures.pytest" \ | |
85 | %{__python} -m pytest tests | |
86 | %endif | |
87 | %endif | |
88 | ||
89 | %if %{with python3} | |
90 | %py3_build | |
91 | ||
92 | %if %{with tests} | |
93 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
94 | PYTEST_PLUGINS="betamax.fixtures.pytest" \ | |
95 | %{__python3} -m pytest tests | |
96 | %endif | |
97 | %endif | |
98 | ||
99 | %if %{with doc} | |
100 | %{__make} -C docs html | |
101 | %endif | |
102 | ||
103 | %install | |
104 | rm -rf $RPM_BUILD_ROOT | |
105 | ||
106 | %if %{with python2} | |
107 | %py_install | |
108 | ||
109 | %py_postclean | |
110 | %endif | |
111 | ||
112 | %if %{with python3} | |
113 | %py3_install | |
114 | %endif | |
115 | ||
116 | %clean | |
117 | rm -rf $RPM_BUILD_ROOT | |
118 | ||
119 | %if %{with python2} | |
120 | %files | |
121 | %defattr(644,root,root,755) | |
122 | %doc AUTHORS.rst HISTORY.rst LICENSE README.rst | |
123 | %{py_sitescriptdir}/betamax | |
124 | %{py_sitescriptdir}/betamax-%{version}-py*.egg-info | |
125 | %endif | |
126 | ||
127 | %if %{with python3} | |
128 | %files -n python3-betamax | |
129 | %defattr(644,root,root,755) | |
130 | %doc AUTHORS.rst HISTORY.rst LICENSE README.rst | |
131 | %{py3_sitescriptdir}/betamax | |
132 | %{py3_sitescriptdir}/betamax-%{version}-py*.egg-info | |
133 | %endif | |
134 | ||
135 | %if %{with doc} | |
136 | %files apidocs | |
137 | %defattr(644,root,root,755) | |
138 | %doc docs/_build/html/{_static,*.html,*.js} | |
139 | %endif |