GeezerVison is showing github.com — chore: Scriptorium as a Python test framework (+ Fable 5.8.0 bump) by dbrattli · Pull Request #346 · fable-compiler/Fable.Python
Conversation
What this is
A spike to evaluate Scriptorium (Maxime Mangel's F#/Fable testing stack — Nib assertions + Quill runner) as a test framework for Fable.Python, compiled to Python. Opened so we can decide the direction later — it is intentionally not wired into CI or the main suite.
Contents
1. chore(deps): bump Fable to 5.8.0
fable tool 5.6.0 → 5.8.0, fable-library 5.6.0 → 5.8.0 (lockstep), uv.lock re-locked.
- 5.8.0's Python backend fixes
[<EntryPoint>] exit-code propagation — it now emits sys.exit(int(main(...))), so a failing runner is visible to CI. This bug was found by the spike; the fix was contributed upstream and shipped in 5.8.0 (fable-compiler/Fable 7848eae46).
- Verified: full pytest suite still 563/563 green under 5.8.0.
2. spike: evaluate Scriptorium (Nib + Quill)
spike/scriptorium/ — Spike.fsproj, Main.fs, README.md, plus a just spike-scriptorium target.
- Small Quill/Nib suite that exercises plain F# assertions and real
Fable.Python.Math bindings, compiled --lang python and run on CPython.
Findings (full write-up in spike/scriptorium/README.md)
- ✅ Scriptorium compiles cleanly to Python — it already ships explicit
#if FABLE_COMPILER_PYTHON support. The runner works on CPython (colored output, diffs, source links), and exit codes are correct (pass→0, fail→1) with no shim on 5.8.0.
- Nib assertions are separable from the Quill runner —
assertThat throws on failure, which pytest reports fine. So we could adopt Nib's richer assertions while keeping [<Fact>] + pytest, without a runner swap.
- Out of scope / blocked:
Nib.Browser (Playwright/JS-only); Nib.Snapshot and Hedgehog hit fable-library-python runtime gaps.
- Key caveat for a full migration: Scriptorium's headline cross-target benefit doesn't apply here — these tests exercise Python-only bindings. A full move to the Quill runner trades away pytest's ecosystem (discovery,
-k/-x, parametrize, plugins, JUnit XML, coverage).
Direction options (for discussion, not decided here)
- Nib under pytest — richest assertions, lowest risk, keep pytest.
- Full Quill+Nib (phased) — one idiom across Fable projects, lose pytest tooling.
- Pilot one module to
Quill+Nib, evaluate, then decide.
- Leave as-is — 563 tests green on a standard runner.
Known limitations of the spike
Spike.fsproj references a local ../../../Scriptorium checkout (not NuGet), so it only builds where that checkout exists. Scriptorium's Python-supporting packages would need to be consumed via NuGet/paket before this is portable. This is fine for a spike but means CI does not build it.
- Generated output (
spike/scriptorium/build/) is gitignored.
🤖 Generated with Claude Code
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Fable 5.8.0's Python backend propagates the [<EntryPoint>] return value as
the process exit code (emits `sys.exit(int(main(...)))`), so a failing test
runner is now visible to CI. Bumps the fable tool and fable-library in lockstep.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Proof-of-concept showing Scriptorium's Nib assertions + Quill runner compile
to Python via Fable.Python and can test real bindings. Adds spike/scriptorium/
(Spike.fsproj, Main.fs, README.md) and a `just spike-scriptorium` target.
Not wired into CI or the main suite — this is a spike to inform whether/how to
adopt Scriptorium. See spike/scriptorium/README.md for findings and trade-offs.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
dbrattli
changed the title
Spike: Scriptorium as a Python test framework (+ Fable 5.8.0 bump)
chore: Scriptorium as a Python test framework (+ Fable 5.8.0 bump)
Jul 13, 2026
This branch has not been deployed
No deployments
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|