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