From dbbf0f22ab38d5050f33eed426190f4ab9babc44 Mon Sep 17 00:00:00 2001 From: Alessio Sergi Date: Wed, 29 Oct 2014 16:17:00 +0100 Subject: [PATCH] python-requests: update to 2.4.3; update patches --- .../{unbundle.patch => 01_unbundle.patch} | 88 ++++++++++--------- .../patches/02_export-incompleteread.patch | 19 ++++ srcpkgs/python-requests/template | 17 ++-- 3 files changed, 74 insertions(+), 50 deletions(-) rename srcpkgs/python-requests/patches/{unbundle.patch => 01_unbundle.patch} (64%) create mode 100644 srcpkgs/python-requests/patches/02_export-incompleteread.patch diff --git a/srcpkgs/python-requests/patches/unbundle.patch b/srcpkgs/python-requests/patches/01_unbundle.patch similarity index 64% rename from srcpkgs/python-requests/patches/unbundle.patch rename to srcpkgs/python-requests/patches/01_unbundle.patch index e532f4d302..c81107d9e0 100644 --- a/srcpkgs/python-requests/patches/unbundle.patch +++ b/srcpkgs/python-requests/patches/01_unbundle.patch @@ -1,12 +1,12 @@ diff -Nur MANIFEST.in MANIFEST.in --- MANIFEST.in 2014-01-24 21:37:17.000000000 +0100 -+++ MANIFEST.in 2014-07-07 09:55:01.317963805 +0200 ++++ MANIFEST.in 2014-10-29 12:24:04.411052117 +0100 @@ -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 diff -Nur requests/__init__.py requests/__init__.py ---- requests/__init__.py 2014-05-16 19:55:34.000000000 +0200 -+++ requests/__init__.py 2014-07-07 09:48:55.457975614 +0200 +--- requests/__init__.py 2014-10-06 11:44:17.000000000 +0200 ++++ requests/__init__.py 2014-10-29 12:05:46.197769171 +0100 @@ -50,7 +50,7 @@ # Attempt to enable urllib3's SNI support, if possible @@ -17,51 +17,57 @@ diff -Nur requests/__init__.py requests/__init__.py except ImportError: pass diff -Nur requests/adapters.py requests/adapters.py ---- requests/adapters.py 2014-05-16 19:44:21.000000000 +0200 -+++ requests/adapters.py 2014-07-07 09:49:45.131974011 +0200 -@@ -11,18 +11,18 @@ +--- requests/adapters.py 2014-10-06 11:40:10.000000000 +0200 ++++ requests/adapters.py 2014-10-29 12:01:35.562902538 +0100 +@@ -11,21 +11,21 @@ import socket from .models import Response +-from .packages.urllib3 import Retry -from .packages.urllib3.poolmanager import PoolManager, proxy_from_url -from .packages.urllib3.response import HTTPResponse -from .packages.urllib3.util import Timeout as TimeoutSauce ++from urllib3 import Retry +from urllib3.poolmanager import PoolManager, proxy_from_url +from urllib3.response import HTTPResponse +from urllib3.util import Timeout as TimeoutSauce - from .compat import urlparse, basestring, urldefrag, unquote + from .compat import urlparse, basestring from .utils import (DEFAULT_CA_BUNDLE_PATH, get_encoding_from_headers, - prepend_scheme_if_needed, get_auth_from_url) + prepend_scheme_if_needed, get_auth_from_url, urldefragauth) from .structures import CaseInsensitiveDict --from .packages.urllib3.exceptions import MaxRetryError --from .packages.urllib3.exceptions import TimeoutError --from .packages.urllib3.exceptions import SSLError as _SSLError +-from .packages.urllib3.exceptions import ConnectTimeoutError -from .packages.urllib3.exceptions import HTTPError as _HTTPError +-from .packages.urllib3.exceptions import MaxRetryError -from .packages.urllib3.exceptions import ProxyError as _ProxyError -+from urllib3.exceptions import MaxRetryError -+from urllib3.exceptions import TimeoutError -+from urllib3.exceptions import SSLError as _SSLError +-from .packages.urllib3.exceptions import ProtocolError +-from .packages.urllib3.exceptions import ReadTimeoutError +-from .packages.urllib3.exceptions import SSLError as _SSLError ++from urllib3.exceptions import ConnectTimeoutError +from urllib3.exceptions import HTTPError as _HTTPError ++from urllib3.exceptions import MaxRetryError +from urllib3.exceptions import ProxyError as _ProxyError ++from urllib3.exceptions import ProtocolError ++from urllib3.exceptions import ReadTimeoutError ++from urllib3.exceptions import SSLError as _SSLError from .cookies import extract_cookies_to_jar - from .exceptions import ConnectionError, Timeout, SSLError, ProxyError - from .auth import _basic_auth_str + from .exceptions import (ConnectionError, ConnectTimeout, ReadTimeout, SSLError, + ProxyError) diff -Nur requests/certs.py requests/certs.py ---- requests/certs.py 2014-01-24 21:37:17.000000000 +0100 -+++ requests/certs.py 2014-07-07 09:51:32.678970539 +0200 -@@ -17,8 +17,7 @@ - - def where(): - """Return the preferred certificate bundle.""" -- # vendored bundle inside Requests -- return os.path.join(os.path.dirname(__file__), 'cacert.pem') -+ return '/etc/ssl/certs/ca-certificates.crt' +--- requests/certs.py 2014-08-19 18:52:58.000000000 +0200 ++++ requests/certs.py 2014-10-29 11:59:21.455579110 +0100 +@@ -18,8 +18,7 @@ + except ImportError: + def where(): + """Return the preferred certificate bundle.""" +- # vendored bundle inside Requests +- return os.path.join(os.path.dirname(__file__), 'cacert.pem') ++ return '/etc/ssl/certs/ca-certificates.crt' if __name__ == '__main__': print(where()) diff -Nur requests/compat.py requests/compat.py ---- requests/compat.py 2014-01-24 21:37:17.000000000 +0100 -+++ requests/compat.py 2014-07-07 09:50:29.140972590 +0200 +--- requests/compat.py 2014-08-19 18:52:58.000000000 +0200 ++++ requests/compat.py 2014-10-29 12:03:06.340767658 +0100 @@ -4,7 +4,7 @@ pythoncompat """ @@ -71,18 +77,18 @@ diff -Nur requests/compat.py requests/compat.py import sys -@@ -89,7 +89,7 @@ +@@ -91,7 +91,7 @@ import cookielib from Cookie import Morsel from StringIO import StringIO - from .packages.urllib3.packages.ordered_dict import OrderedDict + from collections import OrderedDict - from httplib import IncompleteRead builtin_str = str + bytes = str diff -Nur requests/exceptions.py requests/exceptions.py ---- requests/exceptions.py 2014-03-24 16:39:20.000000000 +0100 -+++ requests/exceptions.py 2014-07-07 09:51:09.190971298 +0200 +--- requests/exceptions.py 2014-10-05 18:53:35.000000000 +0200 ++++ requests/exceptions.py 2014-10-29 12:06:03.354554681 +0100 @@ -7,7 +7,7 @@ This module contains the set of Requests' exceptions. @@ -93,8 +99,8 @@ diff -Nur requests/exceptions.py requests/exceptions.py class RequestException(IOError): diff -Nur requests/models.py requests/models.py ---- requests/models.py 2014-05-12 21:08:50.000000000 +0200 -+++ requests/models.py 2014-07-07 09:50:55.757971731 +0200 +--- requests/models.py 2014-10-06 11:40:10.000000000 +0200 ++++ requests/models.py 2014-10-29 12:05:02.911310326 +0100 @@ -16,10 +16,10 @@ from .auth import HTTPBasicAuth @@ -102,18 +108,18 @@ diff -Nur requests/models.py requests/models.py -from .packages.urllib3.fields import RequestField -from .packages.urllib3.filepost import encode_multipart_formdata -from .packages.urllib3.util import parse_url --from .packages.urllib3.exceptions import DecodeError +-from .packages.urllib3.exceptions import ( +from urllib3.fields import RequestField +from urllib3.filepost import encode_multipart_formdata +from urllib3.util import parse_url -+from urllib3.exceptions import DecodeError ++from urllib3.exceptions import ( + DecodeError, ReadTimeoutError, ProtocolError) from .exceptions import ( - HTTPError, RequestException, MissingSchema, InvalidURL, - ChunkedEncodingError, ContentDecodingError) + HTTPError, RequestException, MissingSchema, InvalidURL, diff -Nur setup.py setup.py ---- setup.py 2014-05-12 21:08:50.000000000 +0200 -+++ setup.py 2014-07-07 09:48:16.640976867 +0200 -@@ -16,13 +16,6 @@ +--- setup.py 2014-09-09 18:31:17.000000000 +0200 ++++ setup.py 2014-10-29 12:15:22.150568770 +0100 +@@ -18,13 +18,6 @@ packages = [ 'requests', @@ -127,7 +133,7 @@ diff -Nur setup.py setup.py ] requires = [] -@@ -41,7 +34,7 @@ +@@ -43,7 +36,7 @@ author_email='me@kennethreitz.com', url='http://python-requests.org', packages=packages, diff --git a/srcpkgs/python-requests/patches/02_export-incompleteread.patch b/srcpkgs/python-requests/patches/02_export-incompleteread.patch new file mode 100644 index 0000000000..7f0e45be51 --- /dev/null +++ b/srcpkgs/python-requests/patches/02_export-incompleteread.patch @@ -0,0 +1,19 @@ +diff -Nur requests/compat.py requests/compat.py +--- requests/compat.py 2014-10-29 12:03:06.340767658 +0100 ++++ requests/compat.py 2014-10-29 12:30:56.150892159 +0100 +@@ -92,6 +92,7 @@ + from Cookie import Morsel + from StringIO import StringIO + from collections import OrderedDict ++ from httplib import IncompleteRead + + builtin_str = str + bytes = str +@@ -107,6 +108,7 @@ + from http.cookies import Morsel + from io import StringIO + from collections import OrderedDict ++ from http.client import IncompleteRead + + builtin_str = str + str = str diff --git a/srcpkgs/python-requests/template b/srcpkgs/python-requests/template index 08caf62993..14311c4db2 100644 --- a/srcpkgs/python-requests/template +++ b/srcpkgs/python-requests/template @@ -1,22 +1,21 @@ # Template file for 'python-requests' pkgname=python-requests -version=2.3.0 -revision=2 +version=2.4.3 +revision=1 noarch=yes wrksrc="requests-${version}" build_style="python-module" python_versions="2.7 3.4" hostmakedepends="python-setuptools python3.4-setuptools" -makedepends="python-devel python3.4-devel python-chardet python3.4-chardet - python-urllib3 python3.4-urllib3" -depends="python python-chardet python-urllib3 ca-certificates" +makedepends="python-chardet python3.4-chardet python-urllib3 python3.4-urllib3" +depends="python-chardet python-urllib3 ca-certificates" pycompile_module="requests" short_desc="Python HTTP for Humans (Python2)" -maintainer="Steven R " +maintainer="Alessio Sergi " homepage="http://docs.python-requests.org/en/latest/" license="Apache-2.0" -distfiles="https://pypi.python.org/packages/source/r/requests/requests-${version}.tar.gz" -checksum=1c1473875d846fe563d70868acf05b1953a4472f4695b7b3566d1d978957b8fc +distfiles="${PYPI_SITE}/r/requests/requests-${version}.tar.gz" +checksum=53c68313c5c6149b1a899234c000296e60a8900682accf73d6f0c6d608afc6b1 pre_build() { rm -rf requests.egg-info @@ -24,7 +23,7 @@ pre_build() { python3.4-requests_package() { noarch=yes - depends="python3.4 python3.4-chardet python3.4-urllib3 ca-certificates" + depends="python3.4-chardet python3.4-urllib3 ca-certificates" pycompile_version="3.4" pycompile_module="requests" short_desc="${short_desc/Python2/Python3.4}"