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