Accepting request 361137 from devel:languages:python

1

OBS-URL: https://build.opensuse.org/request/show/361137
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-requests?expand=0&rev=31
This commit is contained in:
Dominique Leuenberger 2016-02-25 21:08:19 +00:00 committed by Git OBS Bridge
commit f4cbce5cd3
5 changed files with 70 additions and 23 deletions

View File

@ -5,7 +5,7 @@
+include README.rst LICENSE NOTICE HISTORY.rst test_requests.py requirements.txt +include README.rst LICENSE NOTICE HISTORY.rst test_requests.py requirements.txt
--- a/requests/adapters.py --- a/requests/adapters.py
+++ b/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: if not cert_loc:
cert_loc = DEFAULT_CA_BUNDLE_PATH cert_loc = DEFAULT_CA_BUNDLE_PATH
@ -13,8 +13,8 @@
- raise Exception("Could not find a suitable SSL CA certificate bundle.") - raise Exception("Could not find a suitable SSL CA certificate bundle.")
- -
conn.cert_reqs = 'CERT_REQUIRED' conn.cert_reqs = 'CERT_REQUIRED'
conn.ca_certs = cert_loc
else: if not os.path.isdir(cert_loc):
--- a/requests/certs.py --- a/requests/certs.py
+++ b/requests/certs.py +++ b/requests/certs.py
@@ -18,8 +18,9 @@ try: @@ -18,8 +18,9 @@ try:
@ -23,9 +23,9 @@
"""Return the preferred certificate bundle.""" """Return the preferred certificate bundle."""
- # vendored bundle inside Requests - # vendored bundle inside Requests
- return os.path.join(os.path.dirname(__file__), 'cacert.pem') - return os.path.join(os.path.dirname(__file__), 'cacert.pem')
+ # in openSUSE we rely on openssl's default instead of + # in openSUSE we rely on ca-certificates instead of
+ # hardcoding stuff elsewhere + # having an another bundle
+ return None + return '/etc/ssl/ca-bundle.pem'
if __name__ == '__main__': if __name__ == '__main__':
print(where()) print(where())

View File

@ -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 Thu Dec 17 13:45:59 UTC 2015 - rjschwei@suse.com

View File

@ -1,7 +1,7 @@
# #
# spec file for package python-requests # 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 # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # 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 Name: python-requests
Version: 2.8.1 Version: 2.9.1
Release: 0 Release: 0
Summary: Awesome Python HTTP Library That's Actually Usable Summary: Awesome Python HTTP Library That's Actually Usable
License: Apache-2.0 License: Apache-2.0
Group: Development/Languages/Python 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 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 Patch0: no-default-cacert.patch
BuildRequires: python BuildRequires: python
BuildRequires: python-devel BuildRequires: python-devel
BuildRequires: python-py BuildRequires: python-py
BuildRequires: python-setuptools BuildRequires: python-setuptools
Requires: python Requires: python
# really needed? # Really needed?
#Requires: python-ndg-httpsclient #Requires: python-ndg-httpsclient
Requires: python-pyOpenSSL Requires: python-pyOpenSSL
Requires: python-pyasn1 Requires: python-pyasn1
%if 0%{?suse_version} <= 1110 %if 0%{?suse_version} >= 1120 && !(0%{?suse_version} == 1315 && !0%{?is_opensuse})
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} BuildRequires: ca-certificates
BuildRoot: %{_tmppath}/%{name}-%{version}-build Requires: ca-certificates
%else %endif
%if 0%{?suse_version} >= 1120
BuildArch: noarch BuildArch: noarch
%else
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%endif %endif
%description %description
@ -67,10 +73,10 @@ Features:
%prep %prep
%setup -q -n requests-%{version} %setup -q -n requests-%{version}
# For rpmlint warning: remove shebang from python library: %if 0%{?suse_version} >= 1120 && !(0%{?suse_version} == 1315 && !0%{?is_opensuse})
sed -i '/^#!/d' ./requests/certs.py
%patch0 -p1 %patch0 -p1
rm ./requests/cacert.pem rm -f requests/cacert.pem
%endif
%build %build
python setup.py build python setup.py build
@ -79,8 +85,9 @@ python setup.py build
python setup.py install \ python setup.py install \
--root=%{buildroot} --prefix=%{_prefix} --root=%{buildroot} --prefix=%{_prefix}
%check # Tests require network access.
python setup.py test # %check
# python test_requests.py
%files %files
%defattr(-,root,root) %defattr(-,root,root)

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:84fe8d5bf4dcdcc49002446c47a146d17ac10facf00d9086659064ac43b6c25b
size 480803

3
requests-2.9.1.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c577815dd00f1394203fc44eb979724b098f88264a9ef898ee45b8e5e9cf587f
size 484252