]>
Commit | Line | Data |
---|---|---|
ef9212ce | 1 | # |
8d099eee | 2 | # Conditional build: |
23351644 | 3 | %bcond_with tests # pytest tests (one test fails with pytest-httpbin 1.0.0) |
dd9a8c31 | 4 | |
44a39070 | 5 | %define urllib3_ver 1.21.1 |
dd9a8c31 ER |
6 | %define module requests |
7 | %define egg_name requests | |
594bc38a AM |
8 | Summary: HTTP library for Python |
9 | Summary(pl.UTF-8): Biblioteka HTTP dla Pythona | |
10 | Name: python3-%{module} | |
11 | Version: 2.28.1 | |
d27cd286 | 12 | Release: 1 |
017795a9 | 13 | License: Apache v2.0 |
8ba13116 | 14 | Group: Development/Languages/Python |
44a39070 JB |
15 | #Source0Download: https://pypi.org/simple/requests/ |
16 | Source0: https://files.pythonhosted.org/packages/source/r/requests/%{module}-%{version}.tar.gz | |
594bc38a | 17 | # Source0-md5: 796ea875cdae283529c03b9203d9c454 |
0989c03f | 18 | Patch0: system-cert.patch |
594bc38a AM |
19 | Patch1: python-requests-reqs.patch |
20 | Patch2: python-requests-disable-xdist.patch | |
23351644 | 21 | URL: https://docs.python-requests.org/ |
dd9a8c31 ER |
22 | BuildRequires: rpm-pythonprov |
23 | BuildRequires: rpmbuild(macros) >= 1.713 | |
a5ef80ca | 24 | BuildRequires: python3-modules >= 1:3.6 |
616851f8 | 25 | BuildRequires: python3-setuptools |
017795a9 | 26 | %if %{with tests} |
d04d981e | 27 | BuildRequires: python3-PySocks >= 1.5.8 |
dd9a8c31 | 28 | BuildRequires: python3-certifi >= 2017.4.17 |
d27cd286 JB |
29 | BuildRequires: python3-charset_normalizer >= 2 |
30 | BuildRequires: python3-charset_normalizer < 2.1 | |
0989c03f | 31 | BuildRequires: python3-idna >= 2.5 |
822dad3c | 32 | BuildRequires: python3-idna < 4 |
0ecc0c85 | 33 | BuildRequires: python3-pytest >= 3 |
017795a9 JB |
34 | BuildRequires: python3-pytest-cov |
35 | BuildRequires: python3-pytest-httpbin >= 0.0.7 | |
fa360ea6 | 36 | BuildRequires: python3-pytest-mock >= 2.0.0 |
d04d981e | 37 | BuildRequires: python3-pytest-xdist |
44a39070 | 38 | BuildRequires: python3-urllib3 >= %{urllib3_ver} |
fa360ea6 | 39 | BuildRequires: python3-urllib3 < 1.27 |
017795a9 | 40 | %endif |
a5ef80ca | 41 | Requires: python3-modules >= 1:3.6 |
24e1d820 | 42 | Requires: python3-charset_normalizer >= 2 |
d04d981e JB |
43 | # for https |
44 | Requires: python3-cryptography >= 1.3.4 | |
24e1d820 | 45 | Requires: python3-idna >= 2.5 |
d04d981e | 46 | Requires: python3-pyOpenSSL >= 0.14 |
ecc66759 | 47 | Requires: python3-urllib3 >= 1.22-2 |
dd9a8c31 | 48 | Suggests: ca-certificates |
594bc38a AM |
49 | BuildArch: noarch |
50 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
a0c91a8e | 51 | |
594bc38a | 52 | %description |
a8d01621 | 53 | Requests is a HTTP library, written in Python, for human beings. |
a0c91a8e KK |
54 | |
55 | Most existing Python modules for sending HTTP requests are extremely | |
56 | verbose and cumbersome. Python's builtin urllib2 module provides most | |
594bc38a | 57 | of the HTTP capabilities you should need, but the API is thoroughly |
a0c91a8e | 58 | broken. It requires an enormous amount of work (even method overrides) |
8d099eee JB |
59 | to perform the simplest of tasks. Things shouldn't be this way. Not in |
60 | Python. | |
61 | ||
ef9212ce JB |
62 | This package contains Python 3.x module. |
63 | ||
594bc38a | 64 | %description -l pl.UTF-8 |
a8d01621 | 65 | Requests to napisana w Pythonie biblioteka HTTP dla ludzi. |
a0c91a8e | 66 | |
a8d01621 ŁK |
67 | Większość istniejących modułów Pythona do wysyłania żądań HTTP jest |
68 | zbyt gadatliwa i nieporęczna. Wbudowany w Pythona moduł urllib2 | |
69 | zapewnia większość wymaganych możliwości HTTP, ale API jest kiepskie - | |
70 | wymaga dużych nakładów pracy (nawet nadpisań metod) do wykonania | |
71 | najprostszych zadań. Nie powinno tak być. Nie w Pythonie. | |
a0c91a8e | 72 | |
ef9212ce JB |
73 | Ten pakiet zawiera moduł dla Pythona 3.x. |
74 | ||
8ba13116 | 75 | %prep |
a8d01621 | 76 | %setup -q -n %{module}-%{version} |
0989c03f | 77 | %patch0 -p1 |
23351644 JB |
78 | %patch1 -p1 |
79 | %patch2 -p1 | |
e16ab944 | 80 | |
8ba13116 | 81 | %build |
23351644 JB |
82 | %py3_build |
83 | ||
9e2ed226 | 84 | %if %{with tests} |
23351644 JB |
85 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ |
86 | PYTEST_PLUGINS="pytest_httpbin.plugin,pytest_mock" \ | |
87 | %{__python3} -m pytest tests | |
8d099eee | 88 | %endif |
8ba13116 MM |
89 | |
90 | %install | |
91 | rm -rf $RPM_BUILD_ROOT | |
a8d01621 | 92 | |
b4dcbe07 | 93 | %py3_install |
8ba13116 MM |
94 | |
95 | %clean | |
96 | rm -rf $RPM_BUILD_ROOT | |
97 | ||
98 | %files | |
99 | %defattr(644,root,root,755) | |
283f39fa | 100 | %doc HISTORY.md README.md |
a0c91a8e | 101 | %{py3_sitescriptdir}/%{module} |
dd9a8c31 | 102 | %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info |