3 %bcond_with tests # do not perform "make test"
4 %bcond_without python2 # CPython 2.x module
5 %bcond_without python3 # CPython 3.x module
7 %define module requests_mock
8 %define egg_name %{module}
9 %define pypi_name requests-mock
10 Summary: Mock out responses from the requests package
11 Name: python-%{pypi_name}
15 Group: Libraries/Python
16 Source0: https://pypi.python.org/packages/8d/cb/1267d7294d97e9a3ef24bf1370791da4d2dc6abc0f67626f38f4bf25dfa3/%{pypi_name}-%{version}.tar.gz
17 # Source0-md5: d2efbaf16d19153b7d271628071b4d4b
18 URL: https://requests-mock.readthedocs.io
19 BuildRequires: rpm-pythonprov
20 BuildRequires: rpmbuild(macros) >= 1.714
22 BuildRequires: python-modules
23 BuildRequires: python-setuptools
26 BuildRequires: python3-modules
27 BuildRequires: python3-setuptools
29 Requires: python-requests
31 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34 requests-mock provides a building block to stub out the HTTP requests
35 portions of your testing code.
37 %package -n python3-%{module}
38 Summary: Mock out responses from the requests package
39 Group: Libraries/Python
40 Requires: python3-modules
42 %description -n python3-%{module}
43 requests-mock provides a building block to stub out the HTTP requests
44 portions of your testing code.
47 %setup -q -n %{pypi_name}-%{version}
51 %py_build %{?with_tests:test}
55 %py3_build %{?with_tests:test}
59 rm -rf $RPM_BUILD_ROOT
72 rm -rf $RPM_BUILD_ROOT
76 %defattr(644,root,root,755)
77 %doc AUTHORS ChangeLog README.rst *.txt
78 %{py_sitescriptdir}/%{module}
79 %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
83 %files -n python3-%{module}
84 %defattr(644,root,root,755)
85 %doc AUTHORS ChangeLog README.rst *.txt
86 %{py3_sitescriptdir}/%{module}
87 %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info