]> git.pld-linux.org Git - packages/python-urllib3.git/blame - python-urllib3.spec
up to 1.26.18
[packages/python-urllib3.git] / python-urllib3.spec
CommitLineData
fb337b23 1# TODO: use system six, [backports.]ssl_match_hostname
d1b278cf 2#
f980972e 3# Conditional build:
d1b278cf
JB
4%bcond_without python2 # CPython 2.x module
5%bcond_without python3 # CPython 3.x module
1cbae8fc 6%bcond_without doc # Sphinx documentation
f5006321 7%bcond_with tests # test target (uses network etc., few failures)
5381b073
ER
8
9%define module urllib3
f980972e 10Summary: HTTP library with thread-safe connection pooling, file post, and more
d1b278cf 11Summary(pl.UTF-8): Biblioteka HTTP z bezpieczną wątkowo pulą połączeń, wysyłaniem plików itd.
f980972e 12Name: python-%{module}
65b3314d 13# note: maintain versions compatible with python-requests.spec
2ca24533 14Version: 1.26.18
ec94c334 15Release: 1
f980972e
ŁK
16License: MIT
17Group: Development/Languages/Python
70df9369 18#Source0Download: https://pypi.org/simple/urllib3/
1cbae8fc 19Source0: https://files.pythonhosted.org/packages/source/u/urllib3/%{module}-%{version}.tar.gz
2ca24533 20# Source0-md5: f986d8e9616d2a43389f678d5dad9893
70df9369 21Patch0: %{name}-mock.patch
f5006321 22Patch1: %{name}-httplib.patch
65b3314d 23URL: https://urllib3.readthedocs.io/
f5006321
JB
24%if %(locale -a | grep -q '^C\.utf8$'; echo $?)
25BuildRequires: glibc-localedb-all
26%endif
f980972e 27%if %{with python2}
1357614b 28BuildRequires: python >= 1:2.7
f980972e 29BuildRequires: python-modules >= 1:2.7
11a7fa17 30BuildRequires: python-setuptools
fb337b23 31%if %{with tests}
b07e9d23 32BuildRequires: python-PySocks >= 1.7.1
fb337b23 33BuildRequires: python-PySocks < 2.0
f5006321 34BuildRequires: python-cryptography >= 2.8
b07e9d23
JB
35BuildRequires: python-dateutil >= 2.8.1
36BuildRequires: python-flaky >= 3.6.1
f5006321
JB
37# TODO
38#BuildRequires: python-gcp_devrel-py-tools >= 0.0.15
39BuildRequires: python-mock >= 3.0.5
b07e9d23
JB
40BuildRequires: python-pytest >= 4.6.9
41BuildRequires: python-pytest-freezegun >= 0.3.0
42BuildRequires: python-pytest-timeout >= 1.3.4
f5006321
JB
43BuildRequires: python-tornado >= 5.1.1
44BuildRequires: python-trustme >= 0.5.3
fb337b23
JB
45# SO_REUSEPORT option
46BuildRequires: uname(release) >= 3.9
47%endif
f980972e
ŁK
48%endif
49%if %{with python3}
1357614b 50BuildRequires: python3 >= 1:3.5
f5006321 51BuildRequires: python3-modules >= 1:3.5
11a7fa17 52BuildRequires: python3-setuptools
fb337b23 53%if %{with tests}
b07e9d23 54BuildRequires: python3-PySocks >= 1.7.1
fb337b23 55BuildRequires: python3-PySocks < 2.0
f5006321 56BuildRequires: python3-cryptography >= 2.8
b07e9d23
JB
57BuildRequires: python3-dateutil >= 2.8.1
58BuildRequires: python3-flaky >= 3.6.1
f5006321 59#BuildRequires: python3-gcp_devrel-py-tools >= 0.0.15
b07e9d23
JB
60BuildRequires: python3-pytest >= 4.6.9
61BuildRequires: python3-pytest-freezegun >= 0.4.2
62BuildRequires: python3-pytest-timeout >= 1.3.4
f5006321
JB
63BuildRequires: python3-tornado >= 6.0.3
64BuildRequires: python3-trustme >= 0.5.3
fb337b23
JB
65# SO_REUSEPORT option
66BuildRequires: uname(release) >= 3.9
67%endif
f980972e
ŁK
68%endif
69BuildRequires: rpm-pythonprov
fb337b23 70BuildRequires: rpmbuild(macros) >= 1.714
1cbae8fc 71%if %{with doc}
65b3314d
JB
72BuildRequires: python3-furo
73BuildRequires: python3-requests >= 2
74BuildRequires: sphinx-pdg-3 >= 3.0
1cbae8fc 75%endif
f980972e
ŁK
76Requires: python-modules >= 1:2.7
77BuildArch: noarch
78BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
79
80%description
d1b278cf 81Python 2 HTTP module with connection pooling and file POST abilities.
f980972e
ŁK
82Features 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
d1b278cf
JB
90%description -l pl.UTF-8
91Moduł HTTP dla Pythona 2 z pulą połączeń i możliwością wysyłania
92plikó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
f980972e
ŁK
100%package -n python3-urllib3
101Summary: HTTP library with thread-safe connection pooling, file post, and more
d1b278cf 102Summary(pl.UTF-8): Biblioteka HTTP z bezpieczną wątkowo pulą połączeń, wysyłaniem plików itd.
f980972e 103Group: Development/Languages/Python
f5006321 104Requires: python3-modules >= 1:3.5
f980972e
ŁK
105
106%description -n python3-urllib3
d1b278cf 107Python 3 HTTP module with connection pooling and file POST abilities.
f980972e
ŁK
108Features 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
d1b278cf
JB
116%description -n python3-urllib3 -l pl.UTF-8
117Moduł HTTP dla Pythona 3 z pulą połączeń i możliwością wysyłania
118plikó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
1cbae8fc
JB
126%package apidocs
127Summary: API documentation for Python urllib3 module
128Summary(pl.UTF-8): Dokumentacja API modułu Pythona urllib3
129Group: Documentation
130
131%description apidocs
132API documentation for Python urllib3 module.
133
134%description apidocs -l pl.UTF-8
135Dokumentacja API modułu Pythona urllib3.
136
f980972e
ŁK
137%prep
138%setup -q -n %{module}-%{version}
70df9369 139%patch0 -p1
f5006321 140%patch1 -p1
f980972e
ŁK
141
142%build
143%if %{with python2}
f5006321
JB
144%py_build
145
b07e9d23
JB
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.
f5006321
JB
150LC_ALL=C.UTF-8 \
151PYTHONPATH=$(pwd)/src \
b07e9d23
JB
152PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
153PYTEST_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)'
f5006321 156%endif
f980972e
ŁK
157%endif
158
159%if %{with python3}
f5006321
JB
160%py3_build
161
162%if %{with tests}
b07e9d23
JB
163# RECENT_DATE is too old
164# TestSSL: verification errors
f5006321 165PYTHONPATH=$(pwd)/src \
b07e9d23
JB
166PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
167PYTEST_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)'
f5006321 169%endif
f980972e
ŁK
170%endif
171
1cbae8fc 172%if %{with doc}
ad572b13 173%{__make} -C docs html \
70df9369 174 SPHINXBUILD=sphinx-build-3 \
ad572b13 175 SPHINXOPTS=
1cbae8fc
JB
176%endif
177
f980972e
ŁK
178%install
179rm -rf $RPM_BUILD_ROOT
180
181%if %{with python2}
fb337b23 182%py_install
b07e9d23 183
f980972e
ŁK
184%py_postclean
185%endif
186
187%if %{with python3}
fb337b23 188%py3_install
fb337b23 189%endif
f980972e
ŁK
190
191%clean
192rm -rf $RPM_BUILD_ROOT
193
194%if %{with python2}
195%files
196%defattr(644,root,root,755)
4e22dadf 197%doc CHANGES.rst LICENSE.txt README.rst
f980972e 198%{py_sitescriptdir}/%{module}
f980972e
ŁK
199%{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
200%endif
f980972e
ŁK
201
202%if %{with python3}
203%files -n python3-urllib3
204%defattr(644,root,root,755)
4e22dadf 205%doc CHANGES.rst LICENSE.txt README.rst
f980972e
ŁK
206%{py3_sitescriptdir}/%{module}
207%{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
208%endif
1cbae8fc
JB
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 0.151759 seconds and 4 git commands to generate.