Re-do unbundling with symlinks.
Requested https://twitter.com/sigmavirus24/status/529826381333417984
This commit is contained in:
parent
cd981a7419
commit
1dbd573777
31
python-requests-remove-nested-bundling-dep.patch
Normal file
31
python-requests-remove-nested-bundling-dep.patch
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
From e74bf477e53f9089e6d763d676333c9d84ab71e0 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Ralph Bean <rbean@redhat.com>
|
||||||
|
Date: Wed, 5 Nov 2014 09:38:42 -0500
|
||||||
|
Subject: [PATCH] Remove nested budnling dep.
|
||||||
|
|
||||||
|
---
|
||||||
|
requests/compat.py | 6 +++++-
|
||||||
|
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/requests/compat.py b/requests/compat.py
|
||||||
|
index bdf10d6..29cce93 100644
|
||||||
|
--- a/requests/compat.py
|
||||||
|
+++ b/requests/compat.py
|
||||||
|
@@ -89,9 +89,13 @@ if is_py2:
|
||||||
|
import cookielib
|
||||||
|
from Cookie import Morsel
|
||||||
|
from StringIO import StringIO
|
||||||
|
- from .packages.urllib3.packages.ordered_dict import OrderedDict
|
||||||
|
from httplib import IncompleteRead
|
||||||
|
|
||||||
|
+ try:
|
||||||
|
+ from collections import OrderedDict # py2.7
|
||||||
|
+ except:
|
||||||
|
+ from ordereddict import OrderedDict # py2.6 and lower (el6, etc.)
|
||||||
|
+
|
||||||
|
builtin_str = str
|
||||||
|
bytes = str
|
||||||
|
str = unicode
|
||||||
|
--
|
||||||
|
1.9.3
|
||||||
|
|
@ -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
|
|
||||||
|
|
@ -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)
|
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
Name: python-requests
|
Name: python-requests
|
||||||
Version: 2.3.0
|
Version: 2.3.0
|
||||||
Release: 3%{?dist}
|
Release: 4%{?dist}
|
||||||
Summary: HTTP library, written in Python, for human beings
|
Summary: HTTP library, written in Python, for human beings
|
||||||
|
|
||||||
License: ASL 2.0
|
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.
|
# Explicitly use the system certificates in ca-certificates.
|
||||||
# https://bugzilla.redhat.com/show_bug.cgi?id=904614
|
# https://bugzilla.redhat.com/show_bug.cgi?id=904614
|
||||||
Patch0: python-requests-system-cert-bundle.patch
|
Patch0: python-requests-system-cert-bundle.patch
|
||||||
# Unbundle python-charade (a fork of python-chardet).
|
|
||||||
# https://bugzilla.redhat.com/show_bug.cgi?id=904623
|
# Remove an unnecessary reference to a bundled compat lib in urllib3
|
||||||
Patch1: python-requests-system-chardet-not-charade.patch
|
Patch1: python-requests-remove-nested-bundling-dep.patch
|
||||||
# Unbundle python-charade (a fork of python-urllib3).
|
|
||||||
# https://bugzilla.redhat.com/show_bug.cgi?id=904623
|
|
||||||
Patch2: python-requests-system-urllib3.patch
|
|
||||||
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
BuildRequires: python2-devel
|
BuildRequires: python2-devel
|
||||||
@ -63,7 +60,6 @@ designed to make HTTP requests easy for developers.
|
|||||||
|
|
||||||
%patch0 -p1
|
%patch0 -p1
|
||||||
%patch1 -p1
|
%patch1 -p1
|
||||||
%patch2 -p1
|
|
||||||
|
|
||||||
# Unbundle the certificate bundle from mozilla.
|
# Unbundle the certificate bundle from mozilla.
|
||||||
rm -rf requests/cacert.pem
|
rm -rf requests/cacert.pem
|
||||||
@ -78,32 +74,32 @@ cp -a . %{py3dir}
|
|||||||
pushd %{py3dir}
|
pushd %{py3dir}
|
||||||
%{__python3} setup.py build
|
%{__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
|
rm -rf build/lib/requests/packages/chardet
|
||||||
|
rm -rf build/lib/requests/packages/urllib3
|
||||||
# Unbundle urllib3. Patch1 switches usage to system urllib3.
|
|
||||||
rm -rf build/lib/requests/packages
|
|
||||||
|
|
||||||
popd
|
popd
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%{__python} setup.py build
|
%{__python} 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/charade
|
rm -rf build/lib/requests/packages/chardet
|
||||||
|
rm -rf build/lib/requests/packages/urllib3
|
||||||
# Unbundle urllib3. Patch1 switches usage to system urllib3.
|
|
||||||
rm -rf build/lib/requests/packages
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
%if 0%{?_with_python3}
|
%if 0%{?_with_python3}
|
||||||
pushd %{py3dir}
|
pushd %{py3dir}
|
||||||
%{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT
|
%{__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
|
popd
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT
|
%{__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.
|
## The tests succeed if run locally, but fail in koji.
|
||||||
## They require an active network connection to query httpbin.org
|
## They require an active network connection to query httpbin.org
|
||||||
@ -134,6 +130,9 @@ popd
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Nov 05 2014 Ralph Bean <rbean@redhat.com> - 2.3.0-4
|
||||||
|
- Re-do unbundling by symlinking system libs into the requests/packages/ dir.
|
||||||
|
|
||||||
* Sun Aug 3 2014 Tom Callaway <spot@fedoraproject.org> - 2.3.0-3
|
* Sun Aug 3 2014 Tom Callaway <spot@fedoraproject.org> - 2.3.0-3
|
||||||
- fix license handling
|
- fix license handling
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user