diff --git a/no-default-cacert.patch b/no-default-cacert.patch index 7651e91..f0a4219 100644 --- a/no-default-cacert.patch +++ b/no-default-cacert.patch @@ -1,8 +1,11 @@ -Index: requests-2.6.0/requests/adapters.py -=================================================================== ---- requests-2.6.0.orig/requests/adapters.py -+++ requests-2.6.0/requests/adapters.py -@@ -177,9 +177,6 @@ class HTTPAdapter(BaseAdapter): +--- a/MANIFEST.in ++++ b/MANIFEST.in +@@ -1 +1 @@ +-include README.rst LICENSE NOTICE HISTORY.rst test_requests.py requirements.txt requests/cacert.pem ++include README.rst LICENSE NOTICE HISTORY.rst test_requests.py requirements.txt +--- a/requests/adapters.py ++++ b/requests/adapters.py +@@ -180,9 +180,6 @@ class HTTPAdapter(BaseAdapter): if not cert_loc: cert_loc = DEFAULT_CA_BUNDLE_PATH @@ -12,10 +15,8 @@ Index: requests-2.6.0/requests/adapters.py conn.cert_reqs = 'CERT_REQUIRED' conn.ca_certs = cert_loc else: -Index: requests-2.6.0/requests/certs.py -=================================================================== ---- requests-2.6.0.orig/requests/certs.py -+++ requests-2.6.0/requests/certs.py +--- a/requests/certs.py ++++ b/requests/certs.py @@ -18,8 +18,9 @@ try: except ImportError: def where(): @@ -28,24 +29,14 @@ Index: requests-2.6.0/requests/certs.py if __name__ == '__main__': print(where()) -Index: requests-2.6.0/MANIFEST.in -=================================================================== ---- requests-2.6.0.orig/MANIFEST.in -+++ requests-2.6.0/MANIFEST.in -@@ -1 +1 @@ --include README.rst LICENSE NOTICE HISTORY.rst test_requests.py requirements.txt requests/cacert.pem -+include README.rst LICENSE NOTICE HISTORY.rst test_requests.py requirements.txt -Index: requests-2.6.0/requests/packages/urllib3/util/ssl_.py -=================================================================== ---- requests-2.6.0.orig/requests/packages/urllib3/util/ssl_.py -+++ requests-2.6.0/requests/packages/urllib3/util/ssl_.py -@@ -259,6 +259,9 @@ def ssl_wrap_socket(sock, keyfile=None, +--- a/requests/packages/urllib3/util/ssl_.py ++++ b/requests/packages/urllib3/util/ssl_.py +@@ -278,6 +278,8 @@ def ssl_wrap_socket(sock, keyfile=None, if e.errno == errno.ENOENT: raise SSLError(e) raise + elif cert_reqs != CERT_NONE: + context.set_default_verify_paths() -+ + if certfile: context.load_cert_chain(certfile, keyfile) - if HAS_SNI: # Platform-specific: OpenSSL with enabled SNI diff --git a/python-requests.changes b/python-requests.changes index 788579e..d17c1ad 100644 --- a/python-requests.changes +++ b/python-requests.changes @@ -1,3 +1,37 @@ +------------------------------------------------------------------- +Fri Oct 9 19:11:09 UTC 2015 - sor.alexei@meowr.ru + +- Update to 2.8.0: + * Requests now supports per-host proxies. This allows the proxies + dictionary to have entries of the form {'://': + ''}. Host-specific proxies will be used in preference to + the previously-supported scheme-specific ones, but the previous + syntax will continue to work. + * Response.raise_for_status now prints the URL that failed as + part of the exception message. + * requests.utils.get_netrc_auth now takes an raise_errors kwarg, + defaulting to False. When True, errors parsing .netrc files + cause exceptions to be thrown. + * Change to bundled projects import logic to make it easier to + unbundle requests downstream. + * Change the default User-Agent string to avoid leaking data on + Linux: now contains only the requests version. + * The json parameter to post() and friends will now only be used + if neither data nor files are present, consistent with the + documentation. + * We now ignore empty fields in the NO_PROXY enviroment variable. + * Fix problem where httplib.BadStatusLine would get raised if + combining stream=True with contextlib.closing. + * Prevent bugs where we would attempt to return the same connection + back to the connection pool twice when sending a Chunked body. + * Miscellaneous minor internal changes. + * Digest Auth support is now thread safe. +- Apply no-default-cacert-sles.patch on SLE 12. +- Apply Arun Persaud's changes to requests-do-not-use-bundle.patch + (update to 2.8.0). +- Enable tests. +- Small spec cleanup. + ------------------------------------------------------------------- Tue Oct 6 17:48:20 UTC 2015 - aloisio@gmx.com diff --git a/python-requests.spec b/python-requests.spec index 2f98919..0cfbf20 100644 --- a/python-requests.spec +++ b/python-requests.spec @@ -17,21 +17,19 @@ Name: python-requests -Version: 2.7.0 +Version: 2.8.0 Release: 0 -Url: http://python-requests.org Summary: Awesome Python HTTP Library That's Actually Usable License: Apache-2.0 Group: Development/Languages/Python -#TODO/FIXME: Maybe split out charade and urllib3 into sub-packages to simplify: +Url: http://python-requests.org Source: http://pypi.python.org/packages/source/r/requests/requests-%{version}.tar.gz # PATCH-FIX-OPENSUSE no-default-cacert.patch -- completely ignore the internal CA bundle Patch0: no-default-cacert.patch -# PATCH-FIX-OPENSUSE no-default-cacert-sles.patch -- completely ignore the internal CA bundle (SLES version) +# PATCH-FIX-SLE no-default-cacert-sles.patch -- completely ignore the internal CA bundle (SLES version) Patch1: no-default-cacert-sles.patch # PATCH-FIX-OPENSUSE requests-do-not-use-bundle.patch --use system libraries instead of bundled ones Patch2: requests-do-not-use-bundle.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: python BuildRequires: python-devel BuildRequires: python-py @@ -40,44 +38,44 @@ Requires: python Requires: python-chardet Requires: python-py Requires: python-urllib3 -%if 0%{?suse_version} && 0%{?suse_version} <= 1110 +%if 0%{?suse_version} <= 1110 %{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} +BuildRoot: %{_tmppath}/%{name}-%{version}-build %else BuildArch: noarch %endif %description -Requests is an ISC Licensed HTTP library, written in Python, for human -beings. +Requests is an ISC Licensed HTTP library, written in Python, for +human beings. -Most existing Python modules for sending HTTP requests are extremely -verbose and cumbersome. Python's builtin urllib2 module provides most of -the HTTP capabilities you should need, but the api is thoroughly broken. -It requires an enormous amount of work (even method overrides) to -perform the simplest of tasks. +Most existing Python modules for sending HTTP requests are +extremely verbose and cumbersome. Python's builtin urllib2 module +provides most of the HTTP capabilities you should need, but the api +is thoroughly broken. It requires an enormous amount of work (even +method overrides) to perform the simplest of tasks. Features: - -- Extremely simple GET, HEAD, POST, PUT, DELETE Requests - + Simple HTTP Header Request Attachment - + Simple Data/Params Request Attachment - + Simple Multipart File Uploads - + CookieJar Support - + Redirection History - + Redirection Recursion Urllib Fix - + Auto Decompression of GZipped Content - + Unicode URL Support -- Simple Authentication - + Simple URL + HTTP Auth Registry + - Extremely simple GET, HEAD, POST, PUT, DELETE Requests: + + Simple HTTP Header Request Attachment. + + Simple Data/Params Request Attachment. + + Simple Multipart File Uploads. + + CookieJar Support. + + Redirection History. + + Redirection Recursion Urllib Fix. + + Auto Decompression of GZipped Content. + + Unicode URL Support. + - Simple Authentication: + + Simple URL + HTTP Auth Registry. %prep %setup -q -n requests-%{version} # For rpmlint warning: remove shebang from python library: sed -i '/^#!/d' ./requests/certs.py -%if 0%{?suse_version} > 1110 || 0%{?rhel} > 6 -%patch0 -p1 -%else +%if 0%{?suse_version} == 1110 || (0%{?suse_version} == 1315 && !0%{?is_opensuse}) %patch1 -p1 +%else +%patch0 -p1 %endif %patch2 -p1 rm ./requests/cacert.pem @@ -85,19 +83,18 @@ rm ./requests/cacert.pem %build python setup.py build -# NOTE(toabctl): The test suite currently requires external network access, so -# we can't enable it. -# See # https://github.com/kennethreitz/requests/issues/2184 -##check -##python setup.py test - %install -python setup.py install --prefix=%{_prefix} --root=%{buildroot} -rm -rf %{buildroot}%{python_sitelib}/requests/packages +python setup.py install \ + --root=%{buildroot} --prefix=%{_prefix} +rm -rf %{buildroot}%{python_sitelib}/requests/packages/ + +%check +python setup.py test %files %defattr(-,root,root) -%doc README.rst HISTORY.rst LICENSE NOTICE -%{python_sitelib}/* +%doc HISTORY.rst LICENSE NOTICE README.rst +%{python_sitelib}/requests/ +%{python_sitelib}/requests-* %changelog diff --git a/requests-2.7.0.tar.gz b/requests-2.7.0.tar.gz deleted file mode 100644 index ce3f497..0000000 --- a/requests-2.7.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:398a3db6d61899d25fd4a06c6ca12051b0ce171d705decd7ed5511517b4bb93d -size 451723 diff --git a/requests-2.8.0.tar.gz b/requests-2.8.0.tar.gz new file mode 100644 index 0000000..7269afa --- /dev/null +++ b/requests-2.8.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b2f003589b60924909c0acde472590c5ea83906986a7a25b6f7929eb20923b7b +size 457879 diff --git a/requests-do-not-use-bundle.patch b/requests-do-not-use-bundle.patch index f5db3f9..fb5c5ed 100644 --- a/requests-do-not-use-bundle.patch +++ b/requests-do-not-use-bundle.patch @@ -1,8 +1,6 @@ -Index: requests-2.7.0/requests/adapters.py -=================================================================== ---- requests-2.7.0.orig/requests/adapters.py -+++ requests-2.7.0/requests/adapters.py -@@ -11,22 +11,22 @@ and maintain connections. +--- a/requests/adapters.py ++++ b/requests/adapters.py +@@ -11,24 +11,24 @@ and maintain connections. import socket from .models import Response @@ -16,8 +14,10 @@ Index: requests-2.7.0/requests/adapters.py +from urllib3.util.retry import Retry from .compat import urlparse, basestring from .utils import (DEFAULT_CA_BUNDLE_PATH, get_encoding_from_headers, - prepend_scheme_if_needed, get_auth_from_url, urldefragauth) + prepend_scheme_if_needed, get_auth_from_url, urldefragauth, + select_proxy) from .structures import CaseInsensitiveDict +-from .packages.urllib3.exceptions import ClosedPoolError -from .packages.urllib3.exceptions import ConnectTimeoutError -from .packages.urllib3.exceptions import HTTPError as _HTTPError -from .packages.urllib3.exceptions import MaxRetryError @@ -26,6 +26,7 @@ Index: requests-2.7.0/requests/adapters.py -from .packages.urllib3.exceptions import ReadTimeoutError -from .packages.urllib3.exceptions import SSLError as _SSLError -from .packages.urllib3.exceptions import ResponseError ++from urllib3.exceptions import ClosedPoolError +from urllib3.exceptions import ConnectTimeoutError +from urllib3.exceptions import HTTPError as _HTTPError +from urllib3.exceptions import MaxRetryError @@ -37,10 +38,8 @@ Index: requests-2.7.0/requests/adapters.py from .cookies import extract_cookies_to_jar from .exceptions import (ConnectionError, ConnectTimeout, ReadTimeout, SSLError, ProxyError, RetryError) -Index: requests-2.7.0/requests/compat.py -=================================================================== ---- requests-2.7.0.orig/requests/compat.py -+++ requests-2.7.0/requests/compat.py +--- a/requests/compat.py ++++ b/requests/compat.py @@ -4,8 +4,7 @@ pythoncompat """ @@ -60,10 +59,8 @@ Index: requests-2.7.0/requests/compat.py builtin_str = str bytes = str -Index: requests-2.7.0/requests/exceptions.py -=================================================================== ---- requests-2.7.0.orig/requests/exceptions.py -+++ requests-2.7.0/requests/exceptions.py +--- a/requests/exceptions.py ++++ b/requests/exceptions.py @@ -7,7 +7,7 @@ requests.exceptions This module contains the set of Requests' exceptions. @@ -73,10 +70,8 @@ Index: requests-2.7.0/requests/exceptions.py class RequestException(IOError): -Index: requests-2.7.0/requests/__init__.py -=================================================================== ---- requests-2.7.0.orig/requests/__init__.py -+++ requests-2.7.0/requests/__init__.py +--- a/requests/__init__.py ++++ b/requests/__init__.py @@ -50,7 +50,7 @@ __copyright__ = 'Copyright 2015 Kenneth # Attempt to enable urllib3's SNI support, if possible @@ -86,10 +81,8 @@ Index: requests-2.7.0/requests/__init__.py pyopenssl.inject_into_urllib3() except ImportError: pass -Index: requests-2.7.0/requests/models.py -=================================================================== ---- requests-2.7.0.orig/requests/models.py -+++ requests-2.7.0/requests/models.py +--- a/requests/models.py ++++ b/requests/models.py @@ -16,10 +16,10 @@ from .structures import CaseInsensitiveD from .auth import HTTPBasicAuth @@ -105,10 +98,8 @@ Index: requests-2.7.0/requests/models.py DecodeError, ReadTimeoutError, ProtocolError, LocationParseError) from .exceptions import ( HTTPError, MissingSchema, InvalidURL, ChunkedEncodingError, -Index: requests-2.7.0/requests/sessions.py -=================================================================== ---- requests-2.7.0.orig/requests/sessions.py -+++ requests-2.7.0/requests/sessions.py +--- a/requests/sessions.py ++++ b/requests/sessions.py @@ -21,7 +21,7 @@ from .hooks import default_hooks, dispat from .utils import to_key_val_list, default_headers, to_native_string from .exceptions import (