110 lines
3.6 KiB
RPMSpec
110 lines
3.6 KiB
RPMSpec
## START: Set by rpmautospec
|
||
## (rpmautospec version 0.6.5)
|
||
## RPMAUTOSPEC: autorelease, autochangelog
|
||
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
|
||
release_number = 3;
|
||
base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
|
||
print(release_number + base_release_number - 1);
|
||
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
|
||
## END: Set by rpmautospec
|
||
|
||
%global python3_pkgversion 3.14
|
||
|
||
# When bootstrapping Python, we cannot test this yet
|
||
# RHEL does not include the test dependencies
|
||
%bcond tests %{undefined rhel}
|
||
# The extras are disabled on RHEL to avoid pysocks and deprecated requests[security]
|
||
%bcond extras %[%{undefined rhel} || %{defined eln}]
|
||
%bcond extradeps %{undefined rhel}
|
||
|
||
Name: python%{python3_pkgversion}-requests
|
||
Version: 2.32.5
|
||
Release: %autorelease
|
||
Summary: HTTP library, written in Python, for human beings
|
||
|
||
License: Apache-2.0
|
||
URL: https://pypi.io/project/requests
|
||
Source: https://github.com/requests/requests/archive/v%{version}/requests-v%{version}.tar.gz
|
||
|
||
# Explicitly use the system certificates in ca-certificates.
|
||
# https://bugzilla.redhat.com/show_bug.cgi?id=904614
|
||
Patch: system-certs.patch
|
||
|
||
# Add support for IPv6 CIDR in no_proxy setting
|
||
# This functionality is needed in Openshift and it has been
|
||
# proposed for upstream in 2021 but the PR unfortunately stalled.
|
||
# Upstream PR: https://github.com/psf/requests/pull/5953
|
||
# This change is backported also into RHEL 9.4 (via CS)
|
||
Patch: support_IPv6_CIDR_in_no_proxy.patch
|
||
|
||
BuildArch: noarch
|
||
BuildRequires: python%{python3_pkgversion}-devel
|
||
%if %{with tests}
|
||
BuildRequires: python%{python3_pkgversion}-pytest
|
||
BuildRequires: python%{python3_pkgversion}-pytest-httpbin
|
||
BuildRequires: python%{python3_pkgversion}-pytest-mock
|
||
BuildRequires: python%{python3_pkgversion}-trustme
|
||
%endif
|
||
|
||
%description
|
||
Most existing Python modules for sending HTTP requests are extremely verbose and
|
||
cumbersome. Python’s built-in urllib2 module provides most of the HTTP
|
||
capabilities you should need, but the API is thoroughly broken. This library is
|
||
designed to make HTTP requests easy for developers.
|
||
|
||
|
||
%if %{with extras}
|
||
%pyproject_extras_subpkg -n python%{python3_pkgversion}-requests security socks
|
||
%endif
|
||
|
||
|
||
%generate_buildrequires
|
||
%pyproject_buildrequires %{?with_extradeps:-x security,socks}
|
||
|
||
|
||
%prep
|
||
%autosetup -p1 -n requests-%{version}
|
||
|
||
# env shebang in nonexecutable file
|
||
sed -i '/#!\/usr\/.*python/d' src/requests/certs.py
|
||
|
||
# Some doctests use the internet and fail to pass in Koji. Since doctests don't have names, I don't
|
||
# know a way to skip them. We also don't want to patch them out, because patching them out will
|
||
# change the docs. Thus, we set pytest not to run doctests at all.
|
||
sed -i 's/ --doctest-modules//' pyproject.toml
|
||
|
||
|
||
%build
|
||
%pyproject_wheel
|
||
|
||
|
||
%install
|
||
%pyproject_install
|
||
%pyproject_save_files -l requests
|
||
|
||
|
||
%check
|
||
%pyproject_check_import
|
||
%if %{with tests}
|
||
# test_unicode_header_name - reported: https://github.com/psf/requests/issues/6734
|
||
# test_use_proxy_from_environment needs pysocks
|
||
%pytest -v tests -k "not test_unicode_header_name %{!?with_extradeps:and not test_use_proxy_from_environment}"
|
||
%endif
|
||
|
||
|
||
%files -n python%{python3_pkgversion}-requests -f %{pyproject_files}
|
||
%doc README.md HISTORY.md
|
||
|
||
|
||
%changelog
|
||
## START: Generated by rpmautospec
|
||
* Fri Nov 28 2025 Lukáš Zachar <lzachar@redhat.com> - 2.32.5-3
|
||
- Add gating
|
||
|
||
* Fri Nov 28 2025 Tomáš Hrnčiar <thrnciar@redhat.com> - 2.32.5-2
|
||
- Convert from Fedora for the Python 3.14 stack in RHEL
|
||
|
||
* Fri Nov 28 2025 Tomáš Hrnčiar <thrnciar@redhat.com> - 2.32.5-1
|
||
- RHEL: Rename SPEC to python3.14-idna.spec
|
||
## END: Generated by rpmautospec
|