Blame SPECS/python3.11-requests.spec

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