feat!: migrate to httpx2 and consolidate the unshipped 0.1.2 into 0.2.0 - #11
Merged
Conversation
httpx upstream is low-activity; Pydantic maintains httpx2 as its continuation and ships security fixes for it. This library sits in the critical path of user requests, so it follows the maintained fork. Breaking: httpx types are part of the public surface (http_client=, with_options(timeout=), the testkit Handler alias), so callers must swap `import httpx` for `import httpx2`. httpx2 also verifies TLS against the OS trust store via truststore rather than bundled certifi roots.
0.1.2 was written into the changelog and version files on 2026-08-19 but never tagged or published — PyPI still serves 0.1.1. Since no user ever saw a 0.1.2, its entries fold into the release that actually ships rather than shipping two versions on one day. 0.2.0 rather than 0.1.3: the unshipped section already dropped companies.metrics/history and changed four company endpoints to return lists, and the httpx2 move breaks the public client types on top of that. Also repoints the cross-package pins (discolike-cli -> discolike, the discolike[cli] extra), which referenced the 0.1.2 that never existed on the index and so could not resolve.
The CLI is not an independent consumer of the SDK — it is the SDK's command-line front end, released from this repo in lockstep and only ever tested against its own generation. A range pin invites combinations that never ran together in CI; an exact pin means the pair a user installs is the pair that was tested. Consequence: both packages ship on every release, including one whose own code did not change. Publishing them together also matters, since discolike[cli] is unsatisfiable in the window between the two uploads.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
httpxupstream has seen limited activity, and Pydantic has picked up stewardship ashttpx2specifically to keep security updates flowing for a library sitting in the critical path of production traffic. This SDK is that critical path for its users, so it follows the maintained fork.While here, this also fixes a release that got stuck:
0.1.2was written into the changelog and version files on 2026-08-19 but never tagged or published. PyPI still serves0.1.1, and both cross-package pins referenced a0.1.2that does not exist on the index — meaningpip install discolike-clicould not resolve today.What
httpx → httpx2 (
005d083) — mechanical rename across the SDK, testkit, tests,scripts/check_contract.py, and the README. Every symbol in use (Response,Request,QueryParams,MockTransport,Client,AsyncClient,Timeout,USE_CLIENT_DEFAULT,TransportError,ConnectError) exists unchanged in httpx2, so no logic moved. Dependency floor ishttpx2>=2.9.Release consolidation (
9bc79a6) — the unshipped0.1.2section folds into0.2.0alongside the pending work.0.2.0rather than0.1.3because that section already removedcompanies.metrics/historyand changed four company endpoints to return lists, and httpx2 breaks the public client types on top of that.Exact sibling pins (
47a315c) —discolike-clinow requiresdiscolike==0.2.0and thediscolike[cli]extra requiresdiscolike-cli==0.2.0, replacing the previous bare>=floor. The CLI is the SDK's front end rather than an independent consumer, so the installed pair is always the tested pair.Breaking changes
httpx types are part of the public surface, so callers must update:
import httpximport httpx2Client(http_client=httpx.Client(...))Client(http_client=httpx2.Client(...))client.with_options(timeout=httpx.Timeout(...))client.with_options(timeout=httpx2.Timeout(...))Handler = Callable[[httpx.Request], httpx.Response]httpx2Behavior change worth flagging: httpx2 verifies TLS against the operating system trust store via
truststoreinstead of the bundledcertifiroots. No code change on our side, but users on hosts with an incomplete or custom system trust store may see verification failures thatcertifipreviously masked.Testing
ruff checkandruff format --checkclean;tyreports the same 3 pre-existingexamples/diagnostics asdevelopment, no new ones.MockTransport, so it proves API compatibility but never opens a socket. Verified the real wire path separately: a live HTTPS request toapi.discolike.comcompletes the handshake and round trip under httpx2's truststore-based verification.Release notes
Nothing is tagged or published by this PR. Merging leaves
developmentholding a complete0.2.0. When it ships, both packages must be published together — the exact pins makediscolike[cli]unsatisfiable in the window between the two uploads.Greptile Summary
The PR migrates the SDK and test infrastructure from httpx to httpx2 and consolidates the pending release as 0.2.0.
Confidence Score: 5/5
The PR appears safe to merge, with no concrete unacknowledged defects identified in the changed code.
The migration consistently updates production, testkit, tests, tooling, dependency metadata, and lockfile references, while the exact-pin publication window is explicitly documented and no incompatible httpx2 behavior was established.
Important Files Changed
Reviews (1): Last reviewed commit: "build: pin the CLI and SDK to each other..." | Re-trigger Greptile