diff --git a/.gitignore b/.gitignore index e69de29..e7b8aff 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,6 @@ +/requests-0.5.1.tar.gz +/requests-0.6.0.tar.gz +/requests-0.6.1.tar.gz +/requests-0.6.6.tar.gz +/requests-0.10.8.tar.gz +/requests-0.13.1.tar.gz diff --git a/python-requests-cookie-handling.patch b/python-requests-cookie-handling.patch new file mode 100644 index 0000000..e4bde77 --- /dev/null +++ b/python-requests-cookie-handling.patch @@ -0,0 +1,32 @@ +From 2cecc4bc828fc1754cc26f279ec3ff5cd65cb8f7 Mon Sep 17 00:00:00 2001 +From: Ralph Bean +Date: Thu, 31 Jan 2013 21:38:58 -0500 +Subject: [PATCH] cookie handling + +--- + requests/models.py | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +Index: requests-0.13.1/requests/models.py +=================================================================== +--- requests-0.13.1.orig/requests/models.py ++++ requests-0.13.1/requests/models.py +@@ -16,7 +16,7 @@ from .structures import CaseInsensitiveD + from .status_codes import codes + + from .auth import HTTPBasicAuth, HTTPProxyAuth +-from .cookies import cookiejar_from_dict, extract_cookies_to_jar, get_cookie_header ++from .cookies import cookiejar_from_dict, extract_cookies_to_jar, get_cookie_header, RequestsCookieJar + from .packages.urllib3.exceptions import MaxRetryError, LocationParseError + from .packages.urllib3.exceptions import SSLError as _SSLError + from .packages.urllib3.exceptions import HTTPError as _HTTPError +@@ -201,7 +201,8 @@ class Request(object): + extract_cookies_to_jar(self.cookies, self, resp) + + # Save cookies in Response. +- response.cookies = self.cookies ++ response.cookies = RequestsCookieJar() ++ extract_cookies_to_jar(response.cookies, self, resp) + + # Save cookies in Session. + for cookie in self.cookies: diff --git a/python-requests.spec b/python-requests.spec new file mode 100644 index 0000000..a028fdb --- /dev/null +++ b/python-requests.spec @@ -0,0 +1,151 @@ +%if 0%{?fedora} +%global _with_python3 1 +%else +%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")} +%endif + +Name: python-requests +Version: 0.13.1 +Release: 2%{?dist} +Summary: HTTP library, written in Python, for human beings + +License: ISC and MIT +URL: http://pypi.python.org/pypi/requests +Source0: http://pypi.python.org/packages/source/r/requests/requests-%{version}.tar.gz +# Separate response cookies from request cookies discussed here: +# https://github.com/fedora-infra/python-fedora/pull/6 +Patch0: python-requests-cookie-handling.patch +BuildArch: noarch +BuildRequires: python2-devel + +Requires: ca-certificates + +%description +Most existing Python modules for sending HTTP requests are extremely verbose and +cumbersome. Python’s built-in urllib2 module provides most of the HTTP +capabilities you should need, but the API is thoroughly broken. This library is +designed to make HTTP requests easy for developers. + +%if 0%{?_with_python3} +%package -n python3-requests +Summary: HTTP library, written in Python, for human beings +BuildRequires: python3-devel +Requires: python3-chardet +%description -n python3-requests +Most existing Python modules for sending HTTP requests are extremely verbose and +cumbersome. Python’s built-in urllib2 module provides most of the HTTP +capabilities you should need, but the API is thoroughly broken. This library is +designed to make HTTP requests easy for developers. +%else +Requires: python-chardet +%endif + + +%prep +%setup -q -n requests-%{version} + +%patch0 -p1 + +### TODO: Need to unbundle libraries in the packages directory. +### https://bugzilla.redhat.com/show_bug.cgi?id=904623 +### Priority urllib3 since it's still bundled in requests-1.0.x +### And it's a security issue: +### https://bugzilla.redhat.com/show_bug.cgi?id=855322 +### https://bugzilla.redhat.com/show_bug.cgi?id=855323 +### Review request for urllib3: +### https://bugzilla.redhat.com/show_bug.cgi?id=907688 + +%if 0%{?_with_python3} +rm -rf %{py3dir} +cp -a . %{py3dir} +%endif # with_python3 + + +%build +%if 0%{?_with_python3} +pushd %{py3dir} +%{__python3} setup.py build +popd +%endif + +%{__python} setup.py build + +%install +rm -rf $RPM_BUILD_ROOT +%if 0%{?_with_python3} +pushd %{py3dir} +%{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT +popd +%endif + +%{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT + +%files +%defattr(-,root,root,-) +%doc NOTICE LICENSE README.rst HISTORY.rst +%{python_sitelib}/*.egg-info +%dir %{python_sitelib}/requests +%{python_sitelib}/requests/* + +%if 0%{?_with_python3} +%files -n python3-requests +%{python3_sitelib}/*.egg-info +%{python3_sitelib}/requests/ +%endif + + +%changelog +* Fri Feb 8 2013 Toshio Kuratomi - 0.13.1-2 +- Fix a problem with cookie handling + + https://bugzilla.redhat.com/show_bug.cgi?id=906924 + +* Sun Jun 10 2012 Arun S A G 0.13.1-1 +- Updated to latest upstream release 0.13.1 +- Use system provided ca-certificates +- No more async requests use grrequests https://github.com/kennethreitz/grequests +- Remove gevent as it is no longer required by requests + +* Sun Apr 01 2012 Arun S A G 0.11.1-1 +- Updated to upstream release 0.11.1 + +* Thu Mar 29 2012 Arun S A G 0.10.6-3 +- Support building package for EL6 + +* Tue Mar 27 2012 Rex Dieter 0.10.6-2 +- +python3-requests pkg + +* Sat Mar 3 2012 Arun SAG - 0.10.6-1 +- Updated to new upstream version + +* Sat Jan 21 2012 Arun SAG - 0.9.3-1 +- Updated to new upstream version 0.9.3 +- Include python-gevent as a dependency for requests.async +- Clean up shebangs in requests/setup.py,test_requests.py and test_requests_ext.py + +* Sat Jan 14 2012 Fedora Release Engineering - 0.8.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Sun Nov 27 2011 Arun SAG - 0.8.2-1 +- New upstream version +- keep alive support +- complete removal of cookiejar and urllib2 + +* Thu Nov 10 2011 Arun SAG - 0.7.6-1 +- Updated to new upstream release 0.7.6 + +* Thu Oct 20 2011 Arun SAG - 0.6.6-1 +- Updated to version 0.6.6 + +* Fri Aug 26 2011 Arun SAG - 0.6.1-1 +- Updated to version 0.6.1 + +* Sat Aug 20 2011 Arun SAG - 0.6.0-1 +- Updated to latest version 0.6.0 + +* Mon Aug 15 2011 Arun SAG - 0.5.1-2 +- Remove OPT_FLAGS from build section since it is a noarch package +- Fix use of mixed tabs and space +- Remove extra space around the word cumbersome in description + +* Sun Aug 14 2011 Arun SAG - 0.5.1-1 +- Initial package diff --git a/sources b/sources index e69de29..6704a5e 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +31a08091feeefe60817e45122d933219 requests-0.13.1.tar.gz