]> git.pld-linux.org Git - packages/python-urllib3.git/blob - python-urllib3.spec
- updated to 1.25.11 (last compatible with requests 2.23.x)
[packages/python-urllib3.git] / python-urllib3.spec
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
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}
13 Version:        1.25.11
14 Release:        1
15 License:        MIT
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:  d47dd21a6e66a03c3633cac468ffd010
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
25 %endif
26 %if %{with python2}
27 BuildRequires:  python-modules >= 1:2.7
28 %if %{with tests}
29 BuildRequires:  python-PySocks >= 1.7.1
30 BuildRequires:  python-PySocks < 2.0
31 BuildRequires:  python-cryptography >= 2.8
32 BuildRequires:  python-dateutil >= 2.8.1
33 BuildRequires:  python-flaky >= 3.6.1
34 # TODO
35 #BuildRequires: python-gcp_devrel-py-tools >= 0.0.15
36 BuildRequires:  python-mock >= 3.0.5
37 BuildRequires:  python-pytest >= 4.6.9
38 BuildRequires:  python-pytest-freezegun >= 0.3.0
39 BuildRequires:  python-pytest-timeout >= 1.3.4
40 BuildRequires:  python-tornado >= 5.1.1
41 BuildRequires:  python-trustme >= 0.5.3
42 # SO_REUSEPORT option
43 BuildRequires:  uname(release) >= 3.9
44 %endif
45 %endif
46 %if %{with python3}
47 BuildRequires:  python3-modules >= 1:3.5
48 %if %{with tests}
49 BuildRequires:  python3-PySocks >= 1.7.1
50 BuildRequires:  python3-PySocks < 2.0
51 BuildRequires:  python3-cryptography >= 2.8
52 BuildRequires:  python3-dateutil >= 2.8.1
53 BuildRequires:  python3-flaky >= 3.6.1
54 #BuildRequires: python3-gcp_devrel-py-tools >= 0.0.15
55 BuildRequires:  python3-pytest >= 4.6.9
56 BuildRequires:  python3-pytest-freezegun >= 0.4.2
57 BuildRequires:  python3-pytest-timeout >= 1.3.4
58 BuildRequires:  python3-tornado >= 6.0.3
59 BuildRequires:  python3-trustme >= 0.5.3
60 # SO_REUSEPORT option
61 BuildRequires:  uname(release) >= 3.9
62 %endif
63 %endif
64 BuildRequires:  rpm-pythonprov
65 BuildRequires:  rpmbuild(macros) >= 1.714
66 %if %{with doc}
67 BuildRequires:  python3-alabaster
68 BuildRequires:  sphinx-pdg-3
69 %endif
70 Requires:       python-modules >= 1:2.7
71 BuildArch:      noarch
72 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
73
74 %description
75 Python 2 HTTP module with connection pooling and file POST abilities.
76 Features 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
84 %description -l pl.UTF-8
85 Moduł HTTP dla Pythona 2 z pulą połączeń i możliwością wysyłania
86 plikó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
94 %package -n python3-urllib3
95 Summary:        HTTP library with thread-safe connection pooling, file post, and more
96 Summary(pl.UTF-8):      Biblioteka HTTP z bezpieczną wątkowo pulą połączeń, wysyłaniem plików itd.
97 Group:          Development/Languages/Python
98 Requires:       python3-modules >= 1:3.5
99
100 %description -n python3-urllib3
101 Python 3 HTTP module with connection pooling and file POST abilities.
102 Features 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
110 %description -n python3-urllib3 -l pl.UTF-8
111 Moduł HTTP dla Pythona 3 z pulą połączeń i możliwością wysyłania
112 plikó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
120 %package apidocs
121 Summary:        API documentation for Python urllib3 module
122 Summary(pl.UTF-8):      Dokumentacja API modułu Pythona urllib3
123 Group:          Documentation
124
125 %description apidocs
126 API documentation for Python urllib3 module.
127
128 %description apidocs -l pl.UTF-8
129 Dokumentacja API modułu Pythona urllib3.
130
131 %prep
132 %setup -q -n %{module}-%{version}
133 %patch0 -p1
134 %patch1 -p1
135
136 %build
137 %if %{with python2}
138 %py_build
139
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.
144 LC_ALL=C.UTF-8 \
145 PYTHONPATH=$(pwd)/src \
146 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
147 PYTEST_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)'
150 %endif
151 %endif
152
153 %if %{with python3}
154 %py3_build
155
156 %if %{with tests}
157 # RECENT_DATE is too old
158 # TestSSL: verification errors
159 PYTHONPATH=$(pwd)/src \
160 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
161 PYTEST_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)'
163 %endif
164 %endif
165
166 %if %{with doc}
167 %{__make} -C docs html \
168         SPHINXBUILD=sphinx-build-3 \
169         SPHINXOPTS=
170 %endif
171
172 %install
173 rm -rf $RPM_BUILD_ROOT
174
175 %if %{with python2}
176 %py_install
177
178 %py_postclean
179 %endif
180
181 %if %{with python3}
182 %py3_install
183 %endif
184
185 %clean
186 rm -rf $RPM_BUILD_ROOT
187
188 %if %{with python2}
189 %files
190 %defattr(644,root,root,755)
191 %doc CHANGES.rst CONTRIBUTORS.txt LICENSE.txt README.rst
192 %{py_sitescriptdir}/%{module}
193 %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
194 %endif
195
196 %if %{with python3}
197 %files -n python3-urllib3
198 %defattr(644,root,root,755)
199 %doc CHANGES.rst CONTRIBUTORS.txt LICENSE.txt README.rst
200 %{py3_sitescriptdir}/%{module}
201 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
202 %endif
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 1.72005 seconds and 4 git commands to generate.