Summary: Python HTTP for Humans
Name: python-requests
Version: 2.25.1
Release: 1%{?_dist_release}
Group: programming
Vendor: Project Vine
Distribution: Vine Linux
Packager: iwaim

License: ASLv2
URL: https://pypi.python.org/pypi/requests
Source0: https://pypi.python.org/packages/source/r/requests/requests-%{version}.tar.gz

# Explicitly use the system certificates in ca-certificates.
# https://bugzilla.redhat.com/show_bug.cgi?id=904614
Patch0: patch-requests-certs.py-to-use-the-system-CA-bundle.patch

# https://bugzilla.redhat.com/show_bug.cgi?id=1450608
Patch2: Remove-tests-that-use-the-tarpit.patch

# Use 127.0.0.1 not localhost for socket.bind() in the Server test
# class, to fix tests in Koji's no-network environment
# This probably isn't really upstreamable, because I guess localhost
# could technically be IPv6 or something, and our no-network env is
# a pretty odd one so this is a niche requirement.
Patch3: requests-2.12.4-tests_nonet.patch

BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
Requires: python
BuildRequires: python-rpm-macros
BuildRequires: python3-rpm-macros
BuildRequires: python-devel
BuildRequires: python2-setuptools
BuildRequires: python3-devel
BuildRequires: python3-rpm-macros
BuildRequires: python3-setuptools

%description
Requests is an Apache2 Licensed HTTP library, written in Python, for human beings.


%package -n python3-requests
Summary: Python HTTP for Humans
Group: programming
Requires: python3

%description -n python3-requests
Requests is an Apache2 Licensed HTTP library, written in Python, for human beings.


%prep
%autosetup -p1 -n requests-%{version}

# Unbundle the certificate bundle from mozilla.
rm -rf requests/cacert.pem

# env shebang in nonexecutable file
sed -i '/#!\/usr\/.*python/d' requests/certs.py


%build
%py_build
%py3_build


%install
rm -rf $RPM_BUILD_ROOT
%py_install
%py3_install


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
%license LICENSE
%doc README* HISTORY*
%{python_sitelib}/requests
%{python_sitelib}/requests-%{version}-py*.egg-info

%files -n python3-requests
%defattr(-,root,root,-)
%license LICENSE
%doc README* HISTORY*
%{python3_sitelib}/requests
%{python3_sitelib}/requests-%{version}-py*.egg-info


%changelog
* Tue Feb 23 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.25.1-1
- new upstream release.
- updated Patch0.

* Sat Aug 15 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.24.0-1
- new upstream release.

* Wed Apr 08 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.23.0-1
- new upstream release.
- updated patches.

* Wed Nov 28 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.20.1-2
- fixed R:.
- imported Patch0-4 from rawhide.

* Wed Nov 28 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.20.1-1
- new upstream release.
- add python2 support.

* Tue Jun 28 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.5.1-2
- rebuild with python3-3.5.2

* Sun Mar 22 2015 IWAI, Masaharu <iwaim.sub@gmail.com> 2.5.1-1
- Initial build.
