]> git.pld-linux.org Git - SPECS.git/blob - python-responses.spec
SPECS updated Wed 28 Jul 14:48:01 CEST 2021
[SPECS.git] / python-responses.spec
1 #
2 # Conditional build:
3 %bcond_without  tests   # unit tests
4 %bcond_without  python2 # CPython 2.x module
5 %bcond_without  python3 # CPython 3.x module
6
7 %define         module          responses
8 %define         egg_name        responses
9 %define         pypi_name       responses
10 Summary:        A utility for mocking out the Python Requests library
11 Summary(pl.UTF-8):      Narzędzie do podstawiania atrap biblioteki Python Requests
12 Name:           python-%{pypi_name}
13 Version:        0.12.1
14 Release:        2
15 License:        Apache v2.0
16 #Source0Download: https://github.com/getsentry/responses/releases
17 Source0:        https://github.com/getsentry/responses/archive/%{version}/%{pypi_name}-%{version}.tar.gz
18 # Source0-md5:  afbac75fad56fe130f7915ce6feff0db
19 Patch0:         %{name}-py2.patch
20 Group:          Libraries/Python
21 URL:            https://github.com/getsentry/responses
22 BuildRequires:  rpm-pythonprov
23 BuildRequires:  rpmbuild(macros) >= 1.714
24 %if %{with python2}
25 BuildRequires:  python-modules >= 1:2.7
26 BuildRequires:  python-setuptools
27 %endif
28 %if %{with python3}
29 %if %{with tests}
30 BuildRequires:  python-cookies
31 BuildRequires:  python-coverage >= 3.7.1
32 BuildRequires:  python-flake8
33 BuildRequires:  python-mock
34 BuildRequires:  python-pytest >= 4.6
35 BuildRequires:  python-pytest-cov
36 BuildRequires:  python-pytest-localserver
37 BuildRequires:  python-requests >= 2.0
38 BuildRequires:  python-urllib3 >= 1.25.10
39 BuildRequires:  python-six
40 %endif
41 %endif
42 %if %{with python3}
43 BuildRequires:  python3-modules >= 1:3.5
44 BuildRequires:  python3-setuptools
45 %if %{with tests}
46 BuildRequires:  python3-coverage >= 3.7.1
47 BuildRequires:  python3-flake8
48 BuildRequires:  python3-pytest >= 4.6
49 BuildRequires:  python3-pytest-cov
50 BuildRequires:  python3-pytest-localserver
51 BuildRequires:  python3-requests >= 2.0
52 BuildRequires:  python3-urllib3 >= 1.25.10
53 BuildRequires:  python3-six
54 %endif
55 %endif
56 BuildArch:      noarch
57 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
58
59 %description
60 A utility library for mocking out the requests Python library.
61
62 %description -l pl.UTF-8
63 Biblioteka narzędziowa do podstawiania atrap biblioteki Pythona
64 requests.
65
66 %package -n python3-%{pypi_name}
67 Summary:        A utility for mocking out the Python Requests library
68 Summary(pl.UTF-8):      Narzędzie do podstawiania atrap biblioteki Python Requests
69 Group:          Libraries/Python
70
71 %description -n python3-%{pypi_name}
72 A utility library for mocking out the requests Python library.
73
74 %description -n python3-%{pypi_name} -l pl.UTF-8
75 Biblioteka narzędziowa do podstawiania atrap biblioteki Pythona
76 requests.
77
78 %prep
79 %setup -q -n %{pypi_name}-%{version}
80 %patch0 -p1
81
82 %build
83 %if %{with python2}
84 %py_build
85
86 %if %{with tests}
87 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
88 PYTEST_PLUGINS="pytest_localserver.plugin" \
89 %{__python} -m pytest test_responses.py
90 %endif
91 %endif
92
93 %if %{with python3}
94 %py3_build
95
96 %if %{with tests}
97 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
98 PYTEST_PLUGINS="pytest_localserver.plugin" \
99 %{__python3} -m pytest test_responses.py
100 %endif
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 CHANGES README.rst
123 %{py_sitescriptdir}/responses.py[co]
124 %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
125 %endif
126
127 %if %{with python3}
128 %files -n python3-%{pypi_name}
129 %defattr(644,root,root,755)
130 %doc CHANGES README.rst
131 %{py3_sitescriptdir}/responses.py
132 %{py3_sitescriptdir}/__pycache__/responses.cpython-*.pyc
133 %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
134 %endif
This page took 0.11396 seconds and 3 git commands to generate.