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