python-requests/python-requests.spec

93 lines
3.1 KiB
RPMSpec
Raw Normal View History

#
# spec file for package python-requests
#
# Copyright (c) 2013 SUSE LINUX Products 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 http://bugs.opensuse.org/
#
Name: python-requests
Accepting request 206124 from devel:languages:python - update to 2.0.1 - changes in 2.0.1: - Updated included CA Bundle with new mistrusts and automated process for the future - Added MD5-sess to Digest Auth - Accept per-file headers in multipart file POST messages. - Fixed: Don't send the full URL on CONNECT messages. - Fixed: Correctly lowercase a redirect scheme. - Fixed: Cookies not persisted when set via functional API. - Fixed: Translate urllib3 ProxyError into a requests ProxyError derived from ConnectionError. - Updated internal urllib3 and chardet. - changes in 2.0.0: - Keys in the Headers dictionary are now native strings on all Python versions, i.e. bytestrings on Python 2, unicode on Python 3. - Proxy URLs now *must* have an explicit scheme. A ``MissingSchema`` exception will be raised if they don't. - Timeouts now apply to read time if ``Stream=False``. - ``RequestException`` is now a subclass of ``IOError``, not ``RuntimeError``. - Added new method to ``PreparedRequest`` objects: ``PreparedRequest.copy()``. - Added new method to ``Session`` objects: ``Session.update_request()``. This method updates a ``Request`` object with the data (e.g. cookies) stored on the ``Session``. - Added new method to ``Session`` objects: ``Session.prepare_request()``. This method updates and prepares a ``Request`` object, and returns the corresponding ``PreparedRequest`` object. - Added new method to ``HTTPAdapter`` objects: ``HTTPAdapter.proxy_headers()``. This should not be called directly, but improves the subclass interface. - ``httplib.IncompleteRead`` exceptions caused by incorrect chunked encoding will now raise a Requests ``ChunkedEncodingError`` instead. - Invalid percent-escape sequences now cause a Requests ``InvalidURL`` exception to be raised. (forwarded request 206076 from Nijel) OBS-URL: https://build.opensuse.org/request/show/206124 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-requests?expand=0&rev=16
2013-11-08 08:39:07 +01:00
Version: 2.0.1
Release: 0
Url: http://python-requests.org
Summary: Awesome Python HTTP Library That's Actually Usable
License: Apache-2.0 and LGPL-2.1+ and MIT
Group: Development/Languages/Python
#TODO/FIXME: Maybe split out charade and urllib3 into sub-packages to simplify:
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
Patch0: no-default-cacert.patch
# PATCH-FIX-OPENSUSE no-default-cacert-sles.patch -- completely ignore the internal CA bundle (SLES version)
Patch1: no-default-cacert-sles.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: python
BuildRequires: python-devel
BuildRequires: python-setuptools
Requires: python
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%else
BuildArch: noarch
%endif
%description
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.
Features:
- 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
%prep
%setup -q -n requests-%{version}
# For rpmlint warning: remove shebang from python library:
sed -i '/^#!/d' ./requests/certs.py
%if %suse_version > 1110
%patch0 -p1
%else
%patch1 -p1
%endif
rm ./requests/cacert.pem
%build
python setup.py build
%check
python setup.py test
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
%files
%defattr(-,root,root)
%doc README.rst HISTORY.rst LICENSE NOTICE
%{python_sitelib}/*
%changelog