From cf6bee4210351b638079d0aeab39d4a1847d1ddf Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Dec 11 2014 21:37:34 +0000 Subject: Merge branch 'master' into f21 Conflicts: python-requests.spec --- diff --git a/.gitignore b/.gitignore index 2f11463..f88d145 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,5 @@ /requests-1.2.3.tar.gz /requests-2.0.0.tar.gz /requests-2.3.0.tar.gz +/requests-2.4.3.tar.gz +/requests-2.5.0.tar.gz diff --git a/python-requests-remove-nested-bundling-dep.patch b/python-requests-remove-nested-bundling-dep.patch new file mode 100644 index 0000000..d915a4e --- /dev/null +++ b/python-requests-remove-nested-bundling-dep.patch @@ -0,0 +1,29 @@ +From 8c2259d4ab03ef982738aaf863068a1015cadf3d Mon Sep 17 00:00:00 2001 +From: Ralph Bean +Date: Wed, 5 Nov 2014 10:23:44 -0500 +Subject: [PATCH] Remove nested bundling dep. + +--- + requests/compat.py | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/requests/compat.py b/requests/compat.py +index be5a1ed..70ea4e8 100644 +--- a/requests/compat.py ++++ b/requests/compat.py +@@ -91,7 +91,11 @@ if is_py2: + import cookielib + from Cookie import Morsel + from StringIO import StringIO +- from .packages.urllib3.packages.ordered_dict import OrderedDict ++ ++ try: ++ from collections import OrderedDict # py2.7 ++ except: ++ from ordereddict import OrderedDict # py2.6 and lower (el6, etc.) + + builtin_str = str + bytes = str +-- +1.9.3 + diff --git a/python-requests-system-cert-bundle.patch b/python-requests-system-cert-bundle.patch index 8e467bd..e76b741 100644 --- a/python-requests-system-cert-bundle.patch +++ b/python-requests-system-cert-bundle.patch @@ -1,37 +1,38 @@ -From ad98b45e959dc7325c294c26d94e68901700c407 Mon Sep 17 00:00:00 2001 +From a49b39fbfe01791880c6e7179f6efdad03e8ce58 Mon Sep 17 00:00:00 2001 From: Ralph Bean -Date: Mon, 1 Jul 2013 14:50:34 -0400 -Subject: [PATCH 1/3] system cert bundle +Date: Wed, 5 Nov 2014 10:15:17 -0500 +Subject: [PATCH] system cert bundle --- - requests/certs.py | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) + requests/certs.py | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/requests/certs.py b/requests/certs.py -index bc00826..9b78e3b 100644 +index 07e6475..2c7ca96 100644 --- a/requests/certs.py +++ b/requests/certs.py -@@ -10,15 +10,15 @@ This module returns the preferred default CA certificate bundle. +@@ -10,16 +10,17 @@ This module returns the preferred default CA certificate bundle. If you are packaging Requests, e.g., for a Linux distribution or a managed environment, you can change the definition of where() to return a separately packaged CA bundle. --""" - --import os.path ++ +We return "/etc/pki/tls/certs/ca-bundle.crt" provided by the ca-certificates +package. -+""" - + """ +-import os.path - def where(): -- """Return the preferred certificate bundle.""" -- # vendored bundle inside Requests -- return os.path.join(os.path.dirname(__file__), 'cacert.pem') -+ """ Don't use the certs bundled with requests, use ca-certificates. """ -+ return "/etc/pki/tls/certs/ca-bundle.crt" + try: + from certifi import where + except ImportError: + def where(): +- """Return the preferred certificate bundle.""" +- # vendored bundle inside Requests +- return os.path.join(os.path.dirname(__file__), 'cacert.pem') ++ """ Don't use the certs bundled with requests, use ca-certificates. """ ++ return "/etc/pki/tls/certs/ca-bundle.crt" if __name__ == '__main__': print(where()) -- -1.8.3.1 +1.9.3 diff --git a/python-requests-system-chardet-not-charade.patch b/python-requests-system-chardet-not-charade.patch deleted file mode 100644 index ea71522..0000000 --- a/python-requests-system-chardet-not-charade.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up ./requests/compat.py.orig ./requests/compat.py ---- ./requests/compat.py.orig 2014-05-30 00:23:21.910322912 -0700 -+++ ./requests/compat.py 2014-05-30 00:24:06.697631425 -0700 -@@ -4,7 +4,7 @@ - pythoncompat - """ - --from .packages import chardet -+import chardet - - import sys - diff --git a/python-requests-system-urllib3.patch b/python-requests-system-urllib3.patch deleted file mode 100644 index 235f807..0000000 --- a/python-requests-system-urllib3.patch +++ /dev/null @@ -1,92 +0,0 @@ -diff -up ./requests/adapters.py.orig ./requests/adapters.py ---- ./requests/adapters.py.orig 2014-05-30 00:27:36.151074219 -0700 -+++ ./requests/adapters.py 2014-05-30 00:31:26.712662414 -0700 -@@ -11,18 +11,18 @@ and maintain connections. - import socket - - from .models import Response --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.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 .utils import (DEFAULT_CA_BUNDLE_PATH, get_encoding_from_headers, - prepend_scheme_if_needed, get_auth_from_url) - 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 HTTPError as _HTTPError --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 urllib3.exceptions import HTTPError as _HTTPError -+from urllib3.exceptions import ProxyError as _ProxyError - from .cookies import extract_cookies_to_jar - from .exceptions import ConnectionError, Timeout, SSLError, ProxyError - from .auth import _basic_auth_str -diff -up ./requests/compat.py.orig ./requests/compat.py ---- ./requests/compat.py.orig 2014-05-30 00:46:53.888049149 -0700 -+++ ./requests/compat.py 2014-05-30 00:54:17.647105931 -0700 -@@ -89,7 +89,10 @@ if is_py2: - import cookielib - from Cookie import Morsel - from StringIO import StringIO -- from .packages.urllib3.packages.ordered_dict import OrderedDict -+ try: -+ from collections import OrderedDict -+ except ImportError: -+ from ordereddict import OrderedDict - from httplib import IncompleteRead - - builtin_str = str -diff -up ./requests/exceptions.py.orig ./requests/exceptions.py ---- ./requests/exceptions.py.orig 2014-05-30 00:59:00.825056566 -0700 -+++ ./requests/exceptions.py 2014-05-30 00:59:13.416143297 -0700 -@@ -7,7 +7,7 @@ requests.exceptions - This module contains the set of Requests' exceptions. - - """ --from .packages.urllib3.exceptions import HTTPError as BaseHTTPError -+from urllib3.exceptions import HTTPError as BaseHTTPError - - - class RequestException(IOError): -diff -up ./requests/__init__.py.orig ./requests/__init__.py ---- ./requests/__init__.py.orig 2014-05-30 00:27:56.025211120 -0700 -+++ ./requests/__init__.py 2014-05-30 00:54:37.009239302 -0700 -@@ -48,13 +48,6 @@ __author__ = 'Kenneth Reitz' - __license__ = 'Apache 2.0' - __copyright__ = 'Copyright 2014 Kenneth Reitz' - --# Attempt to enable urllib3's SNI support, if possible --try: -- from .packages.urllib3.contrib import pyopenssl -- pyopenssl.inject_into_urllib3() --except ImportError: -- pass -- - from . import utils - from .models import Request, Response, PreparedRequest - from .api import request, get, head, post, patch, put, delete, options -diff -up ./requests/models.py.orig ./requests/models.py ---- ./requests/models.py.orig 2014-05-30 00:27:18.926955573 -0700 -+++ ./requests/models.py 2014-05-30 00:31:12.714565990 -0700 -@@ -16,10 +16,10 @@ from .structures import CaseInsensitiveD - - from .auth import HTTPBasicAuth - from .cookies import cookiejar_from_dict, get_cookie_header --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 urllib3.fields import RequestField -+from urllib3.filepost import encode_multipart_formdata -+from urllib3.util import parse_url -+from urllib3.exceptions import DecodeError - from .exceptions import ( - HTTPError, RequestException, MissingSchema, InvalidURL, - ChunkedEncodingError, ContentDecodingError) diff --git a/python-requests.spec b/python-requests.spec index 540b958..a5c7db0 100644 --- a/python-requests.spec +++ b/python-requests.spec @@ -5,8 +5,8 @@ %endif Name: python-requests -Version: 2.3.0 -Release: 3%{?dist} +Version: 2.5.0 +Release: 1%{?dist} Summary: HTTP library, written in Python, for human beings License: ASL 2.0 @@ -15,12 +15,9 @@ Source0: http://pypi.python.org/packages/source/r/requests/requests-%{ver # Explicitly use the system certificates in ca-certificates. # https://bugzilla.redhat.com/show_bug.cgi?id=904614 Patch0: python-requests-system-cert-bundle.patch -# Unbundle python-charade (a fork of python-chardet). -# https://bugzilla.redhat.com/show_bug.cgi?id=904623 -Patch1: python-requests-system-chardet-not-charade.patch -# Unbundle python-charade (a fork of python-urllib3). -# https://bugzilla.redhat.com/show_bug.cgi?id=904623 -Patch2: python-requests-system-urllib3.patch + +# Remove an unnecessary reference to a bundled compat lib in urllib3 +Patch1: python-requests-remove-nested-bundling-dep.patch BuildArch: noarch BuildRequires: python2-devel @@ -63,7 +60,6 @@ designed to make HTTP requests easy for developers. %patch0 -p1 %patch1 -p1 -%patch2 -p1 # Unbundle the certificate bundle from mozilla. rm -rf requests/cacert.pem @@ -78,32 +74,32 @@ cp -a . %{py3dir} pushd %{py3dir} %{__python3} setup.py build -# Unbundle chardet. Patch1 switches usage to system chardet. +# Unbundle chardet and urllib3. We replace these with symlinks to system libs. rm -rf build/lib/requests/packages/chardet - -# Unbundle urllib3. Patch1 switches usage to system urllib3. -rm -rf build/lib/requests/packages +rm -rf build/lib/requests/packages/urllib3 popd %endif %{__python} setup.py build -# Unbundle chardet. Patch1 switches usage to system chardet. -rm -rf build/lib/requests/packages/charade - -# Unbundle urllib3. Patch1 switches usage to system urllib3. -rm -rf build/lib/requests/packages +# Unbundle chardet and urllib3. We replace these with symlinks to system libs. +rm -rf build/lib/requests/packages/chardet +rm -rf build/lib/requests/packages/urllib3 %install rm -rf $RPM_BUILD_ROOT %if 0%{?_with_python3} pushd %{py3dir} %{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT +ln -s ../../chardet %{buildroot}/%{python3_sitelib}/requests/packages/chardet +ln -s ../../urllib3 %{buildroot}/%{python3_sitelib}/requests/packages/urllib3 popd %endif %{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT +ln -s ../../chardet %{buildroot}/%{python_sitelib}/requests/packages/chardet +ln -s ../../urllib3 %{buildroot}/%{python_sitelib}/requests/packages/urllib3 ## The tests succeed if run locally, but fail in koji. ## They require an active network connection to query httpbin.org @@ -134,6 +130,15 @@ popd %endif %changelog +* Thu Dec 11 2014 Ralph Bean - 2.5.0-1 +- Latest upstream, 2.5.0 for #1171068 + +* Wed Nov 05 2014 Ralph Bean - 2.4.3-1 +- Latest upstream, 2.4.3 for #1136283 + +* Wed Nov 05 2014 Ralph Bean - 2.3.0-4 +- Re-do unbundling by symlinking system libs into the requests/packages/ dir. + * Sun Aug 3 2014 Tom Callaway - 2.3.0-3 - fix license handling diff --git a/sources b/sources index 2ed91ce..0c9f3ac 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -7449ffdc8ec9ac37bbcd286003c80f00 requests-2.3.0.tar.gz +b8bf3ddca75e7ecf1b6776da1e6e3385 requests-2.5.0.tar.gz