]> git.pld-linux.org Git - packages/python-requests.git/commitdiff
- updated to 2.13.0 auto/th/python-requests-2.13.0-1
authorJakub Bogusz <qboosh@pld-linux.org>
Wed, 19 Apr 2017 16:40:55 +0000 (18:40 +0200)
committerJakub Bogusz <qboosh@pld-linux.org>
Wed, 19 Apr 2017 16:40:55 +0000 (18:40 +0200)
- removed obsolete system-charade-and-urllib3 (system libs are now partially supported, but unadvised upstream)
- added remove-nested-bundling-dep patch from Fedora

python-requests-remove-nested-bundling-dep.patch [new file with mode: 0644]
python-requests.spec
system-charade-and-urllib3.patch [deleted file]

diff --git a/python-requests-remove-nested-bundling-dep.patch b/python-requests-remove-nested-bundling-dep.patch
new file mode 100644 (file)
index 0000000..d915a4e
--- /dev/null
@@ -0,0 +1,29 @@
+From 8c2259d4ab03ef982738aaf863068a1015cadf3d Mon Sep 17 00:00:00 2001
+From: Ralph Bean <rbean@redhat.com>
+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
+
index 2f147d1f96ce8d70696fdcfad2f17e0dca159925..c8a4156769e2b9ca7545944631baba1cd2ad05b7 100644 (file)
@@ -1,56 +1,63 @@
 #
 # Conditional build:
-%bcond_with    tests   # perform "make test"
+%bcond_with    tests   # test target (tests not included in dist tarball as of 2.13.0)
 %bcond_without python2 # CPython 2.x module
 %bcond_without python3 # CPython 3.x module
 %bcond_without bundled # bundled libraries
 #
-%define                urllib3ver      1.13
+%define                urllib3ver      1.20
 %define        module  requests
 Summary:       HTTP library for Python 2
 Summary(pl.UTF-8):     Biblioteka HTTP dla Pythona 2
 Name:          python-%{module}
-Version:       2.11.1
-Release:       2
-License:       Apache2
+Version:       2.13.0
+Release:       1
+License:       Apache v2.0
 Group:         Development/Languages/Python
-Source0:       https://pypi.python.org/packages/2e/ad/e627446492cc374c284e82381215dcd9a0a87c4f6e90e9789afefe6da0ad/%{module}-%{version}.tar.gz
-# Source0-md5: ad5f9c47b5c5dfdb28363ad7546b0763
-URL:           http://python-requests.org
-# find . -name '*.py' -exec sed -i -e 's#requests\.packages\.urllib3#urllib3#g' "{}" ";"
-# find . -name '*.py' -exec sed -i -e 's#\.packages\.urllib3#urllib3#g' "{}" ";"
-# find . -name '*.py' -exec sed -i -e 's#from \.packages import chardet#import charade as chardet#g' "{}" ";"
-# + manual removal from setup.py
-Patch0:                system-charade-and-urllib3.patch
+Source0:       https://pypi.python.org/packages/16/09/37b69de7c924d318e51ece1c4ceb679bf93be9d05973bb30c35babd596e2/%{module}-%{version}.tar.gz
+# Source0-md5: 921ec6b48f2ddafc8bb6160957baf444
+Patch0:                %{name}-remove-nested-bundling-dep.patch
 Patch1:                system-cert.patch
+URL:           http://python-requests.org/
 %if %{with python2}
 BuildRequires: python-modules >= 1:2.6
 %if %{without bundled}
-BuildRequires: python-charade
+BuildRequires: python-chardet >= 2.3.0
 BuildRequires: python-urllib3 >= %{urllib3ver}
 %endif
-%{?with_tests:BuildRequires:   python-pytest >= 2.3.4}
+%if %{with tests}
+BuildRequires: python-pytest >= 2.8.0
+BuildRequires: python-pytest-cov
+BuildRequires: python-pytest-httpbin >= 0.0.7
+BuildRequires: python-pytest-mock
+%endif
 %endif
 %if %{with python3}
 BuildRequires: python3-modules >= 1:3.2
 %if %{without bundled}
-BuildRequires: python3-charade
+BuildRequires: python3-chardet >= 2.3.0
 BuildRequires: python3-urllib3 >= %{urllib3ver}
 %endif
