2 # This is template for pure python modules (noarch)
3 # use template-specs/python-ext.spec for binary python packages
7 %bcond_with tests # do not perform "make test"
8 %bcond_without python2 # CPython 2.x module
9 %bcond_without python3 # CPython 3.x module
12 # - 'module' should match the Python import path (first component?)
13 # - 'egg_name' should equal to Python egg name
14 # - 'pypi_name' must match the Python Package Index name
15 %define module requests_mock
16 %define egg_name %{module}
17 %define pypi_name requests-mock
18 Summary: Mock out responses from the requests package
19 Name: python-%{pypi_name}
23 Group: Libraries/Python
24 Source0: https://pypi.python.org/packages/8d/cb/1267d7294d97e9a3ef24bf1370791da4d2dc6abc0f67626f38f4bf25dfa3/%{pypi_name}-%{version}.tar.gz
25 # Source0-md5: d2efbaf16d19153b7d271628071b4d4b
26 URL: https://requests-mock.readthedocs.io
27 BuildRequires: rpm-pythonprov
28 BuildRequires: rpmbuild(macros) >= 1.714
30 BuildRequires: python-modules
31 BuildRequires: python-setuptools
34 BuildRequires: python3-modules
35 BuildRequires: python3-setuptools
37 Requires: python-requests
39 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
42 requests-mock provides a building block to stub out the HTTP requests
43 portions of your testing code.
45 %package -n python3-%{module}
46 Summary: Mock out responses from the requests package
47 Group: Libraries/Python
48 Requires: python3-modules
50 %description -n python3-%{module}
51 requests-mock provides a building block to stub out the HTTP requests
52 portions of your testing code.
55 %setup -q -n %{pypi_name}-%{version}
59 %py_build %{?with_tests:test}
63 %py3_build %{?with_tests:test}
67 rm -rf $RPM_BUILD_ROOT
80 rm -rf $RPM_BUILD_ROOT
84 %defattr(644,root,root,755)
85 %doc AUTHORS ChangeLog README.rst *.txt
86 %{py_sitescriptdir}/%{module}
87 %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
91 %files -n python3-%{module}
92 %defattr(644,root,root,755)
93 %doc AUTHORS ChangeLog README.rst *.txt
94 %{py3_sitescriptdir}/%{module}
95 %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info