build: support Python 3.14 and Django 5.2; migrate to zuban#62
Merged
Conversation
Modernise the runtime and tooling baseline so the async 2.0 work lands on a supported stack, split out of the larger 2.0 branch as its own change. - Require Django >= 5.2 (was >= 4.1). Django < 5.2 is end-of-life upstream and was neither tested nor supported; 5.2 is the LTS line the downstream app ships and the first to support Python 3.14. This also fixes the test crash under CPython 3.14, which was Django 5.1's template Context.__copy__. - Run tests on a Python 3.13 + 3.14 matrix. On 3.14 the dependency floors rise to the first releases shipping 3.14 wheels (pydantic >= 2.13, orjson >= 3.11, lxml >= 6); 3.13 installs are unaffected. uv.lock is pinned to the Django 5.2 LTS line through a dev-only [tool.uv] constraint, leaving the public floor open (the lock is not part of the published package). - Migrate the type checker from basedpyright to zuban (reads mypy-format config, runs its pyright-style default mode). The type-check job stays advisory (non-blocking) until zuban is green on the async refactor. CI also pins setup-uv to 0.10.10 to match REQUIRED_UV_VERSION. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Run zuban in mypy mode instead of the pyright-style default and get the codebase to a clean type-check without the previous blanket disable list, so the checker keeps its value. - Switch the Makefile to `--mode mypy` via an overridable ZUBAN_MODE. - Install the optional sentry-sdk / logfire backends in the typing group so tracing.py is type-checked for real instead of skipped as missing imports. - Replace the eight-code blanket disable_error_code with just two: var-annotated (prefer inference over forced annotations) and the annotation-unchecked note. - Fix the remaining reports in code rather than ignoring them: give HtmxComponent a TYPE_CHECKING __init__, make _Model generic over the model type, add explicit returns, drop a redundant re-annotation, and a few targeted `# type: ignore` for genuine framework/stub limitations (Channels override, is_usable stub, optional-import fallbacks). The type-check job stays advisory; it can flip to blocking once the async PR, which rewrites most of these files, is validated against this config. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Splits the environmental / baseline changes out of #61 (djhtmx 2.0) so they can land first, independently of the async pipeline feature.
What this does
>= 4.1). Django < 5.2 is end-of-life upstream and was neither tested nor supported; 5.2 is the LTS line the downstream app ships and the first to support Python 3.14. This fixes the Python 3.14 test crash (Django 5.1's templateContext.__copy__under CPython 3.14).pydantic>=2.13,orjson>=3.11,lxml>=6); 3.13 is unaffected.uv.lockis pinned to the Django 5.2 LTS line via a dev-only[tool.uv]constraint, leaving the public floor open (the lock isn't part of the published package).setup-uvto 0.10.10 (matchesREQUIRED_UV_VERSION).Validation
make lint✅make teston Python 3.13 and 3.14 (Django 5.2.15): ✅ 137 tests eachmake typecheck(zuban): advisory — 16 errors remain in files the djhtmx 2.0: async views, synchronous dispatch on a bounded pool #61 async refactor rewrites (repo.py,command_queue.py,urls.py,sse_executor.py,testing.py); they clear once that lands, at which point the type-check can be made blocking.Follow-up
#61 rebases on top of this to carry the async pipeline, its tests/docs, and the flip of the type-check to blocking.
🤖 Generated with Claude Code