ad43998
%if 0%{?fedora}
b5609c6
%global _with_python3 1
b5609c6
%else
b5609c6
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
b5609c6
%endif
9d1befd
e0d81d7
Name:           python-requests
1b25c27
Version:        2.5.0
85d9fba
Release:        1%{?dist}
e0d81d7
Summary:        HTTP library, written in Python, for human beings
e0d81d7
9d1befd
License:        ASL 2.0
e0d81d7
URL:            http://pypi.python.org/pypi/requests
e0d81d7
Source0:        http://pypi.python.org/packages/source/r/requests/requests-%{version}.tar.gz
9d1befd
# Explicitly use the system certificates in ca-certificates.
7fe5b10
# https://bugzilla.redhat.com/show_bug.cgi?id=904614
9d1befd
Patch0:         python-requests-system-cert-bundle.patch
1dbd573
1dbd573
# Remove an unnecessary reference to a bundled compat lib in urllib3
1dbd573
Patch1:         python-requests-remove-nested-bundling-dep.patch
7fe5b10
e0d81d7
BuildArch:      noarch
e9f9b2b
BuildRequires:  python2-devel
7fe5b10
BuildRequires:  python-chardet
Arun S A G 1b6b3fe
BuildRequires:  python-urllib3 >= 1.8.2
b5609c6
74db89b
Requires:       ca-certificates
7fe5b10
Requires:       python-chardet
Arun S A G 1b6b3fe
Requires:       python-urllib3 >= 1.8.2
2f898f2
3b31b2a
%if 0%{?rhel} && 0%{?rhel} <= 6
2f898f2
BuildRequires:  python-ordereddict
2f898f2
Requires:       python-ordereddict
2f898f2
%endif
e0d81d7
e0d81d7
%description
e0d81d7
Most existing Python modules for sending HTTP requests are extremely verbose and 
e0d81d7
cumbersome. Python’s built-in urllib2 module provides most of the HTTP 
e0d81d7
capabilities you should need, but the API is thoroughly broken. This library is 
e0d81d7
designed to make HTTP requests easy for developers.
e0d81d7
b5609c6
%if 0%{?_with_python3}
b5609c6
%package -n python3-requests
b5609c6
Summary: HTTP library, written in Python, for human beings
7fe5b10
BuildRequires:  python3-devel
7fe5b10
BuildRequires:  python3-chardet
Arun S A G 1b6b3fe
BuildRequires:  python3-urllib3 >= 1.8.2
7fe5b10
Requires:       python3-chardet
Arun S A G 1b6b3fe
Requires:       python3-urllib3 >= 1.8.2
7fe5b10
b5609c6
%description -n python3-requests
b5609c6
Most existing Python modules for sending HTTP requests are extremely verbose and
b5609c6
cumbersome. Python’s built-in urllib2 module provides most of the HTTP
b5609c6
capabilities you should need, but the API is thoroughly broken. This library is
b5609c6
designed to make HTTP requests easy for developers.
b5609c6
%endif
b5609c6
e0d81d7
%prep
e0d81d7
%setup -q -n requests-%{version}
e0d81d7
ad43998
%patch0 -p1
7fe5b10
%patch1 -p1
ad43998
ad43998
# Unbundle the certificate bundle from mozilla.
ad43998
rm -rf requests/cacert.pem
ad43998
ad43998
%if 0%{?_with_python3}
ad43998
rm -rf %{py3dir}
ad43998
cp -a . %{py3dir}
ad43998
%endif # with_python3
ad43998
e0d81d7
%build
b5609c6
%if 0%{?_with_python3}
ad43998
pushd %{py3dir}
b5609c6
%{__python3} setup.py build
7fe5b10
1dbd573
# Unbundle chardet and urllib3.  We replace these with symlinks to system libs.
Arun S A G 1b6b3fe
rm -rf build/lib/requests/packages/chardet
1dbd573
rm -rf build/lib/requests/packages/urllib3
2f898f2
ad43998
popd
b5609c6
%endif
ad43998
e9f9b2b
%{__python} setup.py build
e0d81d7
1dbd573
# Unbundle chardet and urllib3.  We replace these with symlinks to system libs.
1dbd573
rm -rf build/lib/requests/packages/chardet
1dbd573
rm -rf build/lib/requests/packages/urllib3
2f898f2
e0d81d7
%install
e0d81d7
rm -rf $RPM_BUILD_ROOT
b5609c6
%if 0%{?_with_python3}
ad43998
pushd %{py3dir}
ad43998
%{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT
1dbd573
ln -s ../../chardet %{buildroot}/%{python3_sitelib}/requests/packages/chardet
1dbd573
ln -s ../../urllib3 %{buildroot}/%{python3_sitelib}/requests/packages/urllib3
ad43998
popd
b5609c6
%endif
e0d81d7
ad43998
%{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT
1dbd573
ln -s ../../chardet %{buildroot}/%{python_sitelib}/requests/packages/chardet
1dbd573
ln -s ../../urllib3 %{buildroot}/%{python_sitelib}/requests/packages/urllib3
ad43998
9d1befd
## The tests succeed if run locally, but fail in koji.
9d1befd
## They require an active network connection to query httpbin.org
9d1befd
#%%check
9d1befd
#%%{__python} test_requests.py
9d1befd
#%%if 0%%{?_with_python3}
9d1befd
#pushd %%{py3dir}
9d1befd
#%%{__python3} test_requests.py
9d1befd
#popd
9d1befd
#%%endif
9d1befd
e0d81d7
%files
804f3bb
%defattr(-,root,root,-)
cd981a7
%{!?_licensedir:%global license %%doc}
cd981a7
%license LICENSE
cd981a7
%doc NOTICE README.rst HISTORY.rst
e0d81d7
%{python_sitelib}/*.egg-info
e0d81d7
%dir %{python_sitelib}/requests
afda359
%{python_sitelib}/requests/*
e0d81d7
b5609c6
%if 0%{?_with_python3}
b5609c6
%files -n python3-requests
cd981a7
%{!?_licensedir:%global license %%doc}
cd981a7
%license LICENSE
cd981a7
%doc NOTICE README.rst HISTORY.rst
b5609c6
%{python3_sitelib}/*.egg-info
b5609c6
%{python3_sitelib}/requests/
b5609c6
%endif
b5609c6
e0d81d7
%changelog
1b25c27
* Thu Dec 11 2014 Ralph Bean <rbean@redhat.com> - 2.5.0-1
1b25c27
- Latest upstream, 2.5.0 for #1171068
1b25c27
85d9fba
* Wed Nov 05 2014 Ralph Bean <rbean@redhat.com> - 2.4.3-1
85d9fba
- Latest upstream, 2.4.3 for #1136283
85d9fba
1dbd573
* Wed Nov 05 2014 Ralph Bean <rbean@redhat.com> - 2.3.0-4
1dbd573
- Re-do unbundling by symlinking system libs into the requests/packages/ dir.
1dbd573
cd981a7
* Sun Aug  3 2014 Tom Callaway <spot@fedoraproject.org> - 2.3.0-3
cd981a7
- fix license handling
cd981a7
a3d6ffe
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.3.0-2
a3d6ffe
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
a3d6ffe
Arun S A G 1b6b3fe
* Thu May 29 2014 Arun S A G <sagarun@gmail.com> - 2.3.0-1
Arun S A G 1b6b3fe
- Latest upstream
Arun S A G 1b6b3fe
3e12c85
* Wed May 14 2014 Bohuslav Kabrda <bkabrda@redhat.com> - 2.0.0-2
3e12c85
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
3e12c85
d75372e
* Wed Sep 25 2013 Ralph Bean <rbean@redhat.com> - 2.0.0-1
d75372e
- Latest upstream.
d75372e
- Add doc macro to the python3 files section.
d75372e
- Require python-urllib3 greater than or at 1.7.1.
d75372e
Rex Dieter 14d9138
* Mon Aug 26 2013 Rex Dieter <rdieter@fedoraproject.org> 1.2.3-5
Rex Dieter 14d9138
- fix versioned dep on python-urllib3
Rex Dieter 14d9138
9bb69bf
* Mon Aug 26 2013 Ralph Bean <rbean@redhat.com> - 1.2.3-4
9bb69bf
- Explicitly versioned the requirements on python-urllib3.
9bb69bf
47d04d2
* Thu Aug 22 2013 Ralph Bean <rbean@redhat.com> - 1.2.3-3
47d04d2
- Release bump for a coupled update with python-urllib3.
47d04d2
529a069
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.3-2
529a069
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
529a069
9c75512
* Mon Jul 01 2013 Ralph Bean <rbean@redhat.com> - 1.2.3-1
9c75512
- Latest upstream.
9c75512
- Fixed bogus date in changelog.
9c75512
3b31b2a
* Tue Jun 11 2013 Ralph Bean <rbean@redhat.com> - 1.1.0-4
3b31b2a
- Correct a rhel conditional on python-ordereddict
3b31b2a
2f898f2
* Thu Feb 28 2013 Ralph Bean <rbean@redhat.com> - 1.1.0-3
2f898f2
- Unbundled python-urllib3.  Using system python-urllib3 now.
2f898f2
- Conditionally include python-ordereddict for el6.
2f898f2
7fe5b10
* Wed Feb 27 2013 Ralph Bean <rbean@redhat.com> - 1.1.0-2
7fe5b10
- Unbundled python-charade/chardet.  Using system python-chardet now.
7fe5b10
- Removed deprecated comments and actions against oauthlib unbundling.
7fe5b10
  Those are no longer necessary in 1.1.0.
7fe5b10
- Added links to bz tickets over Patch declarations.
7fe5b10
9d1befd
* Tue Feb 26 2013 Ralph Bean <rbean@redhat.com> - 1.1.0-1
9d1befd
- Latest upstream.
9d1befd
- Relicense to ASL 2.0 with upstream.
9d1befd
- Removed cookie handling patch (fixed in upstream tarball).
9d1befd
- Updated cert unbundling patch to match upstream.
9d1befd
- Added check section, but left it commented out for koji.
9d1befd
4d0266e
* Fri Feb  8 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 0.14.1-4
ad43998
- Let brp_python_bytecompile run again, take care of the non-python{2,3} modules
ad43998
  by removing them from the python{,3}-requests package that they did not belong
ad43998
  in.
ad43998
- Use the certificates in the ca-certificates package instead of the bundled one
ad43998
  + https://bugzilla.redhat.com/show_bug.cgi?id=904614
ad43998
- Fix a problem with cookie handling
ad43998
  + https://bugzilla.redhat.com/show_bug.cgi?id=906924
ad43998
9c75512
* Mon Oct 22 2012 Arun S A G <sagarun@gmail.com>  0.14.1-1
e9f9b2b
- Updated to latest upstream release
f0e2277
74db89b
* Sun Jun 10 2012 Arun S A G <sagarun@gmail.com> 0.13.1-1
74db89b
- Updated to latest upstream release 0.13.1
74db89b
- Use system provided ca-certificates
74db89b
- No more async requests use grrequests https://github.com/kennethreitz/grequests
74db89b
- Remove gevent as it is no longer required by requests
d38a7df
d30532a
* Sun Apr 01 2012 Arun S A G <sagarun@gmail.com> 0.11.1-1
d30532a
- Updated to upstream release 0.11.1
d30532a
b5609c6
* Thu Mar 29 2012 Arun S A G <sagarun@gmail.com> 0.10.6-3
b5609c6
- Support building package for EL6
b5609c6
b5609c6
* Tue Mar 27 2012 Rex Dieter <rdieter@fedoraproject.org> 0.10.6-2
b5609c6
- +python3-requests pkg
b5609c6
afda359
* Sat Mar 3 2012 Arun SAG <sagarun@gmail.com> - 0.10.6-1
afda359
- Updated to new upstream version
afda359
804f3bb
* Sat Jan 21 2012 Arun SAG <sagarun@gmail.com> - 0.9.3-1
804f3bb
- Updated to new upstream version 0.9.3
804f3bb
- Include python-gevent as a dependency for requests.async
804f3bb
- Clean up shebangs in requests/setup.py,test_requests.py and test_requests_ext.py
804f3bb
f8b659f
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.2-2
f8b659f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
f8b659f
67a4111
* Sun Nov 27 2011 Arun SAG <sagarun@gmail.com> - 0.8.2-1
67a4111
- New upstream version
67a4111
- keep alive support
67a4111
- complete removal of cookiejar and urllib2
67a4111
06f0a42
* Thu Nov 10 2011 Arun SAG <sagarun@gmail.com> - 0.7.6-1
06f0a42
- Updated to new upstream release 0.7.6
06f0a42
f373c2c
* Thu Oct 20 2011 Arun SAG <sagarun@gmail.com> - 0.6.6-1
f373c2c
- Updated to version 0.6.6
f373c2c
b54eb0d
* Fri Aug 26 2011 Arun SAG <sagarun@gmail.com> - 0.6.1-1
b54eb0d
- Updated to version 0.6.1
b54eb0d
d4477a1
* Sat Aug 20 2011 Arun SAG <sagarun@gmail.com> - 0.6.0-1
d4477a1
- Updated to latest version 0.6.0
d4477a1
e0d81d7
* Mon Aug 15 2011 Arun SAG <sagarun@gmail.com> - 0.5.1-2
e0d81d7
- Remove OPT_FLAGS from build section since it is a noarch package
e0d81d7
- Fix use of mixed tabs and space
e0d81d7
- Remove extra space around the word cumbersome in description
e0d81d7
e0d81d7
* Sun Aug 14 2011 Arun SAG <sagarun@gmail.com> - 0.5.1-1
e0d81d7
- Initial package