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