From e809183a55ec27f7cda78024121a7a4fd8d4f799 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Sat, 18 Feb 2023 00:43:49 +0000 Subject: [PATCH] Auto sync2gitlab import of python3.11-requests-2.28.1-1.el8.src.rpm --- .gitignore | 1 + EMPTY | 1 - python3.11-requests.spec | 108 +++++++++++++++++++++++++++++ requests-2.28.1-system-certs.patch | 37 ++++++++++ sources | 1 + 5 files changed, 147 insertions(+), 1 deletion(-) create mode 100644 .gitignore delete mode 100644 EMPTY create mode 100644 python3.11-requests.spec create mode 100644 requests-2.28.1-system-certs.patch create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..514950c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/requests-v2.28.1.tar.gz diff --git a/EMPTY b/EMPTY deleted file mode 100644 index 0519ecb..0000000 --- a/EMPTY +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/python3.11-requests.spec b/python3.11-requests.spec new file mode 100644 index 0000000..dc926cf --- /dev/null +++ b/python3.11-requests.spec @@ -0,0 +1,108 @@ +%global __python3 /usr/bin/python3.11 +%global python3_pkgversion 3.11 + +# RHEL: Tests disabled due to missing dependencies +%bcond_with tests + +Name: python%{python3_pkgversion}-requests +Version: 2.28.1 +Release: 1%{?dist} +Summary: HTTP library, written in Python, for human beings + +License: ASL 2.0 +URL: https://pypi.io/project/requests +Source0: 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 +Patch0: requests-2.28.1-system-certs.patch + +BuildArch: noarch + +BuildRequires: python%{python3_pkgversion}-devel +BuildRequires: python%{python3_pkgversion}-rpm-macros +BuildRequires: python%{python3_pkgversion}-charset-normalizer +BuildRequires: python%{python3_pkgversion}-urllib3 +BuildRequires: python%{python3_pkgversion}-idna +# pygments is used for syntax highlighting in the docs - disabled due to missing deps +#BuildRequires: python%%{python3_pkgversion}-pygments +BuildRequires: python%{python3_pkgversion}-setuptools + +%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 + +Requires: python%{python3_pkgversion}-charset-normalizer +Requires: python%{python3_pkgversion}-urllib3 +Requires: python%{python3_pkgversion}-idna + +%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. + + +%{?python_extras_subpkg:%python_extras_subpkg -n python%{python3_pkgversion}-requests -i %{python3_sitelib}/*.egg-info security socks} + +%prep +%autosetup -p1 -n requests-%{version} + +# env shebang in nonexecutable file +sed -i '/#!\/usr\/.*python/d' 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 +%py3_build + + +%install +%py3_install + + +%if %{with tests} +%check +%pytest -v +%endif + + +%files -n python%{python3_pkgversion}-requests +%license LICENSE +%doc README.md HISTORY.md +%{python3_sitelib}/*.egg-info/ +%{python3_sitelib}/requests/ + + +%changelog +* Tue Nov 29 2022 Charalampos Stratakis - 2.28.1-1 +- Initial package +- Fedora contributions by: + Adam Williamson + Arun SAG + Charalampos Stratakis + David Malcolm + Dennis Gilmore + Igor Gnatenko + Iryna Shcherbina + Jeremy Cline + Karolina Surma + Kevin Fenzi + Lumir Balhar + Miro Hrončok + Petr Viktorin + Ralph Bean + Randy Barlow + Rex Dieter + Robert Kuska + Slavek Kabrda + Stephen Gallagher + Tom Callaway + Toshio Kuratomi + yatinkarel diff --git a/requests-2.28.1-system-certs.patch b/requests-2.28.1-system-certs.patch new file mode 100644 index 0000000..58bd6b3 --- /dev/null +++ b/requests-2.28.1-system-certs.patch @@ -0,0 +1,37 @@ +--- requests-2.28.1/requests/certs.py 2022-07-12 13:55:25.378079641 -0700 ++++ requests-2.28.1/requests/certs.py.new 2022-07-12 13:57:03.834621295 -0700 +@@ -9,8 +9,13 @@ + If you are packaging Requests, e.g., for a Linux distribution or a managed + environment, you can change the definition of where() to return a separately + packaged CA bundle. ++ ++This Fedora-patched package returns "/etc/pki/tls/certs/ca-bundle.crt" provided ++by the ca-certificates RPM package. + """ +-from certifi import where ++def where(): ++ """Return the absolute path to the system CA bundle.""" ++ return '/etc/pki/tls/certs/ca-bundle.crt' + + if __name__ == "__main__": + print(where()) +--- requests-2.28.1/setup.py 2022-06-29 08:09:11.000000000 -0700 ++++ requests-2.28.1/setup.py.new 2022-07-12 13:58:33.830116402 -0700 +@@ -62,7 +62,6 @@ + "charset_normalizer>=2,<3", + "idna>=2.5,<4", + "urllib3>=1.21.1,<1.27", +- "certifi>=2017.4.17", + ] + test_requirements = [ + "pytest-httpbin==0.0.7", +--- requests-2.28.1/setup.cfg 2022-06-29 08:09:11.000000000 -0700 ++++ requests-2.28.1/setup.cfg.new 2022-07-12 13:58:19.619038220 -0700 +@@ -4,7 +4,6 @@ + socks + use_chardet_on_py3 + requires-dist = +- certifi>=2017.4.17 + charset_normalizer>=2,<3 + idna>=2.5,<4 + urllib3>=1.21.1,<1.27 diff --git a/sources b/sources new file mode 100644 index 0000000..6918890 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (requests-v2.28.1.tar.gz) = caed2d08340c79af9448eefaa1df796f9112a7c8da30b218d5f342326a9629d95928c0978b9600e4bd7f56a297ef41afb088af390738be431b91b8c7429e741b