-%{?with_tests:BuildRequires:   python3-pytest >= 2.3.4}
+%if %{with tests}
+BuildRequires: python3-pytest >= 2.8.0
+BuildRequires: python3-pytest-cov
+BuildRequires: python3-pytest-httpbin >= 0.0.7
+BuildRequires: python3-pytest-mock
+%endif
 %endif
 BuildRequires: rpm-pythonprov
 BuildRequires: rpmbuild(macros) >= 1.713
 Requires:      ca-certificates
+Requires:      python-idna >= 2.0.0
 Requires:      python-modules >= 1:2.6
 %if %{without bundled}
-Requires:      python-charade
+Requires:      python-chardet >= 2.3.0
 Requires:      python-urllib3 >= %{urllib3ver}
 %endif
 # for python2 only to get SNI working. python3 doesn't need this
 Requires:      python-ndg-httpsclient
 Requires:      python-pyasn1
-Requires:      python-pyOpenSSL
+Requires:      python-pyOpenSSL >= 0.14
 BuildArch:     noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -84,7 +91,8 @@ Group:                Development/Languages/Python
 Requires:      ca-certificates
 Requires:      python3-modules >= 1:3.2
 %if %{without bundled}
-Requires:      python3-charade
+Requires:      python3-chardet >= 2.3.0
+Requires:      python3-idna >= 2.0.0
 Requires:      python3-urllib3 >= %{urllib3ver}
 %endif
 
@@ -119,12 +127,10 @@ Ten pakiet zawiera moduĊ‚ dla Pythona 3.x.
 %build
 %if %{with python2}
 %py_build %{?with_tests:test}
-%{?with_tests:cp requirements.txt test_requests.py build-2; cd build-2; PYTHONPATH=$(pwd)/lib %{__python} test_requests.py; cd ..}
 %endif
 
 %if %{with python3}
 %py3_build %{?with_tests:test}
-%{?with_tests:cp requirements.txt test_requests.py build-3; cd build-3; PYTHONPATH=$(pwd)/lib %{__python3} test_requests.py; cd ..}
 %endif
 
 %install
