Blame SPECS/python3.11-requests.spec

988f36
%global __python3 /usr/bin/python3.11
988f36
%global python3_pkgversion 3.11
988f36
988f36
# RHEL: Tests disabled due to missing dependencies
988f36
%bcond_with tests
988f36
988f36
Name:           python%{python3_pkgversion}-requests
988f36
Version:        2.28.1
988f36
Release:        1%{?dist}
988f36
Summary:        HTTP library, written in Python, for human beings
988f36
988f36
License:        ASL 2.0
988f36
URL:            https://pypi.io/project/requests
988f36
Source0:        https://github.com/requests/requests/archive/v%{version}/requests-v%{version}.tar.gz
988f36
# Explicitly use the system certificates in ca-certificates.
988f36
# https://bugzilla.redhat.com/show_bug.cgi?id=904614
988f36
Patch0:         requests-2.28.1-system-certs.patch
988f36
988f36
BuildArch:      noarch
988f36
988f36
BuildRequires:  python%{python3_pkgversion}-devel
988f36
BuildRequires:  python%{python3_pkgversion}-rpm-macros
988f36
BuildRequires:  python%{python3_pkgversion}-charset-normalizer
988f36
BuildRequires:  python%{python3_pkgversion}-urllib3
988f36
BuildRequires:  python%{python3_pkgversion}-idna
988f36
# pygments is used for syntax highlighting in the docs - disabled due to missing deps
988f36
#BuildRequires:  python%%{python3_pkgversion}-pygments
988f36
BuildRequires:  python%{python3_pkgversion}-setuptools
988f36
988f36
%if %{with tests}
988f36
BuildRequires:  python%{python3_pkgversion}-pytest
988f36
BuildRequires:  python%{python3_pkgversion}-pytest-httpbin
988f36
BuildRequires:  python%{python3_pkgversion}-pytest-mock
988f36
BuildRequires:  python%{python3_pkgversion}-trustme
988f36
%endif
988f36
988f36
Requires:  python%{python3_pkgversion}-charset-normalizer
988f36
Requires:  python%{python3_pkgversion}-urllib3
988f36
Requires:  python%{python3_pkgversion}-idna 
988f36
988f36
%description
988f36
Most existing Python modules for sending HTTP requests are extremely verbose and
988f36
cumbersome. Python’s built-in urllib2 module provides most of the HTTP
988f36
capabilities you should need, but the API is thoroughly broken. This library is
988f36
designed to make HTTP requests easy for developers.
988f36
988f36
988f36
%{?python_extras_subpkg:%python_extras_subpkg -n python%{python3_pkgversion}-requests -i %{python3_sitelib}/*.egg-info security socks}
988f36
988f36
%prep
988f36
%autosetup -p1 -n requests-%{version}
988f36
988f36
# env shebang in nonexecutable file
988f36
sed -i '/#!\/usr\/.*python/d' requests/certs.py
988f36
988f36
# Some doctests use the internet and fail to pass in Koji. Since doctests don't have names, I don't
988f36
# know a way to skip them. We also don't want to patch them out, because patching them out will
988f36
# change the docs. Thus, we set pytest not to run doctests at all.
988f36
sed -i 's/ --doctest-modules//' pyproject.toml
988f36
988f36
988f36
%build
988f36
%py3_build
988f36
988f36
988f36
%install
988f36
%py3_install
988f36
988f36
988f36
%if %{with tests}
988f36
%check
988f36
%pytest -v
988f36
%endif
988f36
988f36
988f36
%files -n python%{python3_pkgversion}-requests
988f36
%license LICENSE
988f36
%doc README.md HISTORY.md
988f36
%{python3_sitelib}/*.egg-info/
988f36
%{python3_sitelib}/requests/
988f36
988f36
988f36
%changelog
988f36
* Tue Nov 29 2022 Charalampos Stratakis <cstratak@redhat.com> - 2.28.1-1
988f36
- Initial package
988f36
- Fedora contributions by:
988f36
      Adam Williamson <awilliam@redhat.com>
988f36
      Arun SAG <sagarun@gmail.com>
988f36
      Charalampos Stratakis <cstratak@redhat.com>
988f36
      David Malcolm <dmalcolm@redhat.com>
988f36
      Dennis Gilmore <dennis@ausil.us>
988f36
      Igor Gnatenko <ignatenkobrain@fedoraproject.org>
988f36
      Iryna Shcherbina <shcherbina.iryna@gmail.com>
988f36
      Jeremy Cline <jeremy@jcline.org>
988f36
      Karolina Surma <ksurma@redhat.com>
988f36
      Kevin Fenzi <kevin@scrye.com>
988f36
      Lumir Balhar <lbalhar@redhat.com>
988f36
      Miro Hrončok <miro@hroncok.cz>
988f36
      Petr Viktorin <pviktori@redhat.com>
988f36
      Ralph Bean <rbean@redhat.com>
988f36
      Randy Barlow <randy@electronsweatshop.com>
988f36
      Rex Dieter <rdieter@math.unl.edu>
988f36
      Robert Kuska <rkuska@redhat.com>
988f36
      Slavek Kabrda <bkabrda@redhat.com>
988f36
      Stephen Gallagher <sgallagh@redhat.com>
988f36
      Tom Callaway <spot@fedoraproject.org>
988f36
      Toshio Kuratomi <toshio@fedoraproject.org>
988f36
      yatinkarel <ykarel@redhat.com>