Blame SPECS/python3.11-requests.spec

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