diff --git a/system-charade-and-urllib3.patch b/system-charade-and-urllib3.patch
deleted file mode 100644 (file)
index 7237dc1..0000000
+++ /dev/null
@@ -1,154 +0,0 @@
-diff -urNp requests-2.5.3.org/requests/adapters.py requests-2.5.3/requests/adapters.py
---- requests-2.5.3.org/requests/adapters.py    2014-12-01 22:02:39.000000000 +0100
-+++ requests-2.5.3/requests/adapters.py        2015-03-06 20:15:36.361707968 +0100
-@@ -11,22 +11,22 @@ and maintain connections.
- 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
- from .utils import (DEFAULT_CA_BUNDLE_PATH, get_encoding_from_headers,
-                     prepend_scheme_if_needed, get_auth_from_url, urldefragauth)
- from .structures import CaseInsensitiveDict
--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 .packages.urllib3.exceptions import ProtocolError
--from .packages.urllib3.exceptions import ReadTimeoutError
--from .packages.urllib3.exceptions import SSLError as _SSLError
--from .packages.urllib3.exceptions import ResponseError
-+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 urllib3.exceptions import ResponseError
- from .cookies import extract_cookies_to_jar
- from .exceptions import (ConnectionError, ConnectTimeout, ReadTimeout, SSLError,
-                          ProxyError, RetryError)
-diff -urNp requests-2.5.3.org/requests/compat.py requests-2.5.3/requests/compat.py
---- requests-2.5.3.org/requests/compat.py      2015-02-24 17:27:00.000000000 +0100
-+++ requests-2.5.3/requests/compat.py  2015-03-06 20:15:36.365041382 +0100
-@@ -4,7 +4,7 @@
- pythoncompat
- """
--from .packages import chardet
-+import charade as chardet
- import sys
-@@ -39,7 +39,7 @@ if is_py2:
-     import cookielib
-     from Cookie import Morsel
-     from StringIO import StringIO
--    from .packages.urllib3.packages.ordered_dict import OrderedDict
-+    from urllib3.packages.ordered_dict import OrderedDict
-     builtin_str = str
-     bytes = str
-diff -urNp requests-2.5.3.org/requests/exceptions.py requests-2.5.3/requests/exceptions.py
---- requests-2.5.3.org/requests/exceptions.py  2014-12-01 22:02:39.000000000 +0100
-+++ requests-2.5.3/requests/exceptions.py      2015-03-06 20:15:36.368374796 +0100
-@@ -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 -urNp requests-2.5.3.org/requests/__init__.py requests-2.5.3/requests/__init__.py
---- requests-2.5.3.org/requests/__init__.py    2015-02-24 17:33:01.000000000 +0100
-+++ requests-2.5.3/requests/__init__.py        2015-03-06 20:15:36.358374555 +0100
-@@ -50,7 +50,7 @@ __copyright__ = 'Copyright 2015 Kenneth
- # Attempt to enable urllib3's SNI support, if possible
- try:
--    from .packages.urllib3.contrib import pyopenssl
-+    from urllib3.contrib import pyopenssl
-     pyopenssl.inject_into_urllib3()
- except ImportError:
-     pass
-diff -urNp requests-2.5.3.org/requests/models.py requests-2.5.3/requests/models.py
---- requests-2.5.3.org/requests/models.py      2014-12-23 18:43:04.000000000 +0100
-+++ requests-2.5.3/requests/models.py  2015-03-06 20:15:36.375041624 +0100
-@@ -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 (
-+from urllib3.fields import RequestField
-+from urllib3.filepost import encode_multipart_formdata
-+from urllib3.util import parse_url
-+from urllib3.exceptions import (
-     DecodeError, ReadTimeoutError, ProtocolError, LocationParseError)
- from .exceptions import (
-     HTTPError, MissingSchema, InvalidURL, ChunkedEncodingError,
-diff -urNp requests-2.5.3.org/requests/packages/__init__.py requests-2.5.3/requests/packages/__init__.py
---- requests-2.5.3.org/requests/packages/__init__.py   2015-02-24 17:27:00.000000000 +0100
-+++ requests-2.5.3/requests/packages/__init__.py       2015-03-06 20:15:36.375041624 +0100
-@@ -65,7 +65,7 @@ class VendorAlias(object):
-             finally:
-                 # Re-add any additions to sys.meta_path that were made while
-                 # during the import we just did, otherwise things like
--                # requests.packages.urllib3.poolmanager will fail.
-+                # urllib3.poolmanager will fail.
-                 for m in sys.meta_path:
-                     if m not in real_meta_path:
-                         real_meta_path.append(m)
-diff -urNp requests-2.5.3.org/requests/sessions.py requests-2.5.3/requests/sessions.py
---- requests-2.5.3.org/requests/sessions.py    2014-12-01 22:02:39.000000000 +0100
-+++ requests-2.5.3/requests/sessions.py        2015-03-06 20:15:36.488377701 +0100
-@@ -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 (
-     TooManyRedirects, InvalidSchema, ChunkedEncodingError, ContentDecodingError)
--from .packages.urllib3._collections import RecentlyUsedContainer
-+from urllib3._collections import RecentlyUsedContainer
- from .structures import CaseInsensitiveDict
- from .adapters import HTTPAdapter
-diff -urNp requests-2.5.3.org/setup.py requests-2.5.3/setup.py
---- requests-2.5.3.org/setup.py        2014-09-10 17:30:41.000000000 +0200
-+++ requests-2.5.3/setup.py    2015-03-06 20:16:15.829329894 +0100
-@@ -18,13 +18,6 @@ if sys.argv[-1] == 'publish':
- packages = [
-     'requests',
--    'requests.packages',
--    'requests.packages.chardet',
--    'requests.packages.urllib3',
--    'requests.packages.urllib3.packages',
--    'requests.packages.urllib3.contrib',
--    'requests.packages.urllib3.util',
--    'requests.packages.urllib3.packages.ssl_match_hostname',
- ]
- requires = []
-diff -urNp requests-2.5.3.org/test_requests.py requests-2.5.3/test_requests.py
---- requests-2.5.3.org/test_requests.py        2015-02-24 17:27:00.000000000 +0100
-+++ requests-2.5.3/test_requests.py    2015-03-06 20:15:36.498377943 +0100
-@@ -1589,7 +1589,7 @@ def test_prepare_unicode_url():
- def test_urllib3_retries():
--    from requests.packages.urllib3.util import Retry
-+    from urllib3.util import Retry
-     s = requests.Session()
-     s.mount('http://', HTTPAdapter(max_retries=Retry(
-         total=2, status_forcelist=[500]
This page took 0.064542 seconds and 4 git commands to generate.