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