]> git.pld-linux.org Git - packages/python-requests.git/blame_incremental - python-requests.spec
- urllib 1.13
[packages/python-requests.git] / python-requests.spec
... / ...
CommitLineData
1#
2# Conditional build:
3%bcond_with tests # perform "make test"
4%bcond_without python2 # CPython 2.x module
5%bcond_without python3 # CPython 3.x module
6%bcond_without bundled # bundled libraries
7#
8%define urllib3ver 1.13
9%define module requests
10Summary: HTTP library for Python 2
11Summary(pl.UTF-8): Biblioteka HTTP dla Pythona 2
12Name: python-%{module}
13Version: 2.9.1
14Release: 1
15License: Apache2
16Group: Development/Languages/Python
17Source0: https://pypi.python.org/packages/source/r/requests/%{module}-%{version}.tar.gz
18# Source0-md5: 0b7f480d19012ec52bab78292efd976d
19URL: http://python-requests.org
20# find . -name '*.py' -exec sed -i -e 's#requests\.packages\.urllib3#urllib3#g' "{}" ";"
21# find . -name '*.py' -exec sed -i -e 's#\.packages\.urllib3#urllib3#g' "{}" ";"
22# find . -name '*.py' -exec sed -i -e 's#from \.packages import chardet#import charade as chardet#g' "{}" ";"
23# + manual removal from setup.py
24Patch0: system-charade-and-urllib3.patch
25Patch1: system-cert.patch
26%if %{with python2}
27BuildRequires: python-modules >= 1:2.6
28%if %{without bundled}
29BuildRequires: python-charade
30BuildRequires: python-urllib3 >= %{urllib3ver}
31%endif
32%{?with_tests:BuildRequires: python-pytest >= 2.3.4}
33%endif
34%if %{with python3}
35BuildRequires: python3-modules >= 1:3.2
36%if %{without bundled}
37BuildRequires: python3-charade
38BuildRequires: python3-urllib3 >= %{urllib3ver}
39%endif
40%{?with_tests:BuildRequires: python3-pytest >= 2.3.4}
41%endif
42BuildRequires: rpm-pythonprov
43BuildRequires: rpmbuild(macros) >= 1.713
44Requires: ca-certificates
45Requires: python-modules >= 1:2.6
46%if %{without bundled}
47Requires: python-charade
48Requires: python-urllib3 >= %{urllib3ver}
49%endif
50# for python2 only to get SNI working. python3 doesn't need this
51Requires: python-ndg-httpsclient
52Requires: python-pyasn1
53Requires: python-pyOpenSSL
54BuildArch: noarch
55BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
56
57%description
58Requests is a HTTP library, written in Python, for human beings.
59
60Most existing Python modules for sending HTTP requests are extremely
61verbose and cumbersome. Python's builtin urllib2 module provides most
62of the HTTP capabilities you should need, but the API is thoroughly
63broken. It requires an enormous amount of work (even method overrides)
64to perform the simplest of tasks. Things shouldn't be this way. Not in
65Python.
66
67This package contains Python 2.x module.
68
69%description -l pl.UTF-8
70Requests to napisana w Pythonie biblioteka HTTP dla ludzi.
71
72Większość istniejących modułów Pythona do wysyłania żądań HTTP jest
73zbyt gadatliwa i nieporęczna. Wbudowany w Pythona moduł urllib2
74zapewnia większość wymaganych możliwości HTTP, ale API jest kiepskie -
75wymaga dużych nakładów pracy (nawet nadpisań metod) do wykonania
76najprostszych zadań. Nie powinno tak być. Nie w Pythonie.
77
78Ten pakiet zawiera moduł dla Pythona 2.x.
79
80%package -n python3-requests
81Summary: HTTP library for Python 3
82Summary(pl.UTF-8): Biblioteka HTTP dla Pythona 3
83Group: Development/Languages/Python
84Requires: ca-certificates
85Requires: python3-modules >= 1:3.2
86%if %{without bundled}
87Requires: python3-charade
88Requires: python3-urllib3 >= %{urllib3ver}
89%endif
90
91%description -n python3-requests
92Requests is a HTTP library, written in Python, for human beings.
93
94Most existing Python modules for sending HTTP requests are extremely
95verbose and cumbersome. Python's builtin urllib2 module provides most
96of the HTTP capabilities you should need, but the api is thoroughly
97broken. It requires an enormous amount of work (even method overrides)
98to perform the simplest of tasks. Things shouldn't be this way. Not in
99Python.
100
101This package contains Python 3.x module.
102
103%description -n python3-requests -l pl.UTF-8
104Requests to napisana w Pythonie biblioteka HTTP dla ludzi.
105
106Większość istniejących modułów Pythona do wysyłania żądań HTTP jest
107zbyt gadatliwa i nieporęczna. Wbudowany w Pythona moduł urllib2
108zapewnia większość wymaganych możliwości HTTP, ale API jest kiepskie -
109wymaga dużych nakładów pracy (nawet nadpisań metod) do wykonania
110najprostszych zadań. Nie powinno tak być. Nie w Pythonie.
111
112Ten pakiet zawiera moduł dla Pythona 3.x.
113
114%prep
115%setup -q -n %{module}-%{version}
116%{!?with_bundled:%patch0 -p1}
117%patch1 -p1
118
119%build
120%if %{with python2}
121%py_build %{?with_tests:test}
122%{?with_tests:cp requirements.txt test_requests.py build-2; cd build-2; PYTHONPATH=$(pwd)/lib %{__python} test_requests.py; cd ..}
123%endif
124
125%if %{with python3}
126%py3_build %{?with_tests:test}
127%{?with_tests:cp requirements.txt test_requests.py build-3; cd build-3; PYTHONPATH=$(pwd)/lib %{__python3} test_requests.py; cd ..}
128%endif
129
130%install
131rm -rf $RPM_BUILD_ROOT
132
133%if %{with python2}
134%py_install
135%py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
136%py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
137%py_postclean
138%endif
139
140%if %{with python3}
141%py3_install
142%endif
143
144%{__rm} $RPM_BUILD_ROOT{%{py_sitescriptdir},%{py3_sitescriptdir}}/%{module}/cacert.pem
145%{!?with_bundled:%{__rm} -r $RPM_BUILD_ROOT{%{py_sitescriptdir},%{py3_sitescriptdir}}/%{module}/packages}
146
147%clean
148rm -rf $RPM_BUILD_ROOT
149
150%if %{with python2}
151%files
152%defattr(644,root,root,755)
153%doc HISTORY.rst README.rst
154%{py_sitescriptdir}/%{module}
155%{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
156%endif
157
158%if %{with python3}
159%files -n python3-requests
160%defattr(644,root,root,755)
161%doc HISTORY.rst README.rst
162%{py3_sitescriptdir}/%{module}
163%{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
164%endif
This page took 0.026438 seconds and 4 git commands to generate.