public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/python-starlette] rawhide: Document and minimize the patch for testing with httpx vs. httpx2
@ 2026-05-31 17:09 Benjamin A. Beasley
  0 siblings, 0 replies; only message in thread
From: Benjamin A. Beasley @ 2026-05-31 17:09 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/python-starlette
            Branch : rawhide
            Commit : 9012e1b3abfe7c726df90133ae2aa4eeb2883eab
            Author : Benjamin A. Beasley <code@musicinmybrain.net>
            Date   : 2026-05-31T17:57:24+01:00
            Stats  : +6/-93 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/python-starlette/c/9012e1b3abfe7c726df90133ae2aa4eeb2883eab?branch=rawhide

            Log:
            Document and minimize the patch for testing with httpx vs. httpx2

This adds a comment to the spec file for context and upstream status:
https://docs.fedoraproject.org/en-US/packaging-guidelines/#_all_patches_should_have_an_upstream_bug_link_or_comment

Reverting only the lines that are absolutely necessary makes it clearer
what we are doing with the patch, and also makes it easier to carry it
in future releases without constant interactive rebasing.

---
diff --git a/python-starlette-1.2.0-PR3295-undo.patch b/python-starlette-1.2.0-PR3295-undo.patch
index edde3f0..44b7188 100644
--- a/python-starlette-1.2.0-PR3295-undo.patch
+++ b/python-starlette-1.2.0-PR3295-undo.patch
@@ -1,30 +1,3 @@
-diff -Naur python-starlette-1.2.0-orig/pyproject.toml python-starlette-1.2.0/pyproject.toml
---- python-starlette-1.2.0-orig/pyproject.toml	2026-05-28 07:36:57.000000000 -0400
-+++ python-starlette-1.2.0/pyproject.toml	2026-05-28 13:14:14.052233975 -0400
-@@ -48,7 +48,6 @@
- dev = [
-     # We add starlette[full] so `uv sync` considers the extras.
-     "starlette[full]",
--    "httpx2[zstd]>=2.0.0",
-     "coverage>=7.8.2",
-     "importlib-metadata==9.0.0",
-     "mypy==1.16.1",
-diff -Naur python-starlette-1.2.0-orig/starlette/testclient.py python-starlette-1.2.0/starlette/testclient.py
---- python-starlette-1.2.0-orig/starlette/testclient.py	2026-05-28 07:36:57.000000000 -0400
-+++ python-starlette-1.2.0/starlette/testclient.py	2026-05-28 13:13:35.417345613 -0400
-@@ -41,10 +41,10 @@
- else:
-     try:
-         import httpx2 as httpx
--    except ModuleNotFoundError:  # pragma: no cover
-+    except ModuleNotFoundError:
-         try:
-             import httpx
--        except ModuleNotFoundError:
-+        except ModuleNotFoundError:  # pragma: no cover
-             raise RuntimeError(
-                 "The starlette.testclient module requires the httpx2 package to be installed.\n"
-                 "You can install this with:\n"
 diff -Naur python-starlette-1.2.0-orig/tests/test_requests.py python-starlette-1.2.0/tests/test_requests.py
 --- python-starlette-1.2.0-orig/tests/test_requests.py	2026-05-28 07:36:57.000000000 -0400
 +++ python-starlette-1.2.0/tests/test_requests.py	2026-05-28 13:13:35.414490586 -0400
@@ -49,69 +22,3 @@ diff -Naur python-starlette-1.2.0-orig/tests/test_websockets.py python-starlette
              "connection": "upgrade",
              "host": "testserver",
              "user-agent": "testclient",
-diff -Naur python-starlette-1.2.0-orig/uv.lock python-starlette-1.2.0/uv.lock
---- python-starlette-1.2.0-orig/uv.lock	2026-05-28 07:36:57.000000000 -0400
-+++ python-starlette-1.2.0/uv.lock	2026-05-28 13:14:51.630697167 -0400
-@@ -468,19 +468,6 @@
- ]
- 
- [[package]]
--name = "httpcore2"
--version = "2.2.0"
--source = { registry = "https://pypi.org/simple" }
--dependencies = [
--    { name = "certifi" },
--    { name = "h11" },
--]
--sdist = { url = "https://files.pythonhosted.org/packages/1a/7e/8ab39aab1d392845b6512009a9be57d24a5bd4ec7a22d02e513d0645e7a8/httpcore2-2.2.0.tar.gz", hash = "sha256:10e0e142f1ecc1c1cb2a9ebbce82e57f16169f61d163ea336abf36799e89294b", size = 63533, upload-time = "2026-05-17T05:29:55.836Z" }
--wheels = [
--    { url = "https://files.pythonhosted.org/packages/39/22/64de17e7956e8c002f7558ed667d924c2a288344aeff4bd8ff5dc5fdb70b/httpcore2-2.2.0-py3-none-any.whl", hash = "sha256:ce859f268bf8d34fa2d7753e09e4dd5194f557e1b3038439b68a89b2999572fa", size = 79288, upload-time = "2026-05-17T05:29:52.56Z" },
--]
--
--[[package]]
- name = "httpx"
- version = "0.28.1"
- source = { registry = "https://pypi.org/simple" }
-@@ -496,26 +483,6 @@
- ]
- 
- [[package]]
--name = "httpx2"
--version = "2.2.0"
--source = { registry = "https://pypi.org/simple" }
--dependencies = [
--    { name = "anyio" },
--    { name = "certifi" },
--    { name = "httpcore2" },
--    { name = "idna" },
--]
--sdist = { url = "https://files.pythonhosted.org/packages/f4/aa/c3119de1aa7ad870a01aaddbf3bc3445ed9a681c31d45e3838fd8b7bc155/httpx2-2.2.0.tar.gz", hash = "sha256:f3428d59b1752b8f5629826277262fb4d65e3a683f48af8a5b16c4d012e0b801", size = 80477, upload-time = "2026-05-17T05:29:57.376Z" }
--wheels = [
--    { url = "https://files.pythonhosted.org/packages/be/e0/e0a52596c14194e428c20de4903f4abec38c0dfb5364d20f1d4a2b6266ef/httpx2-2.2.0-py3-none-any.whl", hash = "sha256:12347ebd2daeaefd50b529359778fff767082a09c5826752c963e71269722ff0", size = 74083, upload-time = "2026-05-17T05:29:54.543Z" },
--]
--
--[package.optional-dependencies]
--zstd = [
--    { name = "zstandard", marker = "python_full_version < '3.14'" },
--]
--
--[[package]]
- name = "id"
- version = "1.5.0"
- source = { registry = "https://pypi.org/simple" }
-@@ -1302,7 +1269,6 @@
- [package.dev-dependencies]
- dev = [
-     { name = "coverage" },
--    { name = "httpx2", extra = ["zstd"] },
-     { name = "importlib-metadata" },
-     { name = "mypy" },
-     { name = "pytest" },
-@@ -1334,7 +1300,6 @@
- [package.metadata.requires-dev]
- dev = [
-     { name = "coverage", specifier = ">=7.8.2" },
--    { name = "httpx2", extras = ["zstd"], specifier = ">=2.0.0" },
-     { name = "importlib-metadata", specifier = "==9.0.0" },
-     { name = "mypy", specifier = "==1.16.1" },
-     { name = "pytest", specifier = "==9.0.3" },

diff --git a/python-starlette.spec b/python-starlette.spec
index 4ca5e58..e554b8a 100644
--- a/python-starlette.spec
+++ b/python-starlette.spec
@@ -7,6 +7,12 @@ License:        BSD-3-Clause
 URL:            https://www.starlette.io/
 Source:         https://github.com/encode/starlette/archive/%{version}/starlette-%{version}.tar.gz
 
+# Since https://github.com/Kludex/starlette/pull/3291, Starlette prefers
+# httpx2, a maintained fork of httpx by the Pydantic people, when it is
+# available. Once we have a python-httpx2 package, we can update the
+# BuildRequires accordingly. Until then, we (downstream-only) revert the part
+# of https://github.com/Kludex/starlette/pull/3295 that adjusted test
+# expectations around the accept-encoding header to match httpx2.
 Patch:          python-starlette-1.2.0-PR3295-undo.patch
 
 BuildSystem:    pyproject

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-05-31 17:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-31 17:09 [rpms/python-starlette] rawhide: Document and minimize the patch for testing with httpx vs. httpx2 Benjamin A. Beasley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox