diff --git a/3773.patch b/3773.patch new file mode 100644 index 0000000000000000000000000000000000000000..f4e9da645b7fdf2e0a11d678cecb199328948d7b --- /dev/null +++ b/3773.patch @@ -0,0 +1,27 @@ +From 63e885394a629d194b0aa867e8fbf475cdec6521 Mon Sep 17 00:00:00 2001 +From: "Benjamin A. Beasley" +Date: Sun, 22 Feb 2026 11:12:27 +0000 +Subject: [PATCH] Adapt test_response_decode_text_using_autodetect for chardet + 6.0 + +See https://github.com/encode/httpx/discussions/3772. +--- + tests/models/test_responses.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/tests/models/test_responses.py b/tests/models/test_responses.py +index 06c28e1e30..d2972da5bd 100644 +--- a/tests/models/test_responses.py ++++ b/tests/models/test_responses.py +@@ -1011,7 +1011,10 @@ def test_response_decode_text_using_autodetect(): + + assert response.status_code == 200 + assert response.reason_phrase == "OK" +- assert response.encoding == "ISO-8859-1" ++ # The encoded byte string is consistent with either ISO-8859-1 or ++ # WINDOWS-1252. Versions <6.0 of chardet claim the former, while chardet ++ # 6.0 detects the latter. ++ assert response.encoding in ("ISO-8859-1", "WINDOWS-1252") + assert response.text == text + + diff --git a/python-httpx.spec b/python-httpx.spec index 038275cc80a5b3a029d1eaf7dbab02de4e141bd0..b087a83981daaa67abc4ace63b3c6ed4f69afbda 100644 --- a/python-httpx.spec +++ b/python-httpx.spec @@ -1,31 +1,41 @@ -%global pypi_name httpx -%define _unpackaged_files_terminate_build 0 -Name: python-%{pypi_name} -Version: 0.24.1 -Release: 4%{?dist} -Summary: Python HTTP client +Name: python-httpx +Version: 0.28.1 +Release: 1%{?dist} +Summary: Next-generation HTTP client for Python -License: BSD +License: BSD-3-Clause URL: https://github.com/encode/httpx -Source0: %{url}/archive/%{version}/%{pypi_name}-%{version}.tar.gz +Source0: %{url}/archive/%{version}/httpx-%{version}.tar.gz +# Adapt test_response_decode_text_using_autodetect for chardet 6.0 +# https://github.com/encode/httpx/pull/3773 +Patch0: %{url}/pull/3773.patch BuildArch: noarch -%description -HTTPX is a fully featured HTTP client for Python, which provides sync and -async APIs, and support for both HTTP/1.1 and HTTP/2. +BuildRequires: python3-devel +BuildRequires: help2man + +%global _description %{expand: +HTTPX is a fully featured HTTP client library for Python 3. It includes an +integrated command line client, has support for both HTTP/1.1 and HTTP/2, and +provides both sync and async APIs.} + + +%description %{_description} -%package -n python3-%{pypi_name} +%package -n python3-httpx Summary: %{summary} -BuildRequires: python3-devel -BuildRequires: python3-setuptools -%description -n python3-%{pypi_name} +%description -n python3-httpx %{_description} HTTPX is a fully featured HTTP client for Python, which provides sync and async APIs, and support for both HTTP/1.1 and HTTP/2. + %prep -%autosetup -n %{pypi_name}-%{version} +%autosetup -n httpx-%{version} -p1 +# allow newer rich +# upstream bumps this version by version (see e.g. https://github.com/encode/httpx/pull/3541) +sed -i 's/rich>=10,<14/rich>=10/' pyproject.toml %generate_buildrequires %pyproject_buildrequires @@ -35,14 +45,26 @@ async APIs, and support for both HTTP/1.1 and HTTP/2. %install %pyproject_install -%pyproject_save_files %{pypi_name} +%pyproject_save_files httpx +install -d '%{buildroot}%{_mandir}/man1' +PYTHONPATH='%{buildroot}%{python3_sitelib}' \ + PATH="${PATH-}:%{buildroot}%{_bindir}" \ + PYTHONDONTWRITEBYTECODE=1 \ + help2man --no-info --version-string='%{version}' \ + --output='%{buildroot}%{_mandir}/man1/httpx.1' httpx -%files -n python3-%{pypi_name} -f %{pyproject_files} -%license LICENSE.md +%files -n python3-httpx -f %{pyproject_files} +%doc CHANGELOG.md %doc README.md +%license LICENSE.md %attr(755, root, root) %{_bindir}/httpx +%{_mandir}/man1/httpx.1* %changelog +* Thu May 7 2026 doupengda - 0.28.1-1 +- [Type] sync +- [DESC] update version to 0.28.1-1 + * Wed Jun 11 2025 bbrucezhang - 0.24.1-4 - Rebuilt for loongarch64 diff --git a/sources b/sources index dcf06611f81b094dc3e4dbe0905b0eac38753687..5c975577190ec11ee2a44f4a30e2475098046e7e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (httpx-0.24.1.tar.gz) = 056741ef4e356f13adfcb66766489b39e79dbf4264d9780b8788c0934f7f3ff1a9b6bcb396a9f146e88315831f5399cebdd537c5a39c86b9b6bac3600d5560b6 +SHA512 (httpx-0.28.1.tar.gz) = 5571957a3516533f1c1e76f311316811f6365e192d19ebae10c9ab0d0c4094d811063fd2be2995f3b6a41d6899a7882f27265badecf238a4f7903f976136d3ba