1 # TODO: use system six, [backports.]ssl_match_hostname
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)
10 Summary: HTTP library with thread-safe connection pooling, file post, and more
11 Summary(pl.UTF-8): Biblioteka HTTP z bezpieczną wątkowo pulą połączeń, wysyłaniem plików itd.
12 Name: python-%{module}
16 Group: Development/Languages/Python
17 #Source0Download: https://pypi.org/simple/urllib3/
18 Source0: https://files.pythonhosted.org/packages/source/u/urllib3/%{module}-%{version}.tar.gz
19 # Source0-md5: dbf9b868b90880b24b1ac278094e912e
20 Patch0: %{name}-mock.patch
21 Patch1: %{name}-httplib.patch
22 URL: http://urllib3.readthedocs.org/
23 %if %(locale -a | grep -q '^C\.utf8$'; echo $?)
24 BuildRequires: glibc-localedb-all
27 BuildRequires: python-modules >= 1:2.7
29 BuildRequires: python-PySocks >= 1.5.6
30 BuildRequires: python-PySocks < 2.0
31 BuildRequires: python-cryptography >= 2.8
33 #BuildRequires: python-gcp_devrel-py-tools >= 0.0.15
34 BuildRequires: python-mock >= 3.0.5
35 BuildRequires: python-pytest
36 BuildRequires: python-tornado >= 5.1.1
37 BuildRequires: python-trustme >= 0.5.3
39 BuildRequires: uname(release) >= 3.9
43 BuildRequires: python3-modules >= 1:3.5
45 BuildRequires: python3-PySocks >= 1.5.6
46 BuildRequires: python3-PySocks < 2.0
47 BuildRequires: python3-cryptography >= 2.8
48 #BuildRequires: python3-gcp_devrel-py-tools >= 0.0.15
49 BuildRequires: python3-pytest
50 BuildRequires: python3-tornado >= 6.0.3
51 BuildRequires: python3-trustme >= 0.5.3
53 BuildRequires: uname(release) >= 3.9
56 BuildRequires: rpm-pythonprov
57 BuildRequires: rpmbuild(macros) >= 1.714
59 BuildRequires: python3-alabaster
60 BuildRequires: sphinx-pdg-3
62 Requires: python-modules >= 1:2.7
64 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
67 Python 2 HTTP module with connection pooling and file POST abilities.
69 - Re-use the same socket connection for multiple requests (with
70 optional client-side certificate verification).
71 - File posting (encode_multipart_formdata).
72 - Built-in redirection and retries (optional).
73 - Supports gzip and deflate decoding.
74 - Thread-safe and sanity-safe.
76 %description -l pl.UTF-8
77 Moduł HTTP dla Pythona 2 z pulą połączeń i możliwością wysyłania
78 plików metodą POST. Możliwości:
79 - używanie tego samego połączenia dla wielu żądań (z opcjonalną
80 weryfikacją certyfikatu po stronie klienta)
81 - wysyłanie plików (encode_multipart_formdata)
82 - wbudowane przekierowania i ponawianie prób (opcjonalne)
83 - obsługa kodowań gzip i deflate
84 - bezpieczeństwo względem wątków.
86 %package -n python3-urllib3
87 Summary: HTTP library with thread-safe connection pooling, file post, and more
88 Summary(pl.UTF-8): Biblioteka HTTP z bezpieczną wątkowo pulą połączeń, wysyłaniem plików itd.
89 Group: Development/Languages/Python
90 Requires: python3-modules >= 1:3.5
92 %description -n python3-urllib3
93 Python 3 HTTP module with connection pooling and file POST abilities.
95 - Re-use the same socket connection for multiple requests (with
96 optional client-side certificate verification).
97 - File posting (encode_multipart_formdata).
98 - Built-in redirection and retries (optional).
99 - Supports gzip and deflate decoding.
100 - Thread-safe and sanity-safe.
102 %description -n python3-urllib3 -l pl.UTF-8
103 Moduł HTTP dla Pythona 3 z pulą połączeń i możliwością wysyłania
104 plików metodą POST. Możliwości:
105 - używanie tego samego połączenia dla wielu żądań (z opcjonalną
106 weryfikacją certyfikatu po stronie klienta)
107 - wysyłanie plików (encode_multipart_formdata)
108 - wbudowane przekierowania i ponawianie prób (opcjonalne)
109 - obsługa kodowań gzip i deflate
110 - bezpieczeństwo względem wątków.
113 Summary: API documentation for Python urllib3 module
114 Summary(pl.UTF-8): Dokumentacja API modułu Pythona urllib3
118 API documentation for Python urllib3 module.
120 %description apidocs -l pl.UTF-8
121 Dokumentacja API modułu Pythona urllib3.
124 %setup -q -n %{module}-%{version}
132 %if %{with tests_py2}
134 PYTHONPATH=$(pwd)/src \
135 %{__python} -m pytest test
143 PYTHONPATH=$(pwd)/src \
144 %{__python3} -m pytest test
149 %{__make} -C docs html \
150 SPHINXBUILD=sphinx-build-3 \
155 rm -rf $RPM_BUILD_ROOT
167 rm -rf $RPM_BUILD_ROOT
171 %defattr(644,root,root,755)
172 %doc CHANGES.rst CONTRIBUTORS.txt LICENSE.txt README.rst
173 %{py_sitescriptdir}/%{module}
174 %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
178 %files -n python3-urllib3
179 %defattr(644,root,root,755)
180 %doc CHANGES.rst CONTRIBUTORS.txt LICENSE.txt README.rst
181 %{py3_sitescriptdir}/%{module}
182 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
187 %defattr(644,root,root,755)
188 %doc docs/_build/html/{_static,reference,*.html,*.js}