From 6f267cd54c530dd4d526be224bad818bd3371384 Mon Sep 17 00:00:00 2001 From: Arun SAG Date: Tue, 16 Aug 2011 21:58:56 +0530 Subject: [PATCH 1/9] New package: python-requests - HTTP for Humans --- .gitignore | 1 + python-requests.spec | 52 ++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 54 insertions(+) create mode 100644 python-requests.spec diff --git a/.gitignore b/.gitignore index e69de29..b6410a3 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/requests-0.5.1.tar.gz diff --git a/python-requests.spec b/python-requests.spec new file mode 100644 index 0000000..de3afd6 --- /dev/null +++ b/python-requests.spec @@ -0,0 +1,52 @@ +Name: python-requests +Version: 0.5.1 +Release: 2%{?dist} +Summary: HTTP library, written in Python, for human beings + +License: ISC +URL: http://pypi.python.org/pypi/requests +Source0: http://pypi.python.org/packages/source/r/requests/requests-%{version}.tar.gz + +BuildArch: noarch +BuildRequires: python-devel + +%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. + + +%prep +%setup -q -n requests-%{version} + + +%build +%{__python} setup.py build + + +%install +rm -rf $RPM_BUILD_ROOT +%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT + + +%files +%doc LICENSE README.rst HISTORY.rst +%{python_sitelib}/*.egg-info +%dir %{python_sitelib}/requests +%dir %{python_sitelib}/requests/packages +%dir %{python_sitelib}/requests/packages/poster +%{python_sitelib}/requests/packages/*.py* +%{python_sitelib}/requests/packages/poster/*.py* +%{python_sitelib}/requests/*.py* + + + +%changelog +* 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..9e340c8 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +33a6e65d6a4e5b2d91df76256f607b81 requests-0.5.1.tar.gz From 0fcec8febc672d03c398f92401acac4e6c674e94 Mon Sep 17 00:00:00 2001 From: Arun SAG Date: Sat, 20 Aug 2011 19:41:46 +0530 Subject: [PATCH 2/9] updated to lastest upstream release 0.6.0 --- .gitignore | 1 + python-requests.spec | 7 +++++-- sources | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index b6410a3..9dcadd4 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /requests-0.5.1.tar.gz +/requests-0.6.0.tar.gz diff --git a/python-requests.spec b/python-requests.spec index de3afd6..ce710b8 100644 --- a/python-requests.spec +++ b/python-requests.spec @@ -1,6 +1,6 @@ Name: python-requests -Version: 0.5.1 -Release: 2%{?dist} +Version: 0.6.0 +Release: 1%{?dist} Summary: HTTP library, written in Python, for human beings License: ISC @@ -43,6 +43,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* 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 diff --git a/sources b/sources index 9e340c8..13a1e7b 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -33a6e65d6a4e5b2d91df76256f607b81 requests-0.5.1.tar.gz +235e9fb6bfd71a48c0f00c0d5aef8896 requests-0.6.0.tar.gz From 0679bcec72840c35ee4e3b5063fc04d7e4706115 Mon Sep 17 00:00:00 2001 From: Arun SAG Date: Sat, 27 Aug 2011 00:40:06 +0530 Subject: [PATCH 3/9] updated to upstream version 0.6.1 --- .gitignore | 1 + python-requests.spec | 5 ++++- sources | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 9dcadd4..0c248f1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /requests-0.5.1.tar.gz /requests-0.6.0.tar.gz +/requests-0.6.1.tar.gz diff --git a/python-requests.spec b/python-requests.spec index ce710b8..9ac9138 100644 --- a/python-requests.spec +++ b/python-requests.spec @@ -1,5 +1,5 @@ Name: python-requests -Version: 0.6.0 +Version: 0.6.1 Release: 1%{?dist} Summary: HTTP library, written in Python, for human beings @@ -43,6 +43,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* 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 diff --git a/sources b/sources index 13a1e7b..8af45eb 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -235e9fb6bfd71a48c0f00c0d5aef8896 requests-0.6.0.tar.gz +07770334d48bd69ede1cc28cd0dd7680 requests-0.6.1.tar.gz From 0cc278987bf994d9470009c290cbb554ac309f21 Mon Sep 17 00:00:00 2001 From: Arun SAG Date: Fri, 21 Oct 2011 08:30:30 +0530 Subject: [PATCH 4/9] Updated to version 0.6.6 --- .gitignore | 1 + python-requests.spec | 5 ++++- sources | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 0c248f1..e86ffff 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /requests-0.5.1.tar.gz /requests-0.6.0.tar.gz /requests-0.6.1.tar.gz +/requests-0.6.6.tar.gz diff --git a/python-requests.spec b/python-requests.spec index 9ac9138..4f8eeb3 100644 --- a/python-requests.spec +++ b/python-requests.spec @@ -1,5 +1,5 @@ Name: python-requests -Version: 0.6.1 +Version: 0.6.6 Release: 1%{?dist} Summary: HTTP library, written in Python, for human beings @@ -43,6 +43,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* 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 diff --git a/sources b/sources index 8af45eb..f0ebe55 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -07770334d48bd69ede1cc28cd0dd7680 requests-0.6.1.tar.gz +2180dacebc0e30ba730d083739907af6 requests-0.6.6.tar.gz From f92479a2cbd495faa2f53e0e7a5b526aa7647cdc Mon Sep 17 00:00:00 2001 From: Arun SAG Date: Sun, 8 Jan 2012 20:22:03 +0530 Subject: [PATCH 5/9] Add python-gevent to support requests.async --- python-requests.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/python-requests.spec b/python-requests.spec index 4f8eeb3..e92323f 100644 --- a/python-requests.spec +++ b/python-requests.spec @@ -1,6 +1,6 @@ Name: python-requests Version: 0.6.6 -Release: 1%{?dist} +Release: 2%{?dist} Summary: HTTP library, written in Python, for human beings License: ISC @@ -9,6 +9,7 @@ Source0: http://pypi.python.org/packages/source/r/requests/requests-%{ver BuildArch: noarch BuildRequires: python-devel +Requires: python-gevent %description Most existing Python modules for sending HTTP requests are extremely verbose and @@ -43,6 +44,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Sun Jan 08 2012 Arun SAG - 0.6.6-2 +- Add python-gevent as a dependency + * Thu Oct 20 2011 Arun SAG - 0.6.6-1 - Updated to version 0.6.6 From ca30774832c1244e5bd7a8ef7641e73df8adb8c2 Mon Sep 17 00:00:00 2001 From: Arun SAG Date: Sun, 1 Apr 2012 12:12:52 +0530 Subject: [PATCH 6/9] Update to 0.10.8 by popular request --- .gitignore | 1 + python-requests.spec | 76 +++++++++++++++++++++++++++++++++++++------- sources | 2 +- 3 files changed, 66 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index e86ffff..fd8d907 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /requests-0.6.0.tar.gz /requests-0.6.1.tar.gz /requests-0.6.6.tar.gz +/requests-0.10.8.tar.gz diff --git a/python-requests.spec b/python-requests.spec index e92323f..a8feee2 100644 --- a/python-requests.spec +++ b/python-requests.spec @@ -1,15 +1,24 @@ +%if 0%{?fedora} > 12 || 0%{?rhel} > 6 +%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.6.6 -Release: 2%{?dist} +Version: 0.10.8 +Release: 1%{?dist} Summary: HTTP library, written in Python, for human beings -License: ISC +License: ISC and MIT URL: http://pypi.python.org/pypi/requests Source0: http://pypi.python.org/packages/source/r/requests/requests-%{version}.tar.gz BuildArch: noarch BuildRequires: python-devel + +%if 0%{?fedora} Requires: python-gevent +%endif %description Most existing Python modules for sending HTTP requests are extremely verbose and @@ -17,35 +26,78 @@ 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 +%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. +%endif + %prep %setup -q -n requests-%{version} - %build %{__python} setup.py build +%if 0%{?_with_python3} +%{__python3} setup.py build +%endif %install rm -rf $RPM_BUILD_ROOT %{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT +%if 0%{?_with_python3} +%{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT +%endif %files -%doc LICENSE README.rst HISTORY.rst +%defattr(-,root,root,-) +%doc NOTICE LICENSE README.rst HISTORY.rst %{python_sitelib}/*.egg-info %dir %{python_sitelib}/requests -%dir %{python_sitelib}/requests/packages -%dir %{python_sitelib}/requests/packages/poster -%{python_sitelib}/requests/packages/*.py* -%{python_sitelib}/requests/packages/poster/*.py* -%{python_sitelib}/requests/*.py* +%{python_sitelib}/requests/* +%if 0%{?_with_python3} +%files -n python3-requests +%{python3_sitelib}/*.egg-info +%{python3_sitelib}/requests/ +%endif %changelog -* Sun Jan 08 2012 Arun SAG - 0.6.6-2 -- Add python-gevent as a dependency +* Sun Apr 01 2012 Arun S A G 0.10.8-1 +- Updated to bugfix release 0.10.8 + +* 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 diff --git a/sources b/sources index f0ebe55..6d08662 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -2180dacebc0e30ba730d083739907af6 requests-0.6.6.tar.gz +0fc89a30eef76b2393cbc7ebace91750 requests-0.10.8.tar.gz From f684f5a71a1ecde36cc08bb9655393641157732e Mon Sep 17 00:00:00 2001 From: Arun SAG Date: Sun, 8 Apr 2012 23:15:53 +0530 Subject: [PATCH 7/9] Fix: Requests requires python-certifi to work with https --- python-requests.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/python-requests.spec b/python-requests.spec index a8feee2..1b36e3b 100644 --- a/python-requests.spec +++ b/python-requests.spec @@ -6,7 +6,7 @@ Name: python-requests Version: 0.10.8 -Release: 1%{?dist} +Release: 2%{?dist} Summary: HTTP library, written in Python, for human beings License: ISC and MIT @@ -16,6 +16,7 @@ Source0: http://pypi.python.org/packages/source/r/requests/requests-%{ver BuildArch: noarch BuildRequires: python-devel +Requires: python-certifi %if 0%{?fedora} Requires: python-gevent %endif @@ -71,6 +72,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Sun Apr 08 2012 Arun S A G 0.10.8-2 +- Requests requires python-certifi to work with https + * Sun Apr 01 2012 Arun S A G 0.10.8-1 - Updated to bugfix release 0.10.8 From a7d0b581548fceedb8ba6a58de3cd8e939880afe Mon Sep 17 00:00:00 2001 From: Arun SAG Date: Sun, 10 Jun 2012 23:31:00 +0530 Subject: [PATCH 8/9] Updated to 0.13.1 --- .gitignore | 1 + python-requests.spec | 23 +++++++++++++---------- sources | 2 +- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index fd8d907..e7b8aff 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /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.spec b/python-requests.spec index 1b36e3b..aa9afd4 100644 --- a/python-requests.spec +++ b/python-requests.spec @@ -5,8 +5,8 @@ %endif Name: python-requests -Version: 0.10.8 -Release: 2%{?dist} +Version: 0.13.1 +Release: 1%{?dist} Summary: HTTP library, written in Python, for human beings License: ISC and MIT @@ -16,10 +16,7 @@ Source0: http://pypi.python.org/packages/source/r/requests/requests-%{ver BuildArch: noarch BuildRequires: python-devel -Requires: python-certifi -%if 0%{?fedora} -Requires: python-gevent -%endif +Requires: ca-certificates %description Most existing Python modules for sending HTTP requests are extremely verbose and @@ -31,11 +28,14 @@ designed to make HTTP requests easy for developers. %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 @@ -72,11 +72,14 @@ rm -rf $RPM_BUILD_ROOT %changelog -* Sun Apr 08 2012 Arun S A G 0.10.8-2 -- Requests requires python-certifi to work with https +* 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.10.8-1 -- Updated to bugfix release 0.10.8 +* 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 diff --git a/sources b/sources index 6d08662..6704a5e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -0fc89a30eef76b2393cbc7ebace91750 requests-0.10.8.tar.gz +31a08091feeefe60817e45122d933219 requests-0.13.1.tar.gz From f439ffedeb9db3c2c86fc0be15037497d3075a3f Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Fri, 8 Feb 2013 14:59:36 -0800 Subject: [PATCH 9/9] Fix a problem with cookie handling + https://bugzilla.redhat.com/show_bug.cgi?id=906924 --- python-requests-cookie-handling.patch | 32 +++++++++++++++++++ python-requests.spec | 45 +++++++++++++++++++++------ 2 files changed, 68 insertions(+), 9 deletions(-) create mode 100644 python-requests-cookie-handling.patch 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 index aa9afd4..a028fdb 100644 --- a/python-requests.spec +++ b/python-requests.spec @@ -1,4 +1,4 @@ -%if 0%{?fedora} > 12 || 0%{?rhel} > 6 +%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())")} @@ -6,15 +6,17 @@ Name: python-requests Version: 0.13.1 -Release: 1%{?dist} +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: python-devel +BuildRequires: python2-devel Requires: ca-certificates @@ -42,21 +44,42 @@ Requires: python-chardet %prep %setup -q -n requests-%{version} -%build -%{__python} setup.py build +%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 -%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT %if 0%{?_with_python3} -%{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT +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 @@ -72,6 +95,10 @@ rm -rf $RPM_BUILD_ROOT %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