304e47
%bcond_with tests
304e47
304e47
Name:           python-requests
304e47
Version:        2.22.0
304e47
Release:        9%{?dist}
304e47
Summary:        HTTP library, written in Python, for human beings
304e47
304e47
License:        ASL 2.0
304e47
URL:            https://pypi.io/project/requests
304e47
Source0:        https://github.com/requests/requests/archive/v%{version}/requests-v%{version}.tar.gz
304e47
# Explicitly use the system certificates in ca-certificates.
304e47
# https://bugzilla.redhat.com/show_bug.cgi?id=904614
304e47
Patch0:         patch-requests-certs.py-to-use-the-system-CA-bundle.patch
304e47
304e47
# https://bugzilla.redhat.com/show_bug.cgi?id=1450608
304e47
Patch2:         Remove-tests-that-use-the-tarpit.patch
304e47
304e47
# Use 127.0.0.1 not localhost for socket.bind() in the Server test
304e47
# class, to fix tests in Koji's no-network environment
304e47
# This probably isn't really upstreamable, because I guess localhost
304e47
# could technically be IPv6 or something, and our no-network env is
304e47
# a pretty odd one so this is a niche requirement.
304e47
Patch3:         requests-2.12.4-tests_nonet.patch
304e47
304e47
# https://bugzilla.redhat.com/show_bug.cgi?id=1567862
304e47
Patch4:         Don-t-inject-pyopenssl-into-urllib3.patch
304e47
304e47
# https://bugzilla.redhat.com/show_bug.cgi?id=1653223
304e47
Patch5:         requests-2.20.0-no-py2-httpbin.patch
304e47
304e47
# https://github.com/kennethreitz/requests/pull/5049
304e47
Patch6:         support-pytest-4.patch
304e47
304e47
BuildArch:      noarch
304e47
# Exclude i686 arch. Due to a modularity issue it's being added to the
304e47
# x86_64 compose of CRB, but we don't want to ship it at all.
304e47
# See: https://projects.engineering.redhat.com/browse/RCM-72605
304e47
ExcludeArch:    i686
304e47
304e47
%description
304e47
Most existing Python modules for sending HTTP requests are extremely verbose and
304e47
cumbersome. Python’s built-in urllib2 module provides most of the HTTP
304e47
capabilities you should need, but the API is thoroughly broken. This library is
304e47
designed to make HTTP requests easy for developers.
304e47
304e47
%package -n python%{python3_pkgversion}-requests
304e47
Summary: HTTP library, written in Python, for human beings
304e47
304e47
%{?python_provide:%python_provide python%{python3_pkgversion}-requests}
304e47
304e47
BuildRequires:  python%{python3_pkgversion}-devel
304e47
BuildRequires:  python%{python3_pkgversion}-chardet
304e47
BuildRequires:  python%{python3_pkgversion}-urllib3
304e47
BuildRequires:  python%{python3_pkgversion}-idna
304e47
BuildRequires:  python%{python3_pkgversion}-rpm-macros
304e47
%if %{with tests}
304e47
BuildRequires:  python%{python3_pkgversion}-pytest
304e47
BuildRequires:  python%{python3_pkgversion}-pytest-cov
304e47
BuildRequires:  python%{python3_pkgversion}-pytest-httpbin
304e47
BuildRequires:  python%{python3_pkgversion}-pytest-mock
304e47
%endif
304e47
304e47
Requires:       python%{python3_pkgversion}-chardet >= 3.0.2
304e47
Requires:       python%{python3_pkgversion}-urllib3 >= 1.21.1
304e47
Requires:       python%{python3_pkgversion}-idna
304e47
304e47
%description -n python%{python3_pkgversion}-requests
304e47
Most existing Python modules for sending HTTP requests are extremely verbose and
304e47
cumbersome. Python’s built-in urllib2 module provides most of the HTTP
304e47
capabilities you should need, but the API is thoroughly broken. This library is
304e47
designed to make HTTP requests easy for developers.
304e47
304e47
%prep
304e47
%autosetup -p1 -n requests-%{version}
304e47
304e47
# Unbundle the certificate bundle from mozilla.
304e47
rm -rf requests/cacert.pem
304e47
304e47
# env shebang in nonexecutable file
304e47
sed -i '/#!\/usr\/.*python/d' requests/certs.py
304e47
304e47
%build
304e47
%py3_build
304e47
304e47
304e47
%install
304e47
%py3_install
304e47
304e47
304e47
%if %{with tests}
304e47
%check
304e47
PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} -m pytest -v
304e47
%endif # tests
304e47
304e47
%files -n python%{python3_pkgversion}-requests
304e47
%license LICENSE
304e47
%doc README.md HISTORY.md
304e47
%{python3_sitelib}/*.egg-info
304e47
%{python3_sitelib}/requests/
304e47
304e47
304e47
%changelog
304e47
* Fri Dec 13 2019 Tomas Orsava <torsava@redhat.com> - 2.22.0-9
304e47
- Exclude unsupported i686 arch
304e47
304e47
* Wed Nov 20 2019 Lumír Balhar <lbalhar@redhat.com> - 2.22.0-8
304e47
- Adjusted for Python 3.8 module in RHEL 8
304e47
304e47
* Tue Oct 22 2019 Charalampos Stratakis <cstratak@redhat.com> - 2.22.0-7
304e47
- Remove the python2 subpackage (rhbz#1761787)
304e47
304e47
* Wed Sep 18 2019 Petr Viktorin <pviktori@redhat.com> - 2.22.0-6
304e47
- Python 2: Remove tests and test dependencies
304e47
304e47
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 2.22.0-5
304e47
- Rebuilt for Python 3.8
304e47
304e47
* Thu Aug 15 2019 Miro Hrončok <mhroncok@redhat.com> - 2.22.0-4
304e47
- Bootstrap for Python 3.8
304e47
304e47
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.22.0-3
304e47
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
304e47
304e47
* Tue Jun 11 2019 Yatin Karel <ykarel@redhat.com> - 2.22.0-2
304e47
- Add minimum requirement for chardet and urllib3
304e47
304e47
* Thu May 23 2019 Jeremy Cline <jcline@redhat.com> - 2.22.0-1
304e47
- Update to v2.22.0
304e47
304e47
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.21.0-2
304e47
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
304e47
304e47
* Thu Dec 13 2018 Jeremy Cline <jeremy@jcline.org> - 2.21.0-1
304e47
- Update to v2.21.0
304e47
- Don't rely on certifi being patched properly to use the system CA bundle
304e47
304e47
* Mon Nov 26 2018 Miro Hrončok <mhroncok@redhat.com> - 2.20.0-2
304e47
- No pytest-httpbin for Python 2
304e47
304e47
* Mon Oct 29 2018 Jeremy Cline <jeremy@jcline.org> - 2.20.0-1
304e47
- Update to v2.20.0
304e47
304e47
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.19.1-3
304e47
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
304e47
304e47
* Mon Jun 18 2018 Miro Hrončok <mhroncok@redhat.com> - 2.19.1-2
304e47
- Rebuilt for Python 3.7
304e47
304e47
* Thu Jun 14 2018 Jeremy Cline <jeremy@jcline.org> - 2.19.1-1
304e47
- Update to v2.19.1 (rhbz 1591531)
304e47
304e47
* Thu Jun 14 2018 Miro Hrončok <mhroncok@redhat.com> - 2.19.0-2
304e47
- Bootstrap for Python 3.7
304e47
304e47
* Tue Jun 12 2018 Jeremy Cline <jeremy@jcline.org> - 2.19.0-1
304e47
- Update to v2.19.0 (rhbz 1590508)
304e47
304e47
* Fri Jun 08 2018 Jeremy Cline <jeremy@jcline.org> - 2.18.4-6
304e47
- Don't print runtime warning about urllib3 v1.23 (rhbz 1589306)
304e47
304e47
* Tue Jun 05 2018 Jeremy Cline <jeremy@jcline.org> - 2.18.4-5
304e47
- Allow urllib3 v1.23 (rhbz 1586311)
304e47
304e47
* Mon Apr 16 2018 Jeremy Cline <jeremy@jcline.org> - 2.18.4-4
304e47
- Stop injecting PyOpenSSL (rhbz 1567862)
304e47
304e47
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.18.4-3
304e47
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
304e47
304e47
* Mon Dec 11 2017 Iryna Shcherbina <ishcherb@redhat.com> - 2.18.4-2
304e47
- Fix ambiguous Python 2 dependency declarations
304e47
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
304e47
304e47
* Fri Aug 18 2017 Jeremy Cline <jeremy@jcline.org> - 2.18.4-1
304e47
- Update to 2.18.4
304e47
304e47
* Wed Jul 26 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 2.18.2-1
304e47
- Update to 2.18.2
304e47
304e47
* Tue Jun 20 2017 Jeremy Cline <jeremy@jcline.org> - 2.18.1-2
304e47
- Drop the dependency on certifi in setup.py
304e47
304e47
* Mon Jun 19 2017 Jeremy Cline <jeremy@jcline.org> - 2.18.1-1
304e47
- Update to 2.18.1 (#1449432)
304e47
- Remove tests that require non-local network (#1450608)
304e47
304e47
* Wed May 17 2017 Jeremy Cline <jeremy@jcline.org> - 2.14.2-1
304e47
- Update to 2.14.2 (#1449432)
304e47
- Switch to autosetup to apply patches
304e47
304e47
* Sun May 14 2017 Stephen Gallagher <sgallagh@redhat.com> - 2.13.0-2
304e47
- Don't run tests when building as a module
304e47
304e47
* Thu Feb 09 2017 Jeremy Cline <jeremy@jcline.org> - 2.13.0-1
304e47
- Update to 2.13.0 (#1418138)
304e47
304e47
* Fri Dec 30 2016 Adam Williamson <awilliam@redhat.com> - 2.12.4-3
304e47
- Include and enable tests (now python-pytest-httpbin is packaged)
304e47
304e47
* Wed Dec 21 2016 Kevin Fenzi <kevin@scrye.com> - 2.12.4-2
304e47
- Rebuild for Python 3.6 again.
304e47
304e47
* Tue Dec 20 2016 Jeremy Cline <jeremy@jcline.org> - 2.12.4-1
304e47
- Update to 2.12.4. Fixes #1404680
304e47
304e47
* Tue Dec 13 2016 Stratakis Charalampos <cstratak@redhat.com> - 2.12.3-2
304e47
- Rebuild for Python 3.6
304e47
304e47
* Thu Dec 01 2016 Jeremy Cline <jeremy@jcline.org> - 2.12.3-1
304e47
- Update to 2.12.3. Fixes #1400601
304e47
304e47
* Wed Nov 30 2016 Jeremy Cline <jeremy@jcline.org> - 2.12.2-1
304e47
- Update to 2.12.2
304e47
304e47
* Wed Nov 23 2016 Jeremy Cline <jeremy@jcline.org> - 2.12.1-2
304e47
- Backport #3713. Fixes #1397149
304e47
304e47
* Thu Nov 17 2016 Jeremy Cline <jeremy@jcline.org> - 2.12.1-1
304e47
- Update to 2.12.1. Fixes #1395469
304e47
- Unbundle idna, a new upstream dependency
304e47
304e47
* Sat Aug 27 2016 Kevin Fenzi <kevin@scrye.com> - 2.11.1-1
304e47
- Update to 2.11.1. Fixes #1370814
304e47
304e47
* Wed Aug 10 2016 Kevin Fenzi <kevin@scrye.com> - 2.11.0-1
304e47
- Update to 2.11.0. Fixes #1365332
304e47
304e47
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.10.0-4
304e47
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
304e47
304e47
* Fri Jul 15 2016 Ralph Bean <rbean@redhat.com> - 2.10.0-3
304e47
- Update python2 packaging.
304e47
304e47
* Thu Jun 02 2016 Ralph Bean <rbean@redhat.com> - 2.10.0-2
304e47
- Fix python2 subpackage to comply with guidelines.
304e47
304e47
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.1-2
304e47
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
304e47
304e47
* Mon Dec 21 2015 Ralph Bean <rbean@redhat.com> - 2.9.1-1
304e47
- new version
304e47
304e47
* Fri Dec 18 2015 Ralph Bean <rbean@redhat.com> - 2.9.0-1
304e47
- new version
304e47
304e47
* Mon Dec 14 2015 Ralph Bean <rbean@redhat.com> - 2.8.1-1
304e47
- Latest upstream.
304e47
- Bump hard dep on urllib3 to 1.12.
304e47
304e47
* Mon Nov 02 2015 Robert Kuska <rkuska@redhat.com> - 2.7.0-8
304e47
- Rebuilt for Python3.5 rebuild
304e47
304e47
* Sat Oct 10 2015 Ralph Bean <rbean@redhat.com> - 2.7.0-7
304e47
- Tell setuptools about what version of urllib3 we're unbundling
304e47
  for https://github.com/kennethreitz/requests/issues/2816
304e47
304e47
* Thu Sep 17 2015 Ralph Bean <rbean@redhat.com> - 2.7.0-6
304e47
- Replace the provides macro with a plain provides field for now until we can
304e47
  re-organize this package into two different subpackages.
304e47
304e47
* Thu Sep 17 2015 Ralph Bean <rbean@redhat.com> - 2.7.0-5
304e47
- Remove 'provides: python2-requests' from the python3 subpackage, obviously.
304e47
304e47
* Tue Sep 15 2015 Ralph Bean <rbean@redhat.com> - 2.7.0-4
304e47
- Employ %%python_provides macro to provide python2-requests.
304e47
304e47
* Fri Sep 04 2015 Ralph Bean <rbean@redhat.com> - 2.7.0-3
304e47
- Lock down the python-urllib3 version to the specific version we unbundled.
304e47
  https://bugzilla.redhat.com/show_bug.cgi?id=1253823
304e47
304e47
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7.0-2
304e47
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
304e47
304e47
* Mon May 04 2015 Ralph Bean <rbean@redhat.com> - 2.7.0-1
304e47
- new version
304e47
304e47
* Wed Apr 29 2015 Ralph Bean <rbean@redhat.com> - 2.6.2-1
304e47
- new version
304e47
304e47
* Thu Apr 23 2015 Ralph Bean <rbean@redhat.com> - 2.6.1-1
304e47
- new version
304e47
304e47
* Wed Apr 22 2015 Ralph Bean <rbean@redhat.com> - 2.6.0-1
304e47
- new version
304e47
- Remove patch for CVE-2015-2296, now included in the upstream release.
304e47
304e47
* Mon Mar 16 2015 Ralph Bean <rbean@redhat.com> - 2.5.3-2
304e47
- Backport fix for CVE-2015-2296.
304e47
304e47
* Thu Feb 26 2015 Ralph Bean <rbean@redhat.com> - 2.5.3-1
304e47
- new version
304e47
304e47
* Wed Feb 18 2015 Ralph Bean <rbean@redhat.com> - 2.5.1-1
304e47
- new version
304e47
304e47
* Tue Dec 16 2014 Ralph Bean <rbean@redhat.com> - 2.5.0-3
304e47
- Pin python-urllib3 requirement at 1.10.
304e47
- Fix requirement pinning syntax.
304e47
304e47
* Thu Dec 11 2014 Ralph Bean <rbean@redhat.com> - 2.5.0-2
304e47
- Do the most basic of tests in the check section.
304e47
304e47
* Thu Dec 11 2014 Ralph Bean <rbean@redhat.com> - 2.5.0-1
304e47
- Latest upstream, 2.5.0 for #1171068
304e47
304e47
* Wed Nov 05 2014 Ralph Bean <rbean@redhat.com> - 2.4.3-1
304e47
- Latest upstream, 2.4.3 for #1136283
304e47
304e47
* Wed Nov 05 2014 Ralph Bean <rbean@redhat.com> - 2.3.0-4
304e47
- Re-do unbundling by symlinking system libs into the requests/packages/ dir.
304e47
304e47
* Sun Aug  3 2014 Tom Callaway <spot@fedoraproject.org> - 2.3.0-3
304e47
- fix license handling
304e47
304e47
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.3.0-2
304e47
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
304e47
304e47
* Thu May 29 2014 Arun S A G <sagarun@gmail.com> - 2.3.0-1
304e47
- Latest upstream
304e47
304e47
* Wed May 14 2014 Bohuslav Kabrda <bkabrda@redhat.com> - 2.0.0-2
304e47
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
304e47
304e47
* Wed Sep 25 2013 Ralph Bean <rbean@redhat.com> - 2.0.0-1
304e47
- Latest upstream.
304e47
- Add doc macro to the python3 files section.
304e47
- Require python-urllib3 greater than or at 1.7.1.
304e47
304e47
* Mon Aug 26 2013 Rex Dieter <rdieter@fedoraproject.org> 1.2.3-5
304e47
- fix versioned dep on python-urllib3
304e47
304e47
* Mon Aug 26 2013 Ralph Bean <rbean@redhat.com> - 1.2.3-4
304e47
- Explicitly versioned the requirements on python-urllib3.
304e47
304e47
* Thu Aug 22 2013 Ralph Bean <rbean@redhat.com> - 1.2.3-3
304e47
- Release bump for a coupled update with python-urllib3.
304e47
304e47
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.3-2
304e47
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
304e47
304e47
* Mon Jul 01 2013 Ralph Bean <rbean@redhat.com> - 1.2.3-1
304e47
- Latest upstream.
304e47
- Fixed bogus date in changelog.
304e47
304e47
* Tue Jun 11 2013 Ralph Bean <rbean@redhat.com> - 1.1.0-4
304e47
- Correct a rhel conditional on python-ordereddict
304e47
304e47
* Thu Feb 28 2013 Ralph Bean <rbean@redhat.com> - 1.1.0-3
304e47
- Unbundled python-urllib3.  Using system python-urllib3 now.
304e47
- Conditionally include python-ordereddict for el6.
304e47
304e47
* Wed Feb 27 2013 Ralph Bean <rbean@redhat.com> - 1.1.0-2
304e47
- Unbundled python-charade/chardet.  Using system python-chardet now.
304e47
- Removed deprecated comments and actions against oauthlib unbundling.
304e47
  Those are no longer necessary in 1.1.0.
304e47
- Added links to bz tickets over Patch declarations.
304e47
304e47
* Tue Feb 26 2013 Ralph Bean <rbean@redhat.com> - 1.1.0-1
304e47
- Latest upstream.
304e47
- Relicense to ASL 2.0 with upstream.
304e47
- Removed cookie handling patch (fixed in upstream tarball).
304e47
- Updated cert unbundling patch to match upstream.
304e47
- Added check section, but left it commented out for koji.
304e47
304e47
* Fri Feb  8 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 0.14.1-4
304e47
- Let brp_python_bytecompile run again, take care of the non-python{2,3} modules
304e47
  by removing them from the python{,3}-requests package that they did not belong
304e47
  in.
304e47
- Use the certificates in the ca-certificates package instead of the bundled one
304e47
  + https://bugzilla.redhat.com/show_bug.cgi?id=904614
304e47
- Fix a problem with cookie handling
304e47
  + https://bugzilla.redhat.com/show_bug.cgi?id=906924
304e47
304e47
* Mon Oct 22 2012 Arun S A G <sagarun@gmail.com>  0.14.1-1
304e47
- Updated to latest upstream release
304e47
304e47
* Sun Jun 10 2012 Arun S A G <sagarun@gmail.com> 0.13.1-1
304e47
- Updated to latest upstream release 0.13.1
304e47
- Use system provided ca-certificates
304e47
- No more async requests use grrequests https://github.com/kennethreitz/grequests
304e47
- Remove gevent as it is no longer required by requests
304e47
304e47
* Sun Apr 01 2012 Arun S A G <sagarun@gmail.com> 0.11.1-1
304e47
- Updated to upstream release 0.11.1
304e47
304e47
* Thu Mar 29 2012 Arun S A G <sagarun@gmail.com> 0.10.6-3
304e47
- Support building package for EL6
304e47
304e47
* Tue Mar 27 2012 Rex Dieter <rdieter@fedoraproject.org> 0.10.6-2
304e47
- +python3-requests pkg
304e47
304e47
* Sat Mar 3 2012 Arun SAG <sagarun@gmail.com> - 0.10.6-1
304e47
- Updated to new upstream version
304e47
304e47
* Sat Jan 21 2012 Arun SAG <sagarun@gmail.com> - 0.9.3-1
304e47
- Updated to new upstream version 0.9.3
304e47
- Include python-gevent as a dependency for requests.async
304e47
- Clean up shebangs in requests/setup.py,test_requests.py and test_requests_ext.py
304e47
304e47
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.2-2
304e47
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
304e47
304e47
* Sun Nov 27 2011 Arun SAG <sagarun@gmail.com> - 0.8.2-1
304e47
- New upstream version
304e47
- keep alive support
304e47
- complete removal of cookiejar and urllib2
304e47
304e47
* Thu Nov 10 2011 Arun SAG <sagarun@gmail.com> - 0.7.6-1
304e47
- Updated to new upstream release 0.7.6
304e47
304e47
* Thu Oct 20 2011 Arun SAG <sagarun@gmail.com> - 0.6.6-1
304e47
- Updated to version 0.6.6
304e47
304e47
* Fri Aug 26 2011 Arun SAG <sagarun@gmail.com> - 0.6.1-1
304e47
- Updated to version 0.6.1
304e47
304e47
* Sat Aug 20 2011 Arun SAG <sagarun@gmail.com> - 0.6.0-1
304e47
- Updated to latest version 0.6.0
304e47
304e47
* Mon Aug 15 2011 Arun SAG <sagarun@gmail.com> - 0.5.1-2
304e47
- Remove OPT_FLAGS from build section since it is a noarch package
304e47
- Fix use of mixed tabs and space
304e47
- Remove extra space around the word cumbersome in description
304e47
304e47
* Sun Aug 14 2011 Arun SAG <sagarun@gmail.com> - 0.5.1-1
304e47
- Initial package