Skip to content

Lazy import jinja2 in the htmy integration#102

Merged
volfpeter merged 1 commit into
mainfrom
lazy-jinja-import-in-htmy
Jul 16, 2026
Merged

Lazy import jinja2 in the htmy integration#102
volfpeter merged 1 commit into
mainfrom
lazy-jinja-import-in-htmy

Conversation

@volfpeter

@volfpeter volfpeter commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Closes #101

Summary by CodeRabbit

  • Bug Fixes

    • Improved compatibility for environments where optional template-related components are unavailable unless actively used.
  • Chores

    • Updated the package version to 3.2.1.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: b26a1f88-f531-4bfb-9d5c-88acd17de1aa

📥 Commits

Reviewing files that changed from the base of the PR and between 66d4872 and efd8cab.

📒 Files selected for processing (2)
  • fasthx/__init__.py
  • fasthx/htmy.py

Walkthrough

The PR defers the Jinja2Templates import until JinjaTemplate._build_context runs and updates the package version from 3.2.0 to 3.2.1.

Changes

Jinja integration update

Layer / File(s) Summary
Lazy Jinja2Templates resolution
fasthx/htmy.py
Removes the module-level import and resolves Jinja2Templates inside _build_context before using it.
Package version update
fasthx/__init__.py
Updates the exported __version__ constant to 3.2.1.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately reflects the main change: making the htmy Jinja import lazy.
Linked Issues check ✅ Passed The change satisfies #101 by deferring the Jinja-related import until JinjaTemplate builds context.
Out of Scope Changes check ✅ Passed No clear unrelated changes are present; the version bump appears ancillary to the import fix.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch lazy-jinja-import-in-htmy

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@volfpeter
volfpeter merged commit cf02bbc into main Jul 16, 2026
3 checks passed
@volfpeter
volfpeter deleted the lazy-jinja-import-in-htmy branch July 16, 2026 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lazy import jinja2 in the htmy integration

1 participant