From ee0d6bcb47d97f7bfbc81b04c1b73e7b3757f5a52627bc6f1f2caca3d71efb90 Mon Sep 17 00:00:00 2001 From: Jan Matejek Date: Tue, 23 Feb 2016 15:37:33 +0000 Subject: [PATCH] Accepting request 360051 from home:XRevan86 OBS-URL: https://build.opensuse.org/request/show/360051 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-requests?expand=0&rev=85 --- no-default-cacert.patch | 12 ++++++------ python-requests.changes | 40 ++++++++++++++++++++++++++++++++++++++++ python-requests.spec | 35 +++++++++++++++++++++-------------- requests-2.8.1.tar.gz | 3 --- requests-2.9.1.tar.gz | 3 +++ 5 files changed, 70 insertions(+), 23 deletions(-) delete mode 100644 requests-2.8.1.tar.gz create mode 100644 requests-2.9.1.tar.gz diff --git a/no-default-cacert.patch b/no-default-cacert.patch index 64d9891..f543168 100644 --- a/no-default-cacert.patch +++ b/no-default-cacert.patch @@ -5,7 +5,7 @@ +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): +@@ -182,9 +182,6 @@ class HTTPAdapter(BaseAdapter): if not cert_loc: cert_loc = DEFAULT_CA_BUNDLE_PATH @@ -13,8 +13,8 @@ - raise Exception("Could not find a suitable SSL CA certificate bundle.") - conn.cert_reqs = 'CERT_REQUIRED' - conn.ca_certs = cert_loc - else: + + if not os.path.isdir(cert_loc): --- a/requests/certs.py +++ b/requests/certs.py @@ -18,8 +18,9 @@ try: @@ -23,9 +23,9 @@ """Return the preferred certificate bundle.""" - # vendored bundle inside Requests - return os.path.join(os.path.dirname(__file__), 'cacert.pem') -+ # in openSUSE we rely on openssl's default instead of -+ # hardcoding stuff elsewhere -+ return None ++ # in openSUSE we rely on ca-certificates instead of ++ # having an another bundle ++ return '/etc/ssl/ca-bundle.pem' if __name__ == '__main__': print(where()) diff --git a/python-requests.changes b/python-requests.changes index 2163bce..d353d7a 100644 --- a/python-requests.changes +++ b/python-requests.changes @@ -1,3 +1,43 @@ +------------------------------------------------------------------- +Wed Feb 17 14:47:12 UTC 2016 - sor.alexei@meowr.ru + +- Update to 2.9.1 (changes since 2.8.1): + * The verify keyword argument now supports being passed a path to + a directory of CA certificates, not just a single-file bundle. + * Warnings are now emitted when sending files opened in text mode. + * Added the 511 Network Authentication Required status code to the + status code registry. + * For file-like objects that are not seeked to the very beginning, + we now send the content length for the number of bytes we will + actually read, rather than the total size of the file, allowing + partial file uploads. + * When uploading file-like objects, if they are empty or have no + obvious content length we set Transfer-Encoding: chunked rather + than Content-Length: 0. + * We correctly receive the response in buffered mode when + uploading chunked bodies. + * We now handle being passed a query string as a bytestring on + Python 3, by decoding it as UTF-8. + * Sessions are now closed in all cases (exceptional and not) when + using the functional API rather than leaking and waiting for + the garbage collector to clean them up. + * Correctly handle digest auth headers with a malformed qop + directive that contains no token, by treating it the same as if + no qop directive was provided at all. + * Minor performance improvements when removing specific cookies + by name. + * Fix errors when calculating cookie expiration dates in certain + locales. + * Update bundled urllib3 to 1.13.1. +- Rebase no-default-cacert.patch. +- Modify no-default-cacert.patch: output /etc/ssl/ca-bundle.pem + instead of neither NULL nor /etc/ssl/certs/ as a path to cacerts + bundle (boo#967128). +- Don't apply no-default-cacert.patch on SLE. +- Require ca-certificates package (but not on SLE). +- Tests are being improperly started and actual ones require + network connection, so fix and comment out. + ------------------------------------------------------------------- Thu Dec 17 13:45:59 UTC 2015 - rjschwei@suse.com diff --git a/python-requests.spec b/python-requests.spec index fd510f8..a92897c 100644 --- a/python-requests.spec +++ b/python-requests.spec @@ -1,7 +1,7 @@ # # spec file for package python-requests # -# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,30 +16,36 @@ # +%if 0%{?suse_version} < 1120 +%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} +%endif Name: python-requests -Version: 2.8.1 +Version: 2.9.1 Release: 0 Summary: Awesome Python HTTP Library That's Actually Usable License: Apache-2.0 Group: Development/Languages/Python -Url: http://python-requests.org +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 +# PATCH-FIX-OPENSUSE no-default-cacert.patch -- Completely ignore the internal CA bundle. Patch0: no-default-cacert.patch BuildRequires: python BuildRequires: python-devel BuildRequires: python-py BuildRequires: python-setuptools Requires: python -# really needed? +# Really needed? #Requires: python-ndg-httpsclient Requires: python-pyOpenSSL Requires: python-pyasn1 -%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 +%if 0%{?suse_version} >= 1120 && !(0%{?suse_version} == 1315 && !0%{?is_opensuse}) +BuildRequires: ca-certificates +Requires: ca-certificates +%endif +%if 0%{?suse_version} >= 1120 BuildArch: noarch +%else +BuildRoot: %{_tmppath}/%{name}-%{version}-build %endif %description @@ -67,10 +73,10 @@ Features: %prep %setup -q -n requests-%{version} -# For rpmlint warning: remove shebang from python library: -sed -i '/^#!/d' ./requests/certs.py +%if 0%{?suse_version} >= 1120 && !(0%{?suse_version} == 1315 && !0%{?is_opensuse}) %patch0 -p1 -rm ./requests/cacert.pem +rm -f requests/cacert.pem +%endif %build python setup.py build @@ -79,8 +85,9 @@ python setup.py build python setup.py install \ --root=%{buildroot} --prefix=%{_prefix} -%check -python setup.py test +# Tests require network access. +# %check +# python test_requests.py %files %defattr(-,root,root) diff --git a/requests-2.8.1.tar.gz b/requests-2.8.1.tar.gz deleted file mode 100644 index 6af30b9..0000000 --- a/requests-2.8.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:84fe8d5bf4dcdcc49002446c47a146d17ac10facf00d9086659064ac43b6c25b -size 480803 diff --git a/requests-2.9.1.tar.gz b/requests-2.9.1.tar.gz new file mode 100644 index 0000000..8e8bc9b --- /dev/null +++ b/requests-2.9.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c577815dd00f1394203fc44eb979724b098f88264a9ef898ee45b8e5e9cf587f +size 484252