]>
Commit | Line | Data |
---|---|---|
5b20e6b4 ER |
1 | # |
2 | # Conditional build: | |
0e5595bc | 3 | %bcond_without tests # unit tests |
5b20e6b4 ER |
4 | %bcond_without python2 # CPython 2.x module |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
7 | %define module responses | |
5b20e6b4 | 8 | Summary: A utility for mocking out the Python Requests library |
0e5595bc | 9 | Summary(pl.UTF-8): Narzędzie do podstawiania atrap biblioteki Python Requests |
6a52c6f7 JB |
10 | Name: python-%{module} |
11 | # keep 0.17.x here for python2 support | |
12 | Version: 0.17.0 | |
13 | Release: 1 | |
5b20e6b4 | 14 | License: Apache v2.0 |
6a52c6f7 | 15 | Group: Libraries/Python |
0e5595bc | 16 | #Source0Download: https://github.com/getsentry/responses/releases |
6a52c6f7 JB |
17 | Source0: https://github.com/getsentry/responses/archive/%{version}/%{module}-%{version}.tar.gz |
18 | # Source0-md5: 7b94ef2851112c11c3bf75455e4ebeff | |
0e5595bc | 19 | Patch0: %{name}-py2.patch |
5b20e6b4 ER |
20 | URL: https://github.com/getsentry/responses |
21 | BuildRequires: rpm-pythonprov | |
22 | BuildRequires: rpmbuild(macros) >= 1.714 | |
23 | %if %{with python2} | |
0e5595bc | 24 | BuildRequires: python-modules >= 1:2.7 |
5b20e6b4 | 25 | BuildRequires: python-setuptools |
5b20e6b4 ER |
26 | %if %{with tests} |
27 | BuildRequires: python-cookies | |
0e5595bc | 28 | BuildRequires: python-coverage >= 3.7.1 |
5b20e6b4 ER |
29 | BuildRequires: python-flake8 |
30 | BuildRequires: python-mock | |
0e5595bc | 31 | BuildRequires: python-pytest >= 4.6 |
5b20e6b4 | 32 | BuildRequires: python-pytest-cov |
0e5595bc JB |
33 | BuildRequires: python-pytest-localserver |
34 | BuildRequires: python-requests >= 2.0 | |
35 | BuildRequires: python-urllib3 >= 1.25.10 | |
5b20e6b4 ER |
36 | BuildRequires: python-six |
37 | %endif | |
38 | %endif | |
39 | %if %{with python3} | |
0e5595bc | 40 | BuildRequires: python3-modules >= 1:3.5 |
5b20e6b4 ER |
41 | BuildRequires: python3-setuptools |
42 | %if %{with tests} | |
0e5595bc | 43 | BuildRequires: python3-coverage >= 3.7.1 |
5b20e6b4 | 44 | BuildRequires: python3-flake8 |
0e5595bc | 45 | BuildRequires: python3-pytest >= 4.6 |
5b20e6b4 | 46 | BuildRequires: python3-pytest-cov |
0e5595bc JB |
47 | BuildRequires: python3-pytest-localserver |
48 | BuildRequires: python3-requests >= 2.0 | |
49 | BuildRequires: python3-urllib3 >= 1.25.10 | |
5b20e6b4 ER |
50 | BuildRequires: python3-six |
51 | %endif | |
52 | %endif | |
53 | BuildArch: noarch | |
54 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
55 | ||
56 | %description | |
57 | A utility library for mocking out the requests Python library. | |
58 | ||
0e5595bc JB |
59 | %description -l pl.UTF-8 |
60 | Biblioteka narzędziowa do podstawiania atrap biblioteki Pythona | |
61 | requests. | |
62 | ||
6a52c6f7 | 63 | %package -n python3-%{module} |
5b20e6b4 | 64 | Summary: A utility for mocking out the Python Requests library |
0e5595bc | 65 | Summary(pl.UTF-8): Narzędzie do podstawiania atrap biblioteki Python Requests |
5b20e6b4 ER |
66 | Group: Libraries/Python |
67 | ||
6a52c6f7 | 68 | %description -n python3-%{module} |
5b20e6b4 ER |
69 | A utility library for mocking out the requests Python library. |
70 | ||
6a52c6f7 | 71 | %description -n python3-%{module} -l pl.UTF-8 |
0e5595bc JB |
72 | Biblioteka narzędziowa do podstawiania atrap biblioteki Pythona |
73 | requests. | |
74 | ||
5b20e6b4 | 75 | %prep |
6a52c6f7 | 76 | %setup -q -n %{module}-%{version} |
0e5595bc | 77 | %patch0 -p1 |
5b20e6b4 ER |
78 | |
79 | %build | |
80 | %if %{with python2} | |
0e5595bc JB |
81 | %py_build |
82 | ||
83 | %if %{with tests} | |
84 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
85 | PYTEST_PLUGINS="pytest_localserver.plugin" \ | |
6a52c6f7 | 86 | %{__python} -m pytest responses |
0e5595bc | 87 | %endif |
5b20e6b4 ER |
88 | %endif |
89 | ||
90 | %if %{with python3} | |
0e5595bc JB |
91 | %py3_build |
92 | ||
93 | %if %{with tests} | |
94 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
95 | PYTEST_PLUGINS="pytest_localserver.plugin" \ | |
6a52c6f7 | 96 | %{__python3} -m pytest responses |
0e5595bc | 97 | %endif |
5b20e6b4 ER |
98 | %endif |
99 | ||
100 | %install | |
101 | rm -rf $RPM_BUILD_ROOT | |
0e5595bc | 102 | |
5b20e6b4 ER |
103 | %if %{with python2} |
104 | %py_install | |
0e5595bc | 105 | |
5b20e6b4 | 106 | %py_postclean |
5b20e6b4 ER |
107 | %endif |
108 | ||
109 | %if %{with python3} | |
110 | %py3_install | |
5b20e6b4 ER |
111 | %endif |
112 | ||
113 | %clean | |
114 | rm -rf $RPM_BUILD_ROOT | |
115 | ||
116 | %if %{with python2} | |
117 | %files | |
118 | %defattr(644,root,root,755) | |
0e5595bc | 119 | %doc CHANGES README.rst |
6a52c6f7 JB |
120 | %{py_sitescriptdir}/responses |
121 | %{py_sitescriptdir}/responses-%{version}-py*.egg-info | |
5b20e6b4 ER |
122 | %endif |
123 | ||
124 | %if %{with python3} | |
6a52c6f7 | 125 | %files -n python3-%{module} |
5b20e6b4 | 126 | %defattr(644,root,root,755) |
0e5595bc | 127 | %doc CHANGES README.rst |
6a52c6f7 JB |
128 | %{py3_sitescriptdir}/responses |
129 | %{py3_sitescriptdir}/responses-%{version}-py*.egg-info | |
5b20e6b4 | 130 | %endif |