]> git.pld-linux.org Git - packages/python3-requests.git/blame - python-requests.spec
BR: rpmbuild(macros) >= 1.710
[packages/python3-requests.git] / python-requests.spec
CommitLineData
ef9212ce 1#
8d099eee 2# Conditional build:
ae797189 3%bcond_with tests # perform "make test"
ef9212ce
JB
4%bcond_without python2 # CPython 2.x module
5%bcond_without python3 # CPython 3.x module
c29b18ec 6%bcond_without bundled # bundled libraries
8d099eee 7#
c29b18ec 8%define urllib3ver 1.10.4
8ba13116 9%define module requests
ef9212ce
JB
10Summary: HTTP library for Python 2
11Summary(pl.UTF-8): Biblioteka HTTP dla Pythona 2
8ba13116 12Name: python-%{module}
c29b18ec 13Version: 2.7.0
85ce5071 14Release: 3
a8d01621 15License: Apache2
8ba13116 16Group: Development/Languages/Python
a8d01621 17Source0: https://pypi.python.org/packages/source/r/requests/%{module}-%{version}.tar.gz
c29b18ec 18# Source0-md5: 29b173fd5fa572ec0764d1fd7b527260
a8d01621 19URL: http://python-requests.org
27c2bafe 20# find . -name '*.py' -exec sed -i -e 's#requests\.packages\.urllib3#urllib3#g' "{}" ";"
6b8cdf9f
AM
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
4a7ef446
ŁK
24Patch0: system-charade-and-urllib3.patch
25Patch1: system-cert.patch
a8d01621
ŁK
26%if %{with python2}
27BuildRequires: python-modules >= 1:2.6
27c2bafe
AM
28%if %{without bundled}
29BuildRequires: python-charade
d49507cd 30BuildRequires: python-urllib3 >= %{urllib3ver}
a8d01621 31%endif
b83f711f 32%{?with_tests:BuildRequires: python-pytest >= 2.3.4}
27c2bafe 33%endif
a8d01621 34%if %{with python3}
ef9212ce 35BuildRequires: python3-modules >= 1:3.2
27c2bafe
AM
36%if %{without bundled}
37BuildRequires: python3-charade
d49507cd 38BuildRequires: python3-urllib3 >= %{urllib3ver}
a8d01621 39%endif
b83f711f 40%{?with_tests:BuildRequires: python3-pytest >= 2.3.4}
27c2bafe 41%endif
8ba13116 42BuildRequires: rpm-pythonprov
8f95d369 43BuildRequires: rpmbuild(macros) >= 1.710
4a7ef446 44Requires: ca-certificates
a8d01621 45Requires: python-modules >= 1:2.6
27c2bafe
AM
46%if %{without bundled}
47Requires: python-charade
d49507cd 48Requires: python-urllib3 >= %{urllib3ver}
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
d49507cd 88Requires: python3-urllib3 >= %{urllib3ver}
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
e16ab944 118
8ba13116 119%build
a8d01621 120%if %{with python2}
fa6a20a6 121%py_build -b py2 %{?with_tests:test}
40323c10 122%{?with_tests:cp requirements.txt test_requests.py py2; cd py2; PYTHONPATH=$(pwd)/lib %{__python} test_requests.py; cd ..}
a8d01621 123%endif
a0c91a8e 124
a8d01621 125%if %{with python3}
fa6a20a6 126%py3_build -b py3 %{?with_tests:test}
40323c10 127%{?with_tests:cp requirements.txt test_requests.py py3; cd py3; PYTHONPATH=$(pwd)/lib %{__python3} test_requests.py; cd ..}
8d099eee 128%endif
8ba13116
MM
129
130%install
131rm -rf $RPM_BUILD_ROOT
a8d01621
ŁK
132
133%if %{with python2}
a0c91a8e 134%{__python} setup.py \
a8d01621
ŁK
135 build -b py2 \
136 install \
8ba13116
MM
137 --skip-build \
138 --optimize=2 \
139 --root=$RPM_BUILD_ROOT
4a7ef446
ŁK
140%py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
141%py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
a8d01621
ŁK
142%py_postclean
143%endif
8ba13116 144
a8d01621 145%if %{with python3}
a0c91a8e 146%{__python3} setup.py \
a8d01621
ŁK
147 build -b py3 \
148 install \
149 --skip-build \
150 --optimize=2 \
151 --root=$RPM_BUILD_ROOT
152%endif
8ba13116 153
ae797189
JB
154%{__rm} $RPM_BUILD_ROOT{%{py_sitescriptdir},%{py3_sitescriptdir}}/%{module}/cacert.pem
155%{!?with_bundled:%{__rm} -r $RPM_BUILD_ROOT{%{py_sitescriptdir},%{py3_sitescriptdir}}/%{module}/packages}
4a7ef446 156
8ba13116
MM
157%clean
158rm -rf $RPM_BUILD_ROOT
159
a8d01621 160%if %{with python2}
8ba13116
MM
161%files
162%defattr(644,root,root,755)
a8d01621 163%doc HISTORY.rst README.rst
8ba13116 164%{py_sitescriptdir}/%{module}
8d099eee 165%{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
a8d01621 166%endif
a0c91a8e 167
a8d01621 168%if %{with python3}
a0c91a8e
KK
169%files -n python3-requests
170%defattr(644,root,root,755)
a8d01621 171%doc HISTORY.rst README.rst
a0c91a8e 172%{py3_sitescriptdir}/%{module}
8d099eee 173%{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
a8d01621 174%endif
This page took 0.054502 seconds and 4 git commands to generate.