]> git.pld-linux.org Git - packages/python-requests-mock.git/blob - python-requests-mock.spec
new package
[packages/python-requests-mock.git] / python-requests-mock.spec
1 #
2 # This is template for pure python modules (noarch)
3 # use template-specs/python-ext.spec for binary python packages
4 #
5 #
6 # Conditional build:
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
10
11 # NOTES:
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}
20 Version:        1.3.0
21 Release:        1
22 License:        Apache
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
29 %if %{with python2}
30 BuildRequires:  python-modules
31 BuildRequires:  python-setuptools
32 %endif
33 %if %{with python3}
34 BuildRequires:  python3-modules
35 BuildRequires:  python3-setuptools
36 %endif
37 Requires:       python-requests
38 BuildArch:      noarch
39 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40
41 %description
42 requests-mock provides a building block to stub out the HTTP requests
43 portions of your testing code.
44
45 %package -n python3-%{module}
46 Summary:        Mock out responses from the requests package
47 Group:          Libraries/Python
48 Requires:       python3-modules
49
50 %description -n python3-%{module}
51 requests-mock provides a building block to stub out the HTTP requests
52 portions of your testing code.
53
54 %prep
55 %setup -q -n %{pypi_name}-%{version}
56
57 %build
58 %if %{with python2}
59 %py_build %{?with_tests:test}
60 %endif
61
62 %if %{with python3}
63 %py3_build %{?with_tests:test}
64 %endif
65
66 %install
67 rm -rf $RPM_BUILD_ROOT
68
69 %if %{with python2}
70 %py_install
71
72 %py_postclean
73 %endif
74
75 %if %{with python3}
76 %py3_install
77 %endif
78
79 %clean
80 rm -rf $RPM_BUILD_ROOT
81
82 %if %{with python2}
83 %files
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
88 %endif
89
90 %if %{with python3}
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
96 %endif
This page took 0.043692 seconds and 3 git commands to generate.