]>
Commit | Line | Data |
---|---|---|
ef9212ce | 1 | # |
8d099eee | 2 | # Conditional build: |
017795a9 | 3 | %bcond_with tests # test target (tests not included in dist tarball as of 2.13.0) |
ef9212ce JB |
4 | %bcond_without python2 # CPython 2.x module |
5 | %bcond_without python3 # CPython 3.x module | |
c29b18ec | 6 | %bcond_without bundled # bundled libraries |
8d099eee | 7 | # |
017795a9 | 8 | %define urllib3ver 1.20 |
8ba13116 | 9 | %define module requests |
ef9212ce JB |
10 | Summary: HTTP library for Python 2 |
11 | Summary(pl.UTF-8): Biblioteka HTTP dla Pythona 2 | |
8ba13116 | 12 | Name: python-%{module} |
017795a9 JB |
13 | Version: 2.13.0 |
14 | Release: 1 | |
15 | License: Apache v2.0 | |
8ba13116 | 16 | Group: Development/Languages/Python |
017795a9 JB |
17 | Source0: https://pypi.python.org/packages/16/09/37b69de7c924d318e51ece1c4ceb679bf93be9d05973bb30c35babd596e2/%{module}-%{version}.tar.gz |
18 | # Source0-md5: 921ec6b48f2ddafc8bb6160957baf444 | |
19 | Patch0: %{name}-remove-nested-bundling-dep.patch | |
4a7ef446 | 20 | Patch1: system-cert.patch |
017795a9 | 21 | URL: http://python-requests.org/ |
a8d01621 ŁK |
22 | %if %{with python2} |
23 | BuildRequires: python-modules >= 1:2.6 | |
27c2bafe | 24 | %if %{without bundled} |
017795a9 | 25 | BuildRequires: python-chardet >= 2.3.0 |
d49507cd | 26 | BuildRequires: python-urllib3 >= %{urllib3ver} |
a8d01621 | 27 | %endif |
017795a9 JB |
28 | %if %{with tests} |
29 | BuildRequires: python-pytest >= 2.8.0 | |
30 | BuildRequires: python-pytest-cov | |
31 | BuildRequires: python-pytest-httpbin >= 0.0.7 | |
32 | BuildRequires: python-pytest-mock | |
33 | %endif | |
27c2bafe | 34 | %endif |
a8d01621 | 35 | %if %{with python3} |
ef9212ce | 36 | BuildRequires: python3-modules >= 1:3.2 |
27c2bafe | 37 | %if %{without bundled} |
017795a9 | 38 | BuildRequires: python3-chardet >= 2.3.0 |
d49507cd | 39 | BuildRequires: python3-urllib3 >= %{urllib3ver} |
a8d01621 | 40 | %endif |
017795a9 JB |
41 | %if %{with tests} |
42 | BuildRequires: python3-pytest >= 2.8.0 | |
43 | BuildRequires: python3-pytest-cov | |
44 | BuildRequires: python3-pytest-httpbin >= 0.0.7 | |
45 | BuildRequires: python3-pytest-mock | |
46 | %endif | |
27c2bafe | 47 | %endif |
8ba13116 | 48 | BuildRequires: rpm-pythonprov |
b4dcbe07 | 49 | BuildRequires: rpmbuild(macros) >= 1.713 |
4a7ef446 | 50 | Requires: ca-certificates |
017795a9 | 51 | Requires: python-idna >= 2.0.0 |
a8d01621 | 52 | Requires: python-modules >= 1:2.6 |
27c2bafe | 53 | %if %{without bundled} |
017795a9 | 54 | Requires: python-chardet >= 2.3.0 |
d49507cd | 55 | Requires: python-urllib3 >= %{urllib3ver} |
27c2bafe | 56 | %endif |
e7d50ac0 AM |
57 | # for python2 only to get SNI working. python3 doesn't need this |
58 | Requires: python-ndg-httpsclient | |
59 | Requires: python-pyasn1 | |
017795a9 | 60 | Requires: python-pyOpenSSL >= 0.14 |
8ba13116 MM |
61 | BuildArch: noarch |
62 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
63 | ||
64 | %description | |
a8d01621 | 65 | Requests is a HTTP library, written in Python, for human beings. |
8ba13116 MM |
66 | |
67 | Most existing Python modules for sending HTTP requests are extremely | |
68 | verbose and cumbersome. Python's builtin urllib2 module provides most | |
8d099eee | 69 | of the HTTP capabilities you should need, but the API is thoroughly |
8ba13116 | 70 | broken. It requires an enormous amount of work (even method overrides) |
8d099eee JB |
71 | to perform the simplest of tasks. Things shouldn't be this way. Not in |
72 | Python. | |
73 | ||
ef9212ce JB |
74 | This package contains Python 2.x module. |
75 | ||
8d099eee | 76 | %description -l pl.UTF-8 |
a8d01621 | 77 | Requests to napisana w Pythonie biblioteka HTTP dla ludzi. |
8ba13116 | 78 | |
8d099eee JB |
79 | Większość istniejących modułów Pythona do wysyłania żądań HTTP jest |
80 | zbyt gadatliwa i nieporęczna. Wbudowany w Pythona moduł urllib2 | |
81 | zapewnia większość wymaganych możliwości HTTP, ale API jest kiepskie - | |
82 | wymaga dużych nakładów pracy (nawet nadpisań metod) do wykonania | |
83 | najprostszych zadań. Nie powinno tak być. Nie w Pythonie. | |
8ba13116 | 84 | |
ef9212ce JB |
85 | Ten pakiet zawiera moduł dla Pythona 2.x. |
86 | ||
a0c91a8e | 87 | %package -n python3-requests |
ef9212ce JB |
88 | Summary: HTTP library for Python 3 |
89 | Summary(pl.UTF-8): Biblioteka HTTP dla Pythona 3 | |
a0c91a8e | 90 | Group: Development/Languages/Python |
4a7ef446 | 91 | Requires: ca-certificates |
ef9212ce | 92 | Requires: python3-modules >= 1:3.2 |
27c2bafe | 93 | %if %{without bundled} |
017795a9 JB |
94 | Requires: python3-chardet >= 2.3.0 |
95 | Requires: python3-idna >= 2.0.0 | |
d49507cd | 96 | Requires: python3-urllib3 >= %{urllib3ver} |
27c2bafe | 97 | %endif |
a0c91a8e KK |
98 | |
99 | %description -n python3-requests | |
a8d01621 | 100 | Requests is a HTTP library, written in Python, for human beings. |
a0c91a8e KK |
101 | |
102 | Most existing Python modules for sending HTTP requests are extremely | |
103 | verbose and cumbersome. Python's builtin urllib2 module provides most | |
104 | of the HTTP capabilities you should need, but the api is thoroughly | |
105 | broken. It requires an enormous amount of work (even method overrides) | |
8d099eee JB |
106 | to perform the simplest of tasks. Things shouldn't be this way. Not in |
107 | Python. | |
108 | ||
ef9212ce JB |
109 | This package contains Python 3.x module. |
110 | ||
8d099eee | 111 | %description -n python3-requests -l pl.UTF-8 |
a8d01621 | 112 | Requests to napisana w Pythonie biblioteka HTTP dla ludzi. |
a0c91a8e | 113 | |
a8d01621 ŁK |
114 | Większość istniejących modułów Pythona do wysyłania żądań HTTP jest |
115 | zbyt gadatliwa i nieporęczna. Wbudowany w Pythona moduł urllib2 | |
116 | zapewnia większość wymaganych możliwości HTTP, ale API jest kiepskie - | |
117 | wymaga dużych nakładów pracy (nawet nadpisań metod) do wykonania | |
118 | najprostszych zadań. Nie powinno tak być. Nie w Pythonie. | |
a0c91a8e | 119 | |
ef9212ce JB |
120 | Ten pakiet zawiera moduł dla Pythona 3.x. |
121 | ||
8ba13116 | 122 | %prep |
a8d01621 | 123 | %setup -q -n %{module}-%{version} |
27c2bafe | 124 | %{!?with_bundled:%patch0 -p1} |
4a7ef446 | 125 | %patch1 -p1 |
e16ab944 | 126 | |
8ba13116 | 127 | %build |
a8d01621 | 128 | %if %{with python2} |
b4dcbe07 | 129 | %py_build %{?with_tests:test} |
a8d01621 | 130 | %endif |
a0c91a8e | 131 | |
a8d01621 | 132 | %if %{with python3} |
b4dcbe07 | 133 | %py3_build %{?with_tests:test} |
8d099eee | 134 | %endif |
8ba13116 MM |
135 | |
136 | %install | |
137 | rm -rf $RPM_BUILD_ROOT | |
a8d01621 ŁK |
138 | |
139 | %if %{with python2} | |
b4dcbe07 | 140 | %py_install |
4a7ef446 ŁK |
141 | %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir} |
142 | %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir} | |
a8d01621 ŁK |
143 | %py_postclean |
144 | %endif | |
8ba13116 | 145 | |
a8d01621 | 146 | %if %{with python3} |
b4dcbe07 | 147 | %py3_install |
a8d01621 | 148 | %endif |
8ba13116 | 149 | |
ae797189 JB |
150 | %{__rm} $RPM_BUILD_ROOT{%{py_sitescriptdir},%{py3_sitescriptdir}}/%{module}/cacert.pem |
151 | %{!?with_bundled:%{__rm} -r $RPM_BUILD_ROOT{%{py_sitescriptdir},%{py3_sitescriptdir}}/%{module}/packages} | |
4a7ef446 | 152 | |
8ba13116 MM |
153 | %clean |
154 | rm -rf $RPM_BUILD_ROOT | |
155 | ||
a8d01621 | 156 | %if %{with python2} |
8ba13116 MM |
157 | %files |
158 | %defattr(644,root,root,755) | |
a8d01621 | 159 | %doc HISTORY.rst README.rst |
8ba13116 | 160 | %{py_sitescriptdir}/%{module} |
8d099eee | 161 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info |
a8d01621 | 162 | %endif |
a0c91a8e | 163 | |
a8d01621 | 164 | %if %{with python3} |
a0c91a8e KK |
165 | %files -n python3-requests |
166 | %defattr(644,root,root,755) | |
a8d01621 | 167 | %doc HISTORY.rst README.rst |
a0c91a8e | 168 | %{py3_sitescriptdir}/%{module} |
8d099eee | 169 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info |
a8d01621 | 170 | %endif |