]> git.pld-linux.org Git - packages/python-urllib3.git/blob - python-urllib3.spec
a6ebe473947cc2085fcad50da40dd3c943959709
[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.9
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:  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
25 %endif
26 %if %{with python2}
27 BuildRequires:  python-modules >= 1:2.7
28 %if %{with tests}
29 BuildRequires:  python-PySocks >= 1.5.6
30 BuildRequires:  python-PySocks < 2.0
31 BuildRequires:  python-cryptography >= 2.8
32 # TODO
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
38 # SO_REUSEPORT option
39 BuildRequires:  uname(release) >= 3.9
40 %endif
41 %endif
42 %if %{with python3}
43 BuildRequires:  python3-modules >= 1:3.5
44 %if %{with tests}
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
52 # SO_REUSEPORT option
53 BuildRequires:  uname(release) >= 3.9
54 %endif
55 %endif
56 BuildRequires:  rpm-pythonprov
57 BuildRequires:  rpmbuild(macros) >= 1.714
58 %if %{with doc}
59 BuildRequires:  python3-alabaster
60 BuildRequires:  sphinx-pdg-3
61 %endif
62 Requires:       python-modules >= 1:2.7
63 BuildArch:      noarch
64 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
65
66 %description
67 Python 2 HTTP module with connection pooling and file POST abilities.
68 Features are:
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.
75
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.
85
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
91
92 %description -n python3-urllib3
93 Python 3 HTTP module with connection pooling and file POST abilities.
94 Features are:
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.
101
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.
111
112 %package apidocs
113 Summary:        API documentation for Python urllib3 module
114 Summary(pl.UTF-8):      Dokumentacja API modułu Pythona urllib3
115 Group:          Documentation
116
117 %description apidocs
118 API documentation for Python urllib3 module.
119
120 %description apidocs -l pl.UTF-8
121 Dokumentacja API modułu Pythona urllib3.
122
123 %prep
124 %setup -q -n %{module}-%{version}
125 %patch0 -p1
126 %patch1 -p1
127
128 %build
129 %if %{with python2}
130 %py_build
131
132 %if %{with tests_py2}
133 LC_ALL=C.UTF-8 \
134 PYTHONPATH=$(pwd)/src \
135 %{__python} -m pytest test
136 %endif
137 %endif
138
139 %if %{with python3}
140 %py3_build
141
142 %if %{with tests}
143 PYTHONPATH=$(pwd)/src \
144 %{__python3} -m pytest test
145 %endif
146 %endif
147
148 %if %{with doc}
149 %{__make} -C docs html \
150         SPHINXBUILD=sphinx-build-3 \
151         SPHINXOPTS=
152 %endif
153
154 %install
155 rm -rf $RPM_BUILD_ROOT
156
157 %if %{with python2}
158 %py_install
159 %py_postclean
160 %endif
161
162 %if %{with python3}
163 %py3_install
164 %endif
165
166 %clean
167 rm -rf $RPM_BUILD_ROOT
168
169 %if %{with python2}
170 %files
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
175 %endif
176
177 %if %{with python3}
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
183 %endif
184
185 %if %{with doc}
186 %files apidocs
187 %defattr(644,root,root,755)
188 %doc docs/_build/html/{_static,reference,*.html,*.js}
189 %endif
This page took 0.070998 seconds and 2 git commands to generate.