]> git.pld-linux.org Git - packages/python-urllib3.git/blobdiff - python-urllib3.spec
- updated to 1.26.12
[packages/python-urllib3.git] / python-urllib3.spec
index 6df0451cf01df26e81ba4949ad801acb793932fb..2f46f3db7f3842487c007d8fbf1424b78510fb48 100644 (file)
@@ -1,31 +1,80 @@
-# Conditional build:
-%bcond_without  python2         # build python 2 module
-%bcond_without  python3         # build python 3 module
+# TODO: use system six, [backports.]ssl_match_hostname
 #
-%define        module  urllib3
+# Conditional build:
+%bcond_without python2 # CPython 2.x module
+%bcond_without python3 # CPython 3.x module
+%bcond_without doc     # Sphinx documentation
+%bcond_with    tests   # test target (uses network etc., few failures)
+
+%define                module          urllib3
 Summary:       HTTP library with thread-safe connection pooling, file post, and more
+Summary(pl.UTF-8):     Biblioteka HTTP z bezpieczną wątkowo pulą połączeń, wysyłaniem plików itd.
 Name:          python-%{module}
-Version:       1.8
+# note: maintain versions compatible with python-requests.spec
+Version:       1.26.12
 Release:       1
 License:       MIT
 Group:         Development/Languages/Python
-Source0:       https://pypi.python.org/packages/source/u/urllib3/%{module}-%{version}.tar.gz
-# Source0-md5: d664781c08f98a83f28df087b6edfdca
-URL:           http://urllib3.readthedocs.org/
+#Source0Download: https://pypi.org/simple/urllib3/
+Source0:       https://files.pythonhosted.org/packages/source/u/urllib3/%{module}-%{version}.tar.gz
+# Source0-md5: ba308b52b9092184cf4905bc59a88fc0
+Patch0:                %{name}-mock.patch
+Patch1:                %{name}-httplib.patch
+URL:           https://urllib3.readthedocs.io/
+%if %(locale -a | grep -q '^C\.utf8$'; echo $?)
+BuildRequires: glibc-localedb-all
+%endif
 %if %{with python2}
 BuildRequires: python-modules >= 1:2.7
+%if %{with tests}
+BuildRequires: python-PySocks >= 1.7.1
+BuildRequires: python-PySocks < 2.0
+BuildRequires: python-cryptography >= 2.8
+BuildRequires: python-dateutil >= 2.8.1
+BuildRequires: python-flaky >= 3.6.1
+# TODO
+#BuildRequires:        python-gcp_devrel-py-tools >= 0.0.15
+BuildRequires: python-mock >= 3.0.5
+BuildRequires: python-pytest >= 4.6.9
+BuildRequires: python-pytest-freezegun >= 0.3.0
+BuildRequires: python-pytest-timeout >= 1.3.4
+BuildRequires: python-tornado >= 5.1.1
+BuildRequires: python-trustme >= 0.5.3
+# SO_REUSEPORT option
+BuildRequires: uname(release) >= 3.9
+%endif
 %endif
 %if %{with python3}
-BuildRequires: python3-modules >= 3.2
+BuildRequires: python3-modules >= 1:3.5
+%if %{with tests}
+BuildRequires: python3-PySocks >= 1.7.1
+BuildRequires: python3-PySocks < 2.0
+BuildRequires: python3-cryptography >= 2.8
+BuildRequires: python3-dateutil >= 2.8.1
+BuildRequires: python3-flaky >= 3.6.1
+#BuildRequires:        python3-gcp_devrel-py-tools >= 0.0.15
+BuildRequires: python3-pytest >= 4.6.9
+BuildRequires: python3-pytest-freezegun >= 0.4.2
+BuildRequires: python3-pytest-timeout >= 1.3.4
+BuildRequires: python3-tornado >= 6.0.3
+BuildRequires: python3-trustme >= 0.5.3
+# SO_REUSEPORT option
+BuildRequires: uname(release) >= 3.9
+%endif
 %endif
 BuildRequires: rpm-pythonprov
-BuildRequires: rpmbuild(macros) >= 1.219
+BuildRequires: rpmbuild(macros) >= 1.714
+%if %{with doc}
+BuildRequires: python3-furo
+BuildRequires: python3-requests >= 2
+BuildRequires: sphinx-pdg-3 >= 3.0
+%endif
 Requires:      python-modules >= 1:2.7
 BuildArch:     noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
-Python HTTP module with connection pooling and file POST abilities.
+Python HTTP module with connection pooling and file POST abilities.
 Features are:
 - Re-use the same socket connection for multiple requests (with
   optional client-side certificate verification).
@@ -34,13 +83,24 @@ Features are:
 - Supports gzip and deflate decoding.
 - Thread-safe and sanity-safe.
 
