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