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
6 %bcond_without bundled # bundled libraries
8 %define urllib3ver 1.20
9 %define module requests
10 Summary: HTTP library for Python 2
11 Summary(pl.UTF-8): Biblioteka HTTP dla Pythona 2
12 Name: python-%{module}
16 Group: Development/Languages/Python
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
20 Patch1: system-cert.patch
21 URL: http://python-requests.org/
23 BuildRequires: python-modules >= 1:2.6
24 %if %{without bundled}
25 BuildRequires: python-chardet >= 2.3.0
26 BuildRequires: python-urllib3 >= %{urllib3ver}
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
36 BuildRequires: python3-modules >= 1:3.2
37 %if %{without bundled}
38 BuildRequires: python3-chardet >= 2.3.0
39 BuildRequires: python3-urllib3 >= %{urllib3ver}
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
48 BuildRequires: rpm-pythonprov
49 BuildRequires: rpmbuild(macros) >= 1.713
50 Requires: ca-certificates
51 Requires: python-idna >= 2.0.0
52 Requires: python-modules >= 1:2.6
53 %if %{without bundled}
54 Requires: python-chardet >= 2.3.0
55 Requires: python-urllib3 >= %{urllib3ver}
57 # for python2 only to get SNI working. python3 doesn't need this
58 Requires: python-ndg-httpsclient
59 Requires: python-pyasn1
60 Requires: python-pyOpenSSL >= 0.14
62 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
65 Requests is a HTTP library, written in Python, for human beings.
67 Most existing Python modules for sending HTTP requests are extremely
68 verbose and cumbersome. Python's builtin urllib2 module provides most
69 of the HTTP capabilities you should need, but the API is thoroughly
70 broken. It requires an enormous amount of work (even method overrides)
71 to perform the simplest of tasks. Things shouldn't be this way. Not in
74 This package contains Python 2.x module.
76 %description -l pl.UTF-8
77 Requests to napisana w Pythonie biblioteka HTTP dla ludzi.
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.
85 Ten pakiet zawiera moduł dla Pythona 2.x.
87 %package -n python3-requests
88 Summary: HTTP library for Python 3
89 Summary(pl.UTF-8): Biblioteka HTTP dla Pythona 3
90 Group: Development/Languages/Python
91 Requires: ca-certificates
92 Requires: python3-modules >= 1:3.2
93 %if %{without bundled}
94 Requires: python3-chardet >= 2.3.0
95 Requires: python3-idna >= 2.0.0
96 Requires: python3-urllib3 >= %{urllib3ver}
99 %description -n python3-requests
100 Requests is a HTTP library, written in Python, for human beings.
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)
106 to perform the simplest of tasks. Things shouldn't be this way. Not in
109 This package contains Python 3.x module.
111 %description -n python3-requests -l pl.UTF-8
112 Requests to napisana w Pythonie biblioteka HTTP dla ludzi.
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.
120 Ten pakiet zawiera moduł dla Pythona 3.x.
123 %setup -q -n %{module}-%{version}
124 %{!?with_bundled:%patch0 -p1}
129 %py_build %{?with_tests:test}
133 %py3_build %{?with_tests:test}
137 rm -rf $RPM_BUILD_ROOT
141 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
142 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
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}
154 rm -rf $RPM_BUILD_ROOT
158 %defattr(644,root,root,755)
159 %doc HISTORY.rst README.rst
160 %{py_sitescriptdir}/%{module}
161 %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
165 %files -n python3-requests
166 %defattr(644,root,root,755)
167 %doc HISTORY.rst README.rst
168 %{py3_sitescriptdir}/%{module}
169 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info