]> git.pld-linux.org Git - packages/python-urllib3.git/blame_incremental - python-urllib3.spec
- updated to 1.26.8
[packages/python-urllib3.git] / python-urllib3.spec
... / ...
CommitLineData
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
10Summary: HTTP library with thread-safe connection pooling, file post, and more
11Summary(pl.UTF-8): Biblioteka HTTP z bezpieczną wątkowo pulą połączeń, wysyłaniem plików itd.
12Name: python-%{module}
13# note: maintain versions compatible with python-requests.spec
14Version: 1.26.8
15Release: 1
16License: MIT
17Group: Development/Languages/Python
18#Source0Download: https://pypi.org/simple/urllib3/
19Source0: https://files.pythonhosted.org/packages/source/u/urllib3/%{module}-%{version}.tar.gz
20# Source0-md5: 50831ca7b19bbe2781abb0a4c2d51760
21Patch0: %{name}-mock.patch
22Patch1: %{name}-httplib.patch
23URL: https://urllib3.readthedocs.io/
24%if %(locale -a | grep -q '^C\.utf8$'; echo $?)
25BuildRequires: glibc-localedb-all
26%endif
27%if %{with python2}
28BuildRequires: python-modules >= 1:2.7
29%if %{with tests}
30BuildRequires: python-PySocks >= 1.7.1
31BuildRequires: python-PySocks < 2.0
32BuildRequires: python-cryptography >= 2.8
33BuildRequires: python-dateutil >= 2.8.1
34BuildRequires: python-flaky >= 3.6.1
35# TODO
36#BuildRequires: python-gcp_devrel-py-tools >= 0.0.15
37BuildRequires: python-mock >= 3.0.5
38BuildRequires: python-pytest >= 4.6.9
39BuildRequires: python-pytest-freezegun >= 0.3.0
40BuildRequires: python-pytest-timeout >= 1.3.4
41BuildRequires: python-tornado >= 5.1.1
42BuildRequires: python-trustme >= 0.5.3
43# SO_REUSEPORT option
44BuildRequires: uname(release) >= 3.9
45%endif
46%endif
47%if %{with python3}
48BuildRequires: python3-modules >= 1:3.5
49%if %{with tests}
50BuildRequires: python3-PySocks >= 1.7.1
51BuildRequires: python3-PySocks < 2.0
52BuildRequires: python3-cryptography >= 2.8
53BuildRequires: python3-dateutil >= 2.8.1
54BuildRequires: python3-flaky >= 3.6.1
55#BuildRequires: python3-gcp_devrel-py-tools >= 0.0.15
56BuildRequires: python3-pytest >= 4.6.9
57BuildRequires: python3-pytest-freezegun >= 0.4.2
58BuildRequires: python3-pytest-timeout >= 1.3.4
59BuildRequires: python3-tornado >= 6.0.3
60BuildRequires: python3-trustme >= 0.5.3
61# SO_REUSEPORT option
62BuildRequires: uname(release) >= 3.9
63%endif
64%endif
65BuildRequires: rpm-pythonprov
66BuildRequires: rpmbuild(macros) >= 1.714
67%if %{with doc}
68BuildRequires: python3-furo
69BuildRequires: python3-requests >= 2
70BuildRequires: sphinx-pdg-3 >= 3.0
71%endif
72Requires: python-modules >= 1:2.7
73BuildArch: noarch
74BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
75
76%description
77Python 2 HTTP module with connection pooling and file POST abilities.
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
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
96%package -n python3-urllib3
97Summary: HTTP library with thread-safe connection pooling, file post, and more
98Summary(pl.UTF-8): Biblioteka HTTP z bezpieczną wątkowo pulą połączeń, wysyłaniem plików itd.
99Group: Development/Languages/Python
100Requires: python3-modules >= 1:3.5
101
102%description -n python3-urllib3
103Python 3 HTTP module with connection pooling and file POST abilities.
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
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
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
133%prep
134%setup -q -n %{module}-%{version}
135%patch0 -p1
136%patch1 -p1
137
138%build
139%if %{with python2}
140%py_build
141
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.
146LC_ALL=C.UTF-8 \
147PYTHONPATH=$(pwd)/src \
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)'
152%endif
153%endif
154
155%if %{with python3}
156%py3_build
157
158%if %{with tests}
159# RECENT_DATE is too old
160# TestSSL: verification errors
161PYTHONPATH=$(pwd)/src \
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)'
165%endif
166%endif
167
168%if %{with doc}
169%{__make} -C docs html \
170 SPHINXBUILD=sphinx-build-3 \
171 SPHINXOPTS=
172%endif
173
174%install
175rm -rf $RPM_BUILD_ROOT
176
177%if %{with python2}
178%py_install
179
180%py_postclean
181%endif
182
183%if %{with python3}
184%py3_install
185%endif
186
187%clean
188rm -rf $RPM_BUILD_ROOT
189
190%if %{with python2}
191%files
192%defattr(644,root,root,755)
193%doc CHANGES.rst LICENSE.txt README.rst
194%{py_sitescriptdir}/%{module}
195%{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
196%endif
197
198%if %{with python3}
199%files -n python3-urllib3
200%defattr(644,root,root,755)
201%doc CHANGES.rst LICENSE.txt README.rst
202%{py3_sitescriptdir}/%{module}
203%{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
204%endif
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.027597 seconds and 4 git commands to generate.