3 %bcond_with tests # test target (tests not included in dist tarball as of 2.13.0)
4 %bcond_without python2 # CPython 2.x module
5 %bcond_without python3 # CPython 3.x module
7 %define urllib3ver 1.21.1
8 %define module requests
9 %define egg_name requests
10 %define pypi_name requests
11 Summary: HTTP library for Python 2
12 Summary(pl.UTF-8): Biblioteka HTTP dla Pythona 2
13 Name: python-%{module}
17 Group: Development/Languages/Python
18 Source0: https://files.pythonhosted.org/packages/source/r/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
19 # Source0-md5: c8f60cf816a35c0c3fef0a40d0e407a6
20 Patch0: system-cert.patch
21 URL: http://python-requests.org/
22 BuildRequires: rpm-pythonprov
23 BuildRequires: rpmbuild(macros) >= 1.713
25 BuildRequires: python-modules >= 1:2.6
26 BuildRequires: python-setuptools
28 BuildRequires: python-certifi >= 2017.4.17
29 BuildRequires: python-chardet >= 3.0.2
30 BuildRequires: python-idna >= 2.5
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
35 BuildRequires: python-urllib3 >= %{urllib3ver}
39 BuildRequires: python3-modules >= 1:3.2
41 BuildRequires: python3-certifi >= 2017.4.17
42 BuildRequires: python3-chardet >= 3.0.2
43 BuildRequires: python3-idna >= 2.5
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
48 BuildRequires: python3-urllib3 >= %{urllib3ver}
51 Requires: python-chardet >= 3.0.2
52 Requires: python-idna >= 2.5
53 Requires: python-urllib3 >= %{urllib3ver}
54 Suggests: ca-certificates
55 # for python2 only to get SNI working. python3 doesn't need this
56 Requires: python-ndg-httpsclient
57 Requires: python-pyOpenSSL >= 0.14
58 Requires: python-pyasn1
60 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
63 Requests is a HTTP library, written in Python, for human beings.
65 Most existing Python modules for sending HTTP requests are extremely
66 verbose and cumbersome. Python's builtin urllib2 module provides most
67 of the HTTP capabilities you should need, but the API is thoroughly
68 broken. It requires an enormous amount of work (even method overrides)
69 to perform the simplest of tasks. Things shouldn't be this way. Not in
72 This package contains Python 2.x module.
74 %description -l pl.UTF-8
75 Requests to napisana w Pythonie biblioteka HTTP dla ludzi.
77 Większość istniejących modułów Pythona do wysyłania żądań HTTP jest
78 zbyt gadatliwa i nieporęczna. Wbudowany w Pythona moduł urllib2
79 zapewnia większość wymaganych możliwości HTTP, ale API jest kiepskie -
80 wymaga dużych nakładów pracy (nawet nadpisań metod) do wykonania
81 najprostszych zadań. Nie powinno tak być. Nie w Pythonie.
83 Ten pakiet zawiera moduł dla Pythona 2.x.
85 %package -n python3-requests
86 Summary: HTTP library for Python 3
87 Summary(pl.UTF-8): Biblioteka HTTP dla Pythona 3
88 Group: Development/Languages/Python
89 Requires: python-chardet >= 3.0.2
90 Requires: python-idna >= 2.5
91 Requires: python-urllib3 >= %{urllib3ver}
92 Suggests: ca-certificates
94 %description -n python3-requests
95 Requests is a HTTP library, written in Python, for human beings.
97 Most existing Python modules for sending HTTP requests are extremely
98 verbose and cumbersome. Python's builtin urllib2 module provides most
99 of the HTTP capabilities you should need, but the api is thoroughly
100 broken. It requires an enormous amount of work (even method overrides)
101 to perform the simplest of tasks. Things shouldn't be this way. Not in
104 This package contains Python 3.x module.
106 %description -n python3-requests -l pl.UTF-8
107 Requests to napisana w Pythonie biblioteka HTTP dla ludzi.
109 Większość istniejących modułów Pythona do wysyłania żądań HTTP jest
110 zbyt gadatliwa i nieporęczna. Wbudowany w Pythona moduł urllib2
111 zapewnia większość wymaganych możliwości HTTP, ale API jest kiepskie -
112 wymaga dużych nakładów pracy (nawet nadpisań metod) do wykonania
113 najprostszych zadań. Nie powinno tak być. Nie w Pythonie.
115 Ten pakiet zawiera moduł dla Pythona 3.x.
118 %setup -q -n %{module}-%{version}
123 %py_build %{?with_tests:test}
127 %py3_build %{?with_tests:test}
131 rm -rf $RPM_BUILD_ROOT
135 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
136 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
145 rm -rf $RPM_BUILD_ROOT
149 %defattr(644,root,root,755)
150 %doc HISTORY.rst README.rst
151 %{py_sitescriptdir}/%{module}
152 %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
156 %files -n python3-requests
157 %defattr(644,root,root,755)
158 %doc HISTORY.rst README.rst
159 %{py3_sitescriptdir}/%{module}
160 %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info