+%description -l pl.UTF-8
+Moduł HTTP dla Pythona 2 z pulą połączeń i możliwością wysyłania
+plików metodą POST. Możliwości:
+- używanie tego samego połączenia dla wielu żądań (z opcjonalną
+  weryfikacją certyfikatu po stronie klienta)
+- wysyłanie plików (encode_multipart_formdata)
+- wbudowane przekierowania i ponawianie prób (opcjonalne)
+- obsługa kodowań gzip i deflate
+- bezpieczeństwo względem wątków.
+
 %package -n python3-urllib3
 Summary:       HTTP library with thread-safe connection pooling, file post, and more
+Summary(pl.UTF-8):     Biblioteka HTTP z bezpieczną wątkowo pulą połączeń, wysyłaniem plików itd.
 Group:         Development/Languages/Python
-Requires:      python3-modules >= 3.2
+Requires:      python3-modules >= 1:3.5
 
 %description -n python3-urllib3
-Python HTTP module with connection pooling and file POST abilities.
+Python HTTP module with connection pooling and file POST abilities.
 Features are:
 - Re-use the same socket connection for multiple requests (with
   optional client-side certificate verification).
@@ -49,63 +109,102 @@ Features are:
 - Supports gzip and deflate decoding.
 - Thread-safe and sanity-safe.
 
+%description -n python3-urllib3 -l pl.UTF-8
+Moduł HTTP dla Pythona 3 z pulą połączeń i możliwością wysyłania
+plików metodą POST. Możliwości:
+- używanie tego samego połączenia dla wielu żądań (z opcjonalną
+  weryfikacją certyfikatu po stronie klienta)
+- wysyłanie plików (encode_multipart_formdata)
+- wbudowane przekierowania i ponawianie prób (opcjonalne)
+- obsługa kodowań gzip i deflate
+- bezpieczeństwo względem wątków.
+
+%package apidocs
+Summary:       API documentation for Python urllib3 module
+Summary(pl.UTF-8):     Dokumentacja API modułu Pythona urllib3
+Group:         Documentation
+
+%description apidocs
+API documentation for Python urllib3 module.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API modułu Pythona urllib3.
+
 %prep
 %setup -q -n %{module}-%{version}
+%patch0 -p1
+%patch1 -p1
 
 %build
 %if %{with python2}
-%{__python} setup.py build -b py2
+%py_build
+
+%if %{with tests}
+# RECENT_DATE is too old
+# test_retry.py: many failures with py2
+# TestSSL: unknown ca, timeout errors etc.
+LC_ALL=C.UTF-8 \
+PYTHONPATH=$(pwd)/src \
+PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
+PYTEST_PLUGINS="flaky.flaky_pytest_plugin,pytest_freezegun,pytest_timeout" \
+%{__python} -m pytest test -k 'not (test_recent_date or test_retry or test_ssl_read_timeout or test_ssl_failed_fingerprint_verification)'
+# or TestSSL)'
+%endif
 %endif
 
 %if %{with python3}
-%{__python3} setup.py build -b py3
+%py3_build
+
+%if %{with tests}
+# RECENT_DATE is too old
+# TestSSL: verification errors
+PYTHONPATH=$(pwd)/src \
+PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
+PYTEST_PLUGINS="flaky.flaky_pytest_plugin,pytest_freezegun,pytest_timeout" \
+%{__python3} -m pytest test -k 'not (test_recent_date or test_ssl_read_timeout or test_ssl_failed_fingerprint_verification)'
+%endif
+%endif
+
+%if %{with doc}
+%{__make} -C docs html \
+       SPHINXBUILD=sphinx-build-3 \
+       SPHINXOPTS=
 %endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
 %if %{with python2}
-%{__python} setup.py \
-       build -b py2 \
-       install \
-       --skip-build \
-       --optimize=2 \
-       --root=$RPM_BUILD_ROOT
-%py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
-%py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
+%py_install
+
 %py_postclean
 %endif
 
 %if %{with python3}
-%{__python3} setup.py  \
-       build -b py3 \
-       install \
-       --skip-build \
-       --optimize=2 \
-       --root=$RPM_BUILD_ROOT
+%py3_install
 %endif
 
-# dummyserver is a part of unitstests
-%{__rm} -rf $RPM_BUILD_ROOT%{py_sitescriptdir}/dummyserver \
-       $RPM_BUILD_ROOT%{py3_sitescriptdir}/dummyserver
-
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %if %{with python2}
 %files
 %defattr(644,root,root,755)
-%doc CHANGES.rst CONTRIBUTORS.txt README.rst
+%doc CHANGES.rst LICENSE.txt README.rst
 %{py_sitescriptdir}/%{module}
-%if "%{py_ver}" > "2.4"
 %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
 %endif
-%endif
 
 %if %{with python3}
 %files -n python3-urllib3
 %defattr(644,root,root,755)
-%doc CHANGES.rst CONTRIBUTORS.txt README.rst
+%doc CHANGES.rst LICENSE.txt README.rst
 %{py3_sitescriptdir}/%{module}
 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
 %endif
+
+%if %{with doc}
+%files apidocs
+%defattr(644,root,root,755)
+%doc docs/_build/html/{_static,reference,*.html,*.js}
+%endif
This page took 0.09358 seconds and 4 git commands to generate.