]> git.pld-linux.org Git - packages/python3-requests.git/blob - python-requests.spec
rebuild with tests and docs
[packages/python3-requests.git] / python-requests.spec
1 #
2 # Conditional build:
3 %bcond_with     tests   # pytest tests (one test fails with pytest-httpbin 1.0.0)
4 %bcond_without  python2 # CPython 2.x module
5 %bcond_without  python3 # CPython 3.x module
6
7 %define         urllib3_ver     1.21.1
8 %define         module          requests
9 %define         egg_name        requests
10 Summary:        HTTP library for Python 2
11 Summary(pl.UTF-8):      Biblioteka HTTP dla Pythona 2
12 Name:           python-%{module}
13 Version:        2.26.0
14 Release:        5
15 License:        Apache v2.0
16 Group:          Development/Languages/Python
17 #Source0Download: https://pypi.org/simple/requests/
18 Source0:        https://files.pythonhosted.org/packages/source/r/requests/%{module}-%{version}.tar.gz
19 # Source0-md5:  8c745949ad3e9ae83d9927fed213db8a
20 Patch0:         system-cert.patch
21 Patch1:         %{name}-reqs.patch
22 Patch2:         %{name}-disable-xdist.patch
23 URL:            https://docs.python-requests.org/
24 BuildRequires:  rpm-pythonprov
25 BuildRequires:  rpmbuild(macros) >= 1.713
26 %if %{with python2}
27 BuildRequires:  python-modules >= 1:2.7
28 BuildRequires:  python-setuptools
29 %if %{with tests}
30 BuildRequires:  python-PySocks >= 1.5.8
31 BuildRequires:  python-certifi >= 2017.4.17
32 BuildRequires:  python-chardet >= 3.0.2
33 BuildRequires:  python-chardet < 5
34 # idna 3 not supported for python2
35 BuildRequires:  python-idna >= 2.5
36 BuildRequires:  python-idna < 3
37 BuildRequires:  python-pytest >= 3
38 BuildRequires:  python-pytest-cov
39 BuildRequires:  python-pytest-httpbin >= 0.0.7
40 BuildRequires:  python-pytest-mock >= 2.0.0
41 BuildRequires:  python-pytest-xdist
42 BuildRequires:  python-urllib3 >= %{urllib3_ver}
43 BuildRequires:  python-urllib3 < 1.27
44 %endif
45 %endif
46 %if %{with python3}
47 BuildRequires:  python3-modules >= 1:3.6
48 BuildRequires:  python3-setuptools
49 %if %{with tests}
50 BuildRequires:  python3-PySocks >= 1.5.8
51 BuildRequires:  python3-certifi >= 2017.4.17
52 BuildRequires:  python3-chardet >= 3.0.2
53 BuildRequires:  python3-chardet < 5
54 BuildRequires:  python3-idna >= 2.5
55 BuildRequires:  python3-idna < 4
56 BuildRequires:  python3-pytest >= 3
57 BuildRequires:  python3-pytest-cov
58 BuildRequires:  python3-pytest-httpbin >= 0.0.7
59 BuildRequires:  python3-pytest-mock >= 2.0.0
60 BuildRequires:  python3-pytest-xdist
61 BuildRequires:  python3-urllib3 >= %{urllib3_ver}
62 BuildRequires:  python3-urllib3 < 1.27
63 %endif
64 %endif
65 Suggests:       ca-certificates
66 # for python2 only to get SNI working. python3 doesn't need this
67 Requires:       python-cryptography >= 1.3.4
68 Requires:       python-pyOpenSSL >= 0.14
69 Requires:       python-urllib3 >= 1.22-2
70 BuildArch:      noarch
71 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
72
73 %description
74 Requests is a HTTP library, written in Python, for human beings.
75
76 Most existing Python modules for sending HTTP requests are extremely
77 verbose and cumbersome. Python's builtin urllib2 module provides most
78 of the HTTP capabilities you should need, but the API is thoroughly
79 broken. It requires an enormous amount of work (even method overrides)
80 to perform the simplest of tasks. Things shouldn't be this way. Not in
81 Python.
82
83 This package contains Python 2.x module.
84
85 %description -l pl.UTF-8
86 Requests to napisana w Pythonie biblioteka HTTP dla ludzi.
87
88 Większość istniejących modułów Pythona do wysyłania żądań HTTP jest
89 zbyt gadatliwa i nieporęczna. Wbudowany w Pythona moduł urllib2
90 zapewnia większość wymaganych możliwości HTTP, ale API jest kiepskie -
91 wymaga dużych nakładów pracy (nawet nadpisań metod) do wykonania
92 najprostszych zadań. Nie powinno tak być. Nie w Pythonie.
93
94 Ten pakiet zawiera moduł dla Pythona 2.x.
95
96 %package -n python3-requests
97 Summary:        HTTP library for Python 3
98 Summary(pl.UTF-8):      Biblioteka HTTP dla Pythona 3
99 Group:          Development/Languages/Python
100 Requires:       python3-modules >= 1:3.6
101 Requires:       python3-charset_normalizer >= 2
102 # for https
103 Requires:       python3-cryptography >= 1.3.4
104 Requires:       python3-idna >= 2.5
105 Requires:       python3-pyOpenSSL >= 0.14
106 Requires:       python3-urllib3 >= 1.22-2
107 Suggests:       ca-certificates
108
109 %description -n python3-requests
110 Requests is a HTTP library, written in Python, for human beings.
111
112 Most existing Python modules for sending HTTP requests are extremely
113 verbose and cumbersome. Python's builtin urllib2 module provides most
114 of the HTTP capabilities you should need, but the api is thoroughly
115 broken. It requires an enormous amount of work (even method overrides)
116 to perform the simplest of tasks. Things shouldn't be this way. Not in
117 Python.
118
119 This package contains Python 3.x module.
120
121 %description -n python3-requests -l pl.UTF-8
122 Requests to napisana w Pythonie biblioteka HTTP dla ludzi.
123
124 Większość istniejących modułów Pythona do wysyłania żądań HTTP jest
125 zbyt gadatliwa i nieporęczna. Wbudowany w Pythona moduł urllib2
126 zapewnia większość wymaganych możliwości HTTP, ale API jest kiepskie -
127 wymaga dużych nakładów pracy (nawet nadpisań metod) do wykonania
128 najprostszych zadań. Nie powinno tak być. Nie w Pythonie.
129
130 Ten pakiet zawiera moduł dla Pythona 3.x.
131
132 %prep
133 %setup -q -n %{module}-%{version}
134 %patch0 -p1
135 %patch1 -p1
136 %patch2 -p1
137
138 %build
139 %if %{with python2}
140 %py_build
141
142 %if %{with tests}
143 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
144 PYTEST_PLUGINS="pytest_httpbin.plugin,pytest_mock" \
145 %{__python} -m pytest tests
146 %endif
147 %endif
148
149 %if %{with python3}
150 %py3_build
151
152 %if %{with tests}
153 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
154 PYTEST_PLUGINS="pytest_httpbin.plugin,pytest_mock" \
155 %{__python3} -m pytest tests
156 %endif
157 %endif
158
159 %install
160 rm -rf $RPM_BUILD_ROOT
161
162 %if %{with python2}
163 %py_install
164
165 %py_postclean
166 %endif
167
168 %if %{with python3}
169 %py3_install
170 %endif
171
172 %clean
173 rm -rf $RPM_BUILD_ROOT
174
175 %if %{with python2}
176 %files
177 %defattr(644,root,root,755)
178 %doc HISTORY.md README.md
179 %{py_sitescriptdir}/%{module}
180 %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
181 %endif
182
183 %if %{with python3}
184 %files -n python3-requests
185 %defattr(644,root,root,755)
186 %doc HISTORY.md README.md
187 %{py3_sitescriptdir}/%{module}
188 %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
189 %endif
This page took 0.044328 seconds and 3 git commands to generate.