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 Summary: HTTP library for Python 2
10 Summary(pl.UTF-8): Biblioteka HTTP dla Pythona 2
11 Name: python-%{module}
15 Group: Development/Languages/Python
16 Source0: https://pypi.python.org/packages/07/2e/81fdfdfac91cf3cb2518fb149ac67caf0e081b485eab68e9aee63396f7e8/requests-2.18.2.tar.gz
17 # Source0-md5: 49bd9924d3be341871bc922cde6f372e
18 Patch0: system-cert.patch
19 URL: http://python-requests.org/
21 BuildRequires: python-modules >= 1:2.6
23 BuildRequires: python-chardet >= 3.0.2
24 BuildRequires: python-idna >= 2.5
25 BuildRequires: python-urllib3 >= %{urllib3ver}
26 BuildRequires: python-certifi >= 2017.4.17
27 BuildRequires: python-pytest >= 2.8.0
28 BuildRequires: python-pytest-cov
29 BuildRequires: python-pytest-httpbin >= 0.0.7
30 BuildRequires: python-pytest-mock
34 BuildRequires: python3-modules >= 1:3.2
36 BuildRequires: python3-chardet >= 3.0.2
37 BuildRequires: python3-idna >= 2.5
38 BuildRequires: python3-urllib3 >= %{urllib3ver}
39 BuildRequires: python3-certifi >= 2017.4.17
40 BuildRequires: python3-pytest >= 2.8.0
41 BuildRequires: python3-pytest-cov
42 BuildRequires: python3-pytest-httpbin >= 0.0.7
43 BuildRequires: python3-pytest-mock
46 BuildRequires: rpm-pythonprov
47 BuildRequires: rpmbuild(macros) >= 1.713
48 Suggests: ca-certificates
49 Requires: python-chardet >= 3.0.2
50 Requires: python-idna >= 2.5
51 Requires: python-urllib3 >= %{urllib3ver}
52 # for python2 only to get SNI working. python3 doesn't need this
53 Requires: python-ndg-httpsclient
54 Requires: python-pyasn1
55 Requires: python-pyOpenSSL >= 0.14
57 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
60 Requests is a HTTP library, written in Python, for human beings.
62 Most existing Python modules for sending HTTP requests are extremely
63 verbose and cumbersome. Python's builtin urllib2 module provides most
64 of the HTTP capabilities you should need, but the API is thoroughly
65 broken. It requires an enormous amount of work (even method overrides)
66 to perform the simplest of tasks. Things shouldn't be this way. Not in
69 This package contains Python 2.x module.
71 %description -l pl.UTF-8
72 Requests to napisana w Pythonie biblioteka HTTP dla ludzi.
74 Większość istniejących modułów Pythona do wysyłania żądań HTTP jest
75 zbyt gadatliwa i nieporęczna. Wbudowany w Pythona moduł urllib2
76 zapewnia większość wymaganych możliwości HTTP, ale API jest kiepskie -
77 wymaga dużych nakładów pracy (nawet nadpisań metod) do wykonania
78 najprostszych zadań. Nie powinno tak być. Nie w Pythonie.
80 Ten pakiet zawiera moduł dla Pythona 2.x.
82 %package -n python3-requests
83 Summary: HTTP library for Python 3
84 Summary(pl.UTF-8): Biblioteka HTTP dla Pythona 3
85 Group: Development/Languages/Python
86 Suggests: ca-certificates
87 Requires: python-chardet >= 3.0.2
88 Requires: python-idna >= 2.5
89 Requires: python-urllib3 >= %{urllib3ver}
91 %description -n python3-requests
92 Requests is a HTTP library, written in Python, for human beings.
94 Most existing Python modules for sending HTTP requests are extremely
95 verbose and cumbersome. Python's builtin urllib2 module provides most
96 of the HTTP capabilities you should need, but the api is thoroughly
97 broken. It requires an enormous amount of work (even method overrides)
98 to perform the simplest of tasks. Things shouldn't be this way. Not in
101 This package contains Python 3.x module.
103 %description -n python3-requests -l pl.UTF-8
104 Requests to napisana w Pythonie biblioteka HTTP dla ludzi.
106 Większość istniejących modułów Pythona do wysyłania żądań HTTP jest
107 zbyt gadatliwa i nieporęczna. Wbudowany w Pythona moduł urllib2
108 zapewnia większość wymaganych możliwości HTTP, ale API jest kiepskie -
109 wymaga dużych nakładów pracy (nawet nadpisań metod) do wykonania
110 najprostszych zadań. Nie powinno tak być. Nie w Pythonie.
112 Ten pakiet zawiera moduł dla Pythona 3.x.
115 %setup -q -n %{module}-%{version}
120 %py_build %{?with_tests:test}
124 %py3_build %{?with_tests:test}
128 rm -rf $RPM_BUILD_ROOT
132 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
133 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
142 rm -rf $RPM_BUILD_ROOT
146 %defattr(644,root,root,755)
147 %doc HISTORY.rst README.rst
148 %{py_sitescriptdir}/%{module}
149 %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
153 %files -n python3-requests
154 %defattr(644,root,root,755)
155 %doc HISTORY.rst README.rst
156 %{py3_sitescriptdir}/%{module}
157 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info