]> git.pld-linux.org Git - packages/python-requests.git/blame - python-requests.spec
- offline tests
[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
762b662a 25Patch2: requests-test.patch
a8d01621
ŁK
26%if %{with python2}
27BuildRequires: python-modules >= 1:2.6
27c2bafe
AM
28%if %{without bundled}
29BuildRequires: python-charade
9e57f9c2 30BuildRequires: python-urllib3 >= 1.9.1
a8d01621 31%endif
40323c10 32%{?with_tests:BuildRequires: python-pytest}
27c2bafe 33%endif
a8d01621 34%if %{with python3}
ef9212ce 35BuildRequires: python3-modules >= 1:3.2
27c2bafe
AM
36%if %{without bundled}
37BuildRequires: python3-charade
9e57f9c2 38BuildRequires: python3-urllib3 >= 1.9.1
a8d01621 39%endif
40323c10 40%{?with_tests:BuildRequires: python3-pytest}
27c2bafe 41%endif
8ba13116
MM
42BuildRequires: rpm-pythonprov
43BuildRequires: rpmbuild(macros) >= 1.219
4a7ef446 44Requires: ca-certificates
a8d01621 45Requires: python-modules >= 1:2.6
27c2bafe
AM
46%if %{without bundled}
47Requires: python-charade
9e57f9c2 48Requires: python-urllib3 >= 1.9.1
27c2bafe 49%endif
e7d50ac0
AM
50# for python2 only to get SNI working. python3 doesn't need this
51Requires: python-ndg-httpsclient
52Requires: python-pyasn1
53Requires: python-pyOpenSSL
8ba13116
MM
54BuildArch: noarch
55BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
56
57%description
a8d01621 58Requests is a HTTP library, written in Python, for human beings.
8ba13116
MM
59
60Most existing Python modules for sending HTTP requests are extremely
61verbose and cumbersome. Python's builtin urllib2 module provides most
8d099eee 62of the HTTP capabilities you should need, but the API is thoroughly
8ba13116 63broken. It requires an enormous amount of work (even method overrides)
8d099eee
JB
64to perform the simplest of tasks. Things shouldn't be this way. Not in
65Python.
66
ef9212ce
JB
67This package contains Python 2.x module.
68
8d099eee 69%description -l pl.UTF-8
a8d01621 70Requests to napisana w Pythonie biblioteka HTTP dla ludzi.
8ba13116 71
8d099eee
JB
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.
8ba13116 77
ef9212ce
JB
78Ten pakiet zawiera moduł dla Pythona 2.x.
79
a0c91a8e 80%package -n python3-requests
ef9212ce
JB
81Summary: HTTP library for Python 3
82Summary(pl.UTF-8): Biblioteka HTTP dla Pythona 3
a0c91a8e 83Group: Development/Languages/Python
4a7ef446 84Requires: ca-certificates
ef9212ce 85Requires: python3-modules >= 1:3.2
27c2bafe
AM
86%if %{without bundled}
87Requires: python3-charade
9e57f9c2 88Requires: python3-urllib3 >= 1.9.1
27c2bafe 89%endif
a0c91a8e
KK
90
91%description -n python3-requests
a8d01621 92Requests is a HTTP library, written in Python, for human beings.
a0c91a8e
KK
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)
8d099eee
JB
98to perform the simplest of tasks. Things shouldn't be this way. Not in
99Python.
100
ef9212ce
JB
101This package contains Python 3.x module.
102
8d099eee 103%description -n python3-requests -l pl.UTF-8
a8d01621 104Requests to napisana w Pythonie biblioteka HTTP dla ludzi.
a0c91a8e 105
a8d01621
ŁK
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.
a0c91a8e 111
ef9212ce
JB
112Ten pakiet zawiera moduł dla Pythona 3.x.
113
8ba13116 114%prep
a8d01621 115%setup -q -n %{module}-%{version}
27c2bafe 116%{!?with_bundled:%patch0 -p1}
4a7ef446 117%patch1 -p1
762b662a 118%patch2 -p1
e16ab944 119
8ba13116 120%build
a8d01621 121%if %{with python2}
27c2bafe 122%{__python} setup.py build -b py2 %{?with_tests:test}
40323c10 123%{?with_tests:cp requirements.txt test_requests.py py2; cd py2; PYTHONPATH=$(pwd)/lib %{__python} test_requests.py; cd ..}
a8d01621 124%endif
a0c91a8e 125
a8d01621 126%if %{with python3}
27c2bafe 127%{__python3} setup.py build -b py3 %{?with_tests:test}
40323c10 128%{?with_tests:cp requirements.txt test_requests.py py3; cd py3; PYTHONPATH=$(pwd)/lib %{__python3} test_requests.py; cd ..}
8d099eee 129%endif
8ba13116
MM
130
131%install
132rm -rf $RPM_BUILD_ROOT
a8d01621
ŁK
133
134%if %{with python2}
a0c91a8e 135%{__python} setup.py \
a8d01621
ŁK
136 build -b py2 \
137 install \
8ba13116
MM
138 --skip-build \
139 --optimize=2 \
140 --root=$RPM_BUILD_ROOT
4a7ef446
ŁK
141%py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
142%py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
a8d01621
ŁK
143%py_postclean
144%endif
8ba13116 145
a8d01621 146%if %{with python3}
a0c91a8e 147%{__python3} setup.py \
a8d01621
ŁK
148 build -b py3 \
149 install \
150 --skip-build \
151 --optimize=2 \
152 --root=$RPM_BUILD_ROOT
153%endif
8ba13116 154
27c2bafe
AM
155%{__rm} -rf $RPM_BUILD_ROOT{%{py_sitescriptdir},%{py3_sitescriptdir}}/%{module}/cacert.pem
156%{!?with_bundled:%{__rm} -rf $RPM_BUILD_ROOT{%{py_sitescriptdir},%{py3_sitescriptdir}}/%{module}/packages}
4a7ef446 157
8ba13116
MM
158%clean
159rm -rf $RPM_BUILD_ROOT
160
a8d01621 161%if %{with python2}
8ba13116
MM
162%files
163%defattr(644,root,root,755)
a8d01621 164%doc HISTORY.rst README.rst
8ba13116 165%{py_sitescriptdir}/%{module}
8d099eee 166%{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
a8d01621 167%endif
a0c91a8e 168
a8d01621 169%if %{with python3}
a0c91a8e
KK
170%files -n python3-requests
171%defattr(644,root,root,755)
a8d01621 172%doc HISTORY.rst README.rst
a0c91a8e 173%{py3_sitescriptdir}/%{module}
8d099eee 174%{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
a8d01621 175%endif
This page took 0.134072 seconds and 4 git commands to generate.