]> git.pld-linux.org Git - packages/python-urllib3.git/blob - python-urllib3.spec
up to 1.26.18
[packages/python-urllib3.git] / python-urllib3.spec
1 # TODO: use system six, [backports.]ssl_match_hostname
2 #
3 # Conditional build:
4 %bcond_without  python2 # CPython 2.x module
5 %bcond_without  python3 # CPython 3.x module
6 %bcond_without  doc     # Sphinx documentation
7 %bcond_with     tests   # test target (uses network etc., few failures)
8
9 %define         module          urllib3
10 Summary:        HTTP library with thread-safe connection pooling, file post, and more
11 Summary(pl.UTF-8):      Biblioteka HTTP z bezpieczną wątkowo pulą połączeń, wysyłaniem plików itd.
12 Name:           python-%{module}
13 # note: maintain versions compatible with python-requests.spec
14 Version:        1.26.18
15 Release:        1
16 License:        MIT
17 Group:          Development/Languages/Python
18 #Source0Download: https://pypi.org/simple/urllib3/
19 Source0:        https://files.pythonhosted.org/packages/source/u/urllib3/%{module}-%{version}.tar.gz
20 # Source0-md5:  f986d8e9616d2a43389f678d5dad9893
21 Patch0:         %{name}-mock.patch
22 Patch1:         %{name}-httplib.patch
23 URL:            https://urllib3.readthedocs.io/
24 %if %(locale -a | grep -q '^C\.utf8$'; echo $?)
25 BuildRequires:  glibc-localedb-all
26 %endif
27 %if %{with python2}
28 BuildRequires:  python >= 1:2.7
29 BuildRequires:  python-modules >= 1:2.7
30 BuildRequires:  python-setuptools
31 %if %{with tests}
32 BuildRequires:  python-PySocks >= 1.7.1
33 BuildRequires:  python-PySocks < 2.0
34 BuildRequires:  python-cryptography >= 2.8
35 BuildRequires:  python-dateutil >= 2.8.1
36 BuildRequires:  python-flaky >= 3.6.1
37 # TODO
38 #BuildRequires: python-gcp_devrel-py-tools >= 0.0.15
39 BuildRequires:  python-mock >= 3.0.5
40 BuildRequires:  python-pytest >= 4.6.9
41 BuildRequires:  python-pytest-freezegun >= 0.3.0
42 BuildRequires:  python-pytest-timeout >= 1.3.4
43 BuildRequires:  python-tornado >= 5.1.1
44 BuildRequires:  python-trustme >= 0.5.3
45 # SO_REUSEPORT option
46 BuildRequires:  uname(release) >= 3.9
47 %endif
48 %endif
49 %if %{with python3}
50 BuildRequires:  python3 >= 1:3.5
51 BuildRequires:  python3-modules >= 1:3.5
52 BuildRequires:  python3-setuptools
53 %if %{with tests}
54 BuildRequires:  python3-PySocks >= 1.7.1
55 BuildRequires:  python3-PySocks < 2.0
56 BuildRequires:  python3-cryptography >= 2.8
57 BuildRequires:  python3-dateutil >= 2.8.1
58 BuildRequires:  python3-flaky >= 3.6.1
59 #BuildRequires: python3-gcp_devrel-py-tools >= 0.0.15
60 BuildRequires:  python3-pytest >= 4.6.9
61 BuildRequires:  python3-pytest-freezegun >= 0.4.2
62 BuildRequires:  python3-pytest-timeout >= 1.3.4
63 BuildRequires:  python3-tornado >= 6.0.3
64 BuildRequires:  python3-trustme >= 0.5.3
65 # SO_REUSEPORT option
66 BuildRequires:  uname(release) >= 3.9
67 %endif
68 %endif
69 BuildRequires:  rpm-pythonprov
70 BuildRequires:  rpmbuild(macros) >= 1.714
71 %if %{with doc}
72 BuildRequires:  python3-furo
73 BuildRequires:  python3-requests >= 2
74 BuildRequires:  sphinx-pdg-3 >= 3.0
75 %endif
76 Requires:       python-modules >= 1:2.7
77 BuildArch:      noarch
78 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
79
80 %description
81 Python 2 HTTP module with connection pooling and file POST abilities.
82 Features are:
83 - Re-use the same socket connection for multiple requests (with
84   optional client-side certificate verification).
85 - File posting (encode_multipart_formdata).
86 - Built-in redirection and retries (optional).
87 - Supports gzip and deflate decoding.
88 - Thread-safe and sanity-safe.
89
90 %description -l pl.UTF-8
91 Moduł HTTP dla Pythona 2 z pulą połączeń i możliwością wysyłania
92 plików metodą POST. Możliwości:
93 - używanie tego samego połączenia dla wielu żądań (z opcjonalną
94   weryfikacją certyfikatu po stronie klienta)
95 - wysyłanie plików (encode_multipart_formdata)
96 - wbudowane przekierowania i ponawianie prób (opcjonalne)
97 - obsługa kodowań gzip i deflate
98 - bezpieczeństwo względem wątków.
99
100 %package -n python3-urllib3
101 Summary:        HTTP library with thread-safe connection pooling, file post, and more
102 Summary(pl.UTF-8):      Biblioteka HTTP z bezpieczną wątkowo pulą połączeń, wysyłaniem plików itd.
103 Group:          Development/Languages/Python
104 Requires:       python3-modules >= 1:3.5
105
106 %description -n python3-urllib3
107 Python 3 HTTP module with connection pooling and file POST abilities.
108 Features are:
109 - Re-use the same socket connection for multiple requests (with
110   optional client-side certificate verification).
111 - File posting (encode_multipart_formdata).
112 - Built-in redirection and retries (optional).
113 - Supports gzip and deflate decoding.
114 - Thread-safe and sanity-safe.
115
116 %description -n python3-urllib3 -l pl.UTF-8
117 Moduł HTTP dla Pythona 3 z pulą połączeń i możliwością wysyłania
118 plików metodą POST. Możliwości:
119 - używanie tego samego połączenia dla wielu żądań (z opcjonalną
120   weryfikacją certyfikatu po stronie klienta)
121 - wysyłanie plików (encode_multipart_formdata)
122 - wbudowane przekierowania i ponawianie prób (opcjonalne)
123 - obsługa kodowań gzip i deflate
124 - bezpieczeństwo względem wątków.
125
126 %package apidocs
127 Summary:        API documentation for Python urllib3 module
128 Summary(pl.UTF-8):      Dokumentacja API modułu Pythona urllib3
129 Group:          Documentation
130
131 %description apidocs
132 API documentation for Python urllib3 module.
133
134 %description apidocs -l pl.UTF-8
135 Dokumentacja API modułu Pythona urllib3.
136
137 %prep
138 %setup -q -n %{module}-%{version}
139 %patch0 -p1
140 %patch1 -p1
141
142 %build
143 %if %{with python2}
144 %py_build
145
146 %if %{with tests}
147 # RECENT_DATE is too old
148 # test_retry.py: many failures with py2
149 # TestSSL: unknown ca, timeout errors etc.
150 LC_ALL=C.UTF-8 \
151 PYTHONPATH=$(pwd)/src \
152 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
153 PYTEST_PLUGINS="flaky.flaky_pytest_plugin,pytest_freezegun,pytest_timeout" \
154 %{__python} -m pytest test -k 'not (test_recent_date or test_retry or test_ssl_read_timeout or test_ssl_failed_fingerprint_verification)'
155 # or TestSSL)'
156 %endif
157 %endif
158
159 %if %{with python3}
160 %py3_build
161
162 %if %{with tests}
163 # RECENT_DATE is too old
164 # TestSSL: verification errors
165 PYTHONPATH=$(pwd)/src \
166 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
167 PYTEST_PLUGINS="flaky.flaky_pytest_plugin,pytest_freezegun,pytest_timeout" \
168 %{__python3} -m pytest test -k 'not (test_recent_date or test_ssl_read_timeout or test_ssl_failed_fingerprint_verification)'
169 %endif
170 %endif
171
172 %if %{with doc}
173 %{__make} -C docs html \
174         SPHINXBUILD=sphinx-build-3 \
175         SPHINXOPTS=
176 %endif
177
178 %install
179 rm -rf $RPM_BUILD_ROOT
180
181 %if %{with python2}
182 %py_install
183
184 %py_postclean
185 %endif
186
187 %if %{with python3}
188 %py3_install
189 %endif
190
191 %clean
192 rm -rf $RPM_BUILD_ROOT
193
194 %if %{with python2}
195 %files
196 %defattr(644,root,root,755)
197 %doc CHANGES.rst LICENSE.txt README.rst
198 %{py_sitescriptdir}/%{module}
199 %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
200 %endif
201
202 %if %{with python3}
203 %files -n python3-urllib3
204 %defattr(644,root,root,755)
205 %doc CHANGES.rst LICENSE.txt README.rst
206 %{py3_sitescriptdir}/%{module}
207 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
208 %endif
209
210 %if %{with doc}
211 %files apidocs
212 %defattr(644,root,root,755)
213 %doc docs/_build/html/{_static,reference,*.html,*.js}
214 %endif
This page took 1.613147 seconds and 3 git commands to generate.