File python-requests.spec of Package python-requests

# spec file for package python-requests
# 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
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

%if 0%{?suse_version} < 1120
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
Name:           python-requests
Version:        2.11.1
Release:        0
Summary:        Awesome Python HTTP Library That's Actually Usable
License:        Apache-2.0
Group:          Development/Languages/Python
# PATCH-FIX-OPENSUSE no-default-cacert.patch -- Completely ignore the internal CA bundle.
Patch0:         no-default-cacert.patch
# PATCH-FIX-UPSTREAM update urllib3 to do the proper passthrough to set_default_verify_paths
Patch1:         urllib3-ssl-default-context.patch
BuildRequires:  python
BuildRequires:  python-devel
BuildRequires:  python-py
BuildRequires:  python-setuptools
Requires:       python
# requirements for pyopenssl fallback of bundled urllib3
Recommends:     python-ndg-httpsclient
Recommends:     python-pyOpenSSL
Recommends:     python-pyasn1
%if 0%{?suse_version} <= 1200
BuildRequires:  openssl-certs
Requires:       openssl-certs
BuildRequires:  ca-certificates
Requires:       ca-certificates
# for good measure, at least recommend an actual set of certificates
Recommends:     ca-certificates-mozilla
%if 0%{?suse_version} >= 1120
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

Requests is an ISC Licensed HTTP library, written in Python, for
human beings.

Most existing Python modules for sending HTTP requests are
extremely verbose and cumbersome. Python's builtin urllib2 module
provides most of the HTTP capabilities you should need, but the api
is thoroughly broken. It requires an enormous amount of work (even
method overrides) to perform the simplest of tasks.

 - Extremely simple GET, HEAD, POST, PUT, DELETE Requests:
   + Simple HTTP Header Request Attachment.
   + Simple Data/Params Request Attachment.
   + Simple Multipart File Uploads.
   + CookieJar Support.
   + Redirection History.
   + Redirection Recursion Urllib Fix.
   + Auto Decompression of GZipped Content.
   + Unicode URL Support.
 - Simple Authentication:
   + Simple URL + HTTP Auth Registry.

%setup -q -n requests-%{version}
%patch0 -p1
pushd requests/packages
%patch1 -p1
rm -f requests/cacert.pem

python build

python install \
  --root=%{buildroot} --prefix=%{_prefix}

# Tests require network access.
# %check
# python


openSUSE Build Service is sponsored by