Blame SPECS/python3.11-requests.spec

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