%{!?dotests: %define dotests 1} %define name python3-requests %define srcname requests %define version 2.22.0 %define release 1 %define is_python %(test -e /usr/bin/python3_32 && echo 1 || echo 0) %if %{is_python} %define python_sitelib %(python3_32 -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))") %endif %define _libdir64 %{_prefix}/lib64 %define is_python_64 %(test -e /usr/bin/python3_64 && echo 1 || echo 0) %if %{is_python_64} %define python_sitelib64 %(python3 -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))") %endif Summary: HTTP library, written in Python, for human beings Name: %{name} Version: %{version} Release: %{release} Source0: http://pypi.python.org/packages/source/r/%{srcname}/%{srcname}-%{version}.tar.gz Url: http://pypi.python.org/pypi/requests License: ASL 2.0 Group: Development/Libraries BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot Prefix: %{_prefix} Patch1: support-pytest-4.patch BuildRequires: python3 >= 3.7 BuildRequires: python3-devel >= 3.7 Requires: python3-urllib3 >= 1.25.7, python3-chardet >= 3.0.4, python3-certifi >= 2019.9.11, python3-idna >= 2.8 BuildRequires: python3-pytest >= 5.3.1, python3-py >= 1.8.0, python3-pluggy >= 0.13.0, python3-more-itertools >= 7.2.0, python3-zipp >= 0.6.0, python3-importlib-metadata >= 0.23 BuildArch: noarch %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 %{srcname}-%{version} %patch1 -p1 %build python3 setup.py build %install [ -d "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT python3 setup.py install --skip-build --root ${RPM_BUILD_ROOT} if [ "%{dotests}" == 1 ] then (PYTHONPATH=%{buildroot}%{python_sitelib} python3 -m pytest -v || true) fi %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc LICENSE PKG-INFO README.md HISTORY.md %dir %{python_sitelib}/* %changelog * Thu Oct 10 2019 Baanu Tumma -2.22.0-1 - Update to latest version to fix CVE-2018-18074, built using python3 * Thu Jun 16 2016 Reshma V Kumar -2.4.3-1 - updated to latest version * Wed May 25 2016 Ravi Hirekurabar - 2.4.3-1 - first version for AIX V6.1 and higher