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