Blame SPECS/python3.11-requests.spec

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