]> git.pld-linux.org Git - packages/python3-requests.git/blob - python-requests.spec
- release 2 (by relup.sh)
[packages/python3-requests.git] / python-requests.spec
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.10.4
9 %define         module  requests
10 Summary:        HTTP library for Python 2
11 Summary(pl.UTF-8):      Biblioteka HTTP dla Pythona 2
12 Name:           python-%{module}
13 Version:        2.7.0
14 Release:        2
15 License:        Apache2
16 Group:          Development/Languages/Python
17 Source0:        https://pypi.python.org/packages/source/r/requests/%{module}-%{version}.tar.gz
18 # Source0-md5:  29b173fd5fa572ec0764d1fd7b527260
19 URL:            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
24 Patch0:         system-charade-and-urllib3.patch
25 Patch1:         system-cert.patch
26 %if %{with python2}
27 BuildRequires:  python-modules >= 1:2.6
28 %if %{without bundled}
29 BuildRequires:  python-charade
30 BuildRequires:  python-urllib3 >= %{urllib3ver}
31 %endif
32 %{?with_tests:BuildRequires:    python-pytest >= 2.3.4}
33 %endif
34 %if %{with python3}
35 BuildRequires:  python3-modules >= 1:3.2
36 %if %{without bundled}
37 BuildRequires:  python3-charade
38 BuildRequires:  python3-urllib3 >= %{urllib3ver}
39 %endif
40 %{?with_tests:BuildRequires:    python3-pytest >= 2.3.4}
41 %endif
42 BuildRequires:  rpm-pythonprov
43 BuildRequires:  rpmbuild(macros) >= 1.219
44 Requires:       ca-certificates
45 Requires:       python-modules >= 1:2.6
46 %if %{without bundled}
47 Requires:       python-charade
48 Requires:       python-urllib3 >= %{urllib3ver}
49 %endif
50 # for python2 only to get SNI working. python3 doesn't need this
51 Requires:       python-ndg-httpsclient
52 Requires:       python-pyasn1
53 Requires:       python-pyOpenSSL
54 BuildArch:      noarch
55 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
56
57 %description
58 Requests is a HTTP library, written in Python, for human beings.
59
60 Most existing Python modules for sending HTTP requests are extremely
61 verbose and cumbersome. Python's builtin urllib2 module provides most
62 of the HTTP capabilities you should need, but the API is thoroughly
63 broken. It requires an enormous amount of work (even method overrides)
64 to perform the simplest of tasks. Things shouldn't be this way. Not in
65 Python.
66
67 This package contains Python 2.x module.
68
69 %description -l pl.UTF-8
70 Requests to napisana w Pythonie biblioteka HTTP dla ludzi.
71
72 Większość istniejących modułów Pythona do wysyłania żądań HTTP jest
73 zbyt gadatliwa i nieporęczna. Wbudowany w Pythona moduł urllib2
74 zapewnia większość wymaganych możliwości HTTP, ale API jest kiepskie -
75 wymaga dużych nakładów pracy (nawet nadpisań metod) do wykonania
76 najprostszych zadań. Nie powinno tak być. Nie w Pythonie.
77
78 Ten pakiet zawiera moduł dla Pythona 2.x.
79
80 %package -n python3-requests
81 Summary:        HTTP library for Python 3
82 Summary(pl.UTF-8):      Biblioteka HTTP dla Pythona 3
83 Group:          Development/Languages/Python
84 Requires:       ca-certificates
85 Requires:       python3-modules >= 1:3.2
86 %if %{without bundled}
87 Requires:       python3-charade
88 Requires:       python3-urllib3 >= %{urllib3ver}
89 %endif
90
91 %description -n python3-requests
92 Requests is a HTTP library, written in Python, for human beings.
93
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
99 Python.
100
101 This package contains Python 3.x module.
102
103 %description -n python3-requests -l pl.UTF-8
104 Requests to napisana w Pythonie biblioteka HTTP dla ludzi.
105
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.
111
112 Ten 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 %{__python} setup.py build -b py2 %{?with_tests:test}
122 %{?with_tests:cp requirements.txt test_requests.py py2; cd py2; PYTHONPATH=$(pwd)/lib %{__python} test_requests.py; cd ..}
123 %endif
124
125 %if %{with python3}
126 %{__python3} setup.py build -b py3 %{?with_tests:test}
127 %{?with_tests:cp requirements.txt test_requests.py py3; cd py3; PYTHONPATH=$(pwd)/lib %{__python3} test_requests.py; cd ..}
128 %endif
129
130 %install
131 rm -rf $RPM_BUILD_ROOT
132
133 %if %{with python2}
134 %{__python} setup.py \
135         build -b py2 \
136         install \
137         --skip-build \
138         --optimize=2 \
139         --root=$RPM_BUILD_ROOT
140 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
141 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
142 %py_postclean
143 %endif
144
145 %if %{with python3}
146 %{__python3} setup.py  \
147         build -b py3 \
148         install \
149         --skip-build \
150         --optimize=2 \
151         --root=$RPM_BUILD_ROOT
152 %endif
153
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}
156
157 %clean
158 rm -rf $RPM_BUILD_ROOT
159
160 %if %{with python2}
161 %files
162 %defattr(644,root,root,755)
163 %doc HISTORY.rst README.rst
164 %{py_sitescriptdir}/%{module}
165 %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
166 %endif
167
168 %if %{with python3}
169 %files -n python3-requests
170 %defattr(644,root,root,755)
171 %doc HISTORY.rst README.rst
172 %{py3_sitescriptdir}/%{module}
173 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
174 %endif
This page took 0.067545 seconds and 4 git commands to generate.