Repository navigation
feat(py)!: replace Rust handlebarrz with pure-Python dotpromptz-handlebars - #620
Merged
Merged
Conversation
huangjeff5
force-pushed
the
feat/handlebars-python
branch
from
September 30, 2026 19:07
55b9118 to
6cc9801
Compare
pavelgj
reviewed
Oct 1, 2026
pavelgj
left a comment
Collaborator
There was a problem hiding this comment.
A few comments/questions
huangjeff5
force-pushed
the
feat/handlebars-python
branch
12 times, most recently
from
October 2, 2026 04:14
c421f0c to
1465212
Compare
Callers import dotpromptz_handlebars. The wheel name stays handlebars-dotprompt.
This PR still builds handlebarrz with Rust. PyPy runs on the PR that removes it.
Clears the medium and high advisories that fail the uv-lock-check security scan. PYSEC-2026-3472 (jupyter-server, low, no fix) stays below fail_on.
…bars - Replace python/handlebarrz with pure Python python/handlebars (dotpromptz-handlebars 0.2.0, import dotpromptz_handlebars). - Wire python/dotpromptz to dotpromptz-handlebars>=0.2.0. - Drop Rust extension build, sccache, and toolchain from python.yml. - Add PyPy 3.11 testing matrix cell in CI. - Remove leftover Rust scripts, docs, and references across the repo. BREAKING CHANGE: The `json` helper now raises `TypeError` instead of `ValueError` when given non-serializable objects, aligning with Python standard library `json.dumps()` semantics.
…cation in docstring
huangjeff5
force-pushed
the
feat/handlebars-python
branch
from
October 5, 2026 16:23
af28125 to
0e4ac4c
Compare
Regular PRs checked out with secrets.RELEASE_PLEASE_TOKEN || github.token. The fallback only applies when the secret is empty, so an expired PAT broke checkout on every PR. Scope the PAT to release-please-- branches, which are the only ones that push lockfile updates back.
Touching a workflow makes the Actions scan audit the whole file. Pin the three floating actions in bazel.yml to the SHAs their tags resolve to today (no behavior change). Revert the go.yml/js.yml edits: they pulled in pre-existing Go/JS/zizmor failures unrelated to this stack.
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.
Replaces the Rust
handlebarrzextension with a pure-Pythondotpromptz-handlebarspackage (imported asdotpromptz_handlebars).Decisions
pip install dotpromptz==0.1.6depends ondotpromptz-handlebars>=0.1.8without an upper bound, and those releases dofrom handlebarrz import Handlebars. The 0.2.0 wheel still includes that module so legacy installs keep working. Remove this compatibility shim in a future stable release (e.g. 1.0.0) after users have had sufficient time to upgrade todotpromptz>=0.2.0.{}enters{{#if}}and{{#with}}: In Handlebars.js,{}is truthy and enters conditional blocks, whileNone,False,0,"", and[]takeelse. We chose JS truthiness because a Dotprompt template must produce byte-for-byte identical output across TypeScript, Dart, and Python.[object Object], lists as1,2, and floats like1.0as1. We preserve this behavior so prompt rendering is portable across SDKs; structured data in prompts should use{{json var}}.ValueError: Context payloads cannot supply executable callables. Dynamic logic must be explicitly registered viaregister_helper()to eliminate arbitrary template execution vulnerabilities.jsonhelper raisesTypeError: Non-serializable inputs passed to{{json var}}now raiseTypeErrorinstead ofValueError, matching Python standard libraryjson.dumps()semantics.python.ymlandrust.yml: Deletingpython/handlebarrzremoved the need for Rust toolchains inpython.ymland eliminated thepython/handlebarrz/**path trigger inrust.yml. Touching these workflows triggered the repository's mandatoryzizmorscanner, which blocks CI on unpinned action tags and known vulnerabilities (tj-actions/changed-files). Both workflows were hardened with immutable commit SHA action pins and least-privilege permissions so CI remains green.completions.rs: The workspace enables-D clippy::pedantic. Newer Rust toolchains in GitHub Actions enforceclippy::assert_is_empty, which fails CI onassert!(!output.is_empty()). Updating the test assertion toassert_ne!(output, Vec::<u8>::new())was required to keep the workspace Clippy check green.