b5609c6
%global _with_python3 1
b5609c6
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
113881e
113881e
%if 0%{?fedora}
113881e
%{!?python3_pkgversion: %global python3_pkgversion 3}
53214a3
%else
113881e
%{!?python3_pkgversion: %global python3_pkgversion 34}
b5609c6
%endif
9d1befd
6ce5e5c
%global urllib3_unbundled_version 1.19.1
f73b98e
e0d81d7
Name:           python-requests
f2e692f
Version:        2.12.2
f2e692f
Release:        1%{?dist}
e0d81d7
Summary:        HTTP library, written in Python, for human beings
e0d81d7
9d1befd
License:        ASL 2.0
142e0f8
URL:            https://pypi.io/project/requests
142e0f8
Source0:        https://pypi.io/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
c802119
# Some discussion with upstream:
c802119
# - https://twitter.com/sigmavirus24/status/529816751651819520
c802119
# - https://github.com/kennethreitz/requests/issues/1811
c802119
# - https://github.com/kennethreitz/requests/pull/1812
1dbd573
Patch1:         python-requests-remove-nested-bundling-dep.patch
7fe5b10
f73b98e
# Tell setuptools about what version of urllib3 we're unbundling
f73b98e
# - https://github.com/kennethreitz/requests/issues/2816
f73b98e
Patch2:         python-requests-urllib3-at-%{urllib3_unbundled_version}.patch
bfbc9c2
e0d81d7
BuildArch:      noarch
bfbc9c2
53214a3
%description
53214a3
Most existing Python modules for sending HTTP requests are extremely verbose and
53214a3
cumbersome. Python’s built-in urllib2 module provides most of the HTTP
53214a3
capabilities you should need, but the API is thoroughly broken. This library is
53214a3
designed to make HTTP requests easy for developers.
1d92ca7
53214a3
%package -n python2-requests
53214a3
Summary: HTTP library, written in Python, for human beings
53214a3
%{?python_provide:%python_provide python2-requests}
bfbc9c2
e9f9b2b
BuildRequires:  python2-devel
7fe5b10
BuildRequires:  python-chardet
0df2434
BuildRequires:  python2-urllib3 == %{urllib3_unbundled_version}
b5609c6
74db89b
Requires:       ca-certificates
7fe5b10
Requires:       python-chardet
0df2434
Requires:       python2-urllib3 == %{urllib3_unbundled_version}
6ce5e5c
Requires:       python-idna
2f898f2
3b31b2a
%if 0%{?rhel} && 0%{?rhel} <= 6
2f898f2
BuildRequires:  python-ordereddict
2f898f2
Requires:       python-ordereddict
2f898f2
%endif
e0d81d7
53214a3
%description -n python2-requests
53214a3
Most existing Python modules for sending HTTP requests are extremely verbose and
53214a3
cumbersome. Python’s built-in urllib2 module provides most of the HTTP
53214a3
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}
113881e
%package -n python%{python3_pkgversion}-requests
b5609c6
Summary: HTTP library, written in Python, for human beings
bfbc9c2
113881e
%{?python_provide:%python_provide python%{python3_pkgversion}-requests}
bfbc9c2
113881e
BuildRequires:  python%{python3_pkgversion}-devel
113881e
BuildRequires:  python%{python3_pkgversion}-chardet
113881e
BuildRequires:  python%{python3_pkgversion}-urllib3 == %{urllib3_unbundled_version}
113881e
Requires:       python%{python3_pkgversion}-chardet
113881e
Requires:       python%{python3_pkgversion}-urllib3 == %{urllib3_unbundled_version}
6ce5e5c
Requires:       python%{python3_pkgversion}-idna
7fe5b10
113881e
%description -n python%{python3_pkgversion}-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
f73b98e
%patch2 -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
6ce5e5c
rm -rf build/lib/requests/packages/idna
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
6ce5e5c
rm -rf build/lib/requests/packages/idna
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
6ce5e5c
ln -s ../../idna %{buildroot}/%{python3_sitelib}/requests/packages/idna
ad43998
popd
b5609c6
%endif
e0d81d7
ad43998
%{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT
0df2434
ln -s ../../chardet %{buildroot}/%{python2_sitelib}/requests/packages/chardet
0df2434
ln -s ../../urllib3 %{buildroot}/%{python2_sitelib}/requests/packages/urllib3
6ce5e5c
ln -s ../../idna %{buildroot}/%{python2_sitelib}/requests/packages/idna
ad43998
9d1befd
## The tests succeed if run locally, but fail in koji.
9d1befd
## They require an active network connection to query httpbin.org
ffa5143
%check
ffa5143
9d1befd
#%%{__python} test_requests.py
9d1befd
#%%if 0%%{?_with_python3}
9d1befd
#pushd %%{py3dir}
9d1befd
#%%{__python3} test_requests.py
9d1befd
#popd
9d1befd
#%%endif
9d1befd
ffa5143
# At very, very least, we'll try to start python and import requests
ffa5143
PYTHONPATH=. %{__python} -c "import requests"
ffa5143
ffa5143
%if 0%{?_with_python3}
ffa5143
pushd %{py3dir}
ffa5143
PYTHONPATH=. %{__python3} -c "import requests"
ffa5143
popd
ffa5143
%endif
ffa5143
ffa5143
53214a3
%files -n python2-requests
804f3bb
%defattr(-,root,root,-)
cd981a7
%{!?_licensedir:%global license %%doc}
cd981a7
%license LICENSE
cd981a7
%doc NOTICE README.rst HISTORY.rst
0df2434
%{python2_sitelib}/*.egg-info
0df2434
%dir %{python2_sitelib}/requests
0df2434
%{python2_sitelib}/requests/*
e0d81d7
b5609c6
%if 0%{?_with_python3}
113881e
%files -n python%{python3_pkgversion}-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
f2e692f
* Wed Nov 30 2016 Jeremy Cline <jeremy@jcline.org> - 2.12.2-1
f2e692f
- Update to 2.12.2
f2e692f
8c50084
* Wed Nov 23 2016 Jeremy Cline <jeremy@jcline.org> - 2.12.1-2
8c50084
- Backport #3713. Fixes #1397149
8c50084
6ce5e5c
* Thu Nov 17 2016 Jeremy Cline <jeremy@jcline.org> - 2.12.1-1
6ce5e5c
- Update to 2.12.1. Fixes #1395469
6ce5e5c
- Unbundle idna, a new upstream dependency
6ce5e5c
f81e14f
* Sat Aug 27 2016 Kevin Fenzi <kevin@scrye.com> - 2.11.1-1
f81e14f
- Update to 2.11.1. Fixes #1370814
f81e14f
63fd5b1
* Wed Aug 10 2016 Kevin Fenzi <kevin@scrye.com> - 2.11.0-1
63fd5b1
- Update to 2.11.0. Fixes #1365332
63fd5b1
c5ce60b
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.10.0-4
c5ce60b
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
c5ce60b
0df2434
* Fri Jul 15 2016 Ralph Bean <rbean@redhat.com> - 2.10.0-3
0df2434
- Update python2 packaging.
0df2434
53214a3
* Thu Jun 02 2016 Ralph Bean <rbean@redhat.com> - 2.10.0-2
53214a3
- Fix python2 subpackage to comply with guidelines.
53214a3
9c8df47
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.1-2
9c8df47
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
9c8df47
1e67cd9
* Mon Dec 21 2015 Ralph Bean <rbean@redhat.com> - 2.9.1-1
1e67cd9
- new version
1e67cd9
ad24cb0
* Fri Dec 18 2015 Ralph Bean <rbean@redhat.com> - 2.9.0-1
ad24cb0
- new version
ad24cb0
d84ebd4
* Mon Dec 14 2015 Ralph Bean <rbean@redhat.com> - 2.8.1-1
d84ebd4
- Latest upstream.
d84ebd4
- Bump hard dep on urllib3 to 1.12.
d84ebd4
Robert Kuska 9bbee01
* Mon Nov 02 2015 Robert Kuska <rkuska@redhat.com> - 2.7.0-8
Robert Kuska 9bbee01
- Rebuilt for Python3.5 rebuild
Robert Kuska 9bbee01
f73b98e
* Sat Oct 10 2015 Ralph Bean <rbean@redhat.com> - 2.7.0-7
f73b98e
- Tell setuptools about what version of urllib3 we're unbundling
f73b98e
  for https://github.com/kennethreitz/requests/issues/2816
f73b98e
1d92ca7
* Thu Sep 17 2015 Ralph Bean <rbean@redhat.com> - 2.7.0-6
1d92ca7
- Replace the provides macro with a plain provides field for now until we can
1d92ca7
  re-organize this package into two different subpackages.
1d92ca7
5af138e
* Thu Sep 17 2015 Ralph Bean <rbean@redhat.com> - 2.7.0-5
5af138e
- Remove 'provides: python2-requests' from the python3 subpackage, obviously.
5af138e
bfbc9c2
* Tue Sep 15 2015 Ralph Bean <rbean@redhat.com> - 2.7.0-4
bfbc9c2
- Employ %%python_provides macro to provide python2-requests.
bfbc9c2
026230b
* Fri Sep 04 2015 Ralph Bean <rbean@redhat.com> - 2.7.0-3
026230b
- Lock down the python-urllib3 version to the specific version we unbundled.
026230b
  https://bugzilla.redhat.com/show_bug.cgi?id=1253823
026230b
1badb1c
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7.0-2
1badb1c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
1badb1c
75426f9
* Mon May 04 2015 Ralph Bean <rbean@redhat.com> - 2.7.0-1
75426f9
- new version
75426f9
b418eb6
* Wed Apr 29 2015 Ralph Bean <rbean@redhat.com> - 2.6.2-1
b418eb6
- new version
b418eb6
a083b64
* Thu Apr 23 2015 Ralph Bean <rbean@redhat.com> - 2.6.1-1
a083b64
- new version
a083b64
ced4b9f
* Wed Apr 22 2015 Ralph Bean <rbean@redhat.com> - 2.6.0-1
ced4b9f
- new version
ced4b9f
- Remove patch for CVE-2015-2296, now included in the upstream release.
ced4b9f
2665991
* Mon Mar 16 2015 Ralph Bean <rbean@redhat.com> - 2.5.3-2
2665991
- Backport fix for CVE-2015-2296.
2665991
32d2729
* Thu Feb 26 2015 Ralph Bean <rbean@redhat.com> - 2.5.3-1
32d2729
- new version
32d2729
d52751d
* Wed Feb 18 2015 Ralph Bean <rbean@redhat.com> - 2.5.1-1
d52751d
- new version
d52751d
bb1e96f
* Tue Dec 16 2014 Ralph Bean <rbean@redhat.com> - 2.5.0-3
86ffa4b
- Pin python-urllib3 requirement at 1.10.
38792a5
- Fix requirement pinning syntax.
bb1e96f
ffa5143
* Thu Dec 11 2014 Ralph Bean <rbean@redhat.com> - 2.5.0-2
ffa5143
- Do the most basic of tests in the check section.
ffa5143
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