Skip to content

fix: declare templates/thumbnail extras and re-lock uv.lock on release - #274

Merged
pzfreo merged 2 commits into
mainfrom
fix/extras-and-release-lock
Aug 30, 2026
Merged

pzfreo merged 2 commits into
mainfrom
fix/extras-and-release-lock

Conversation

@pzfreo

@pzfreo pzfreo commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Two follow-ups from the v0.6.2 click fix.

1. The templates / thumbnail extras did not exist

templates.py and thumbnail.py tell users to run pip install bambox[templates] / bambox[thumbnail], but neither extra was declared — jinja2 and pillow were dev-only, so following the hint installed nothing.

  • Declare both extras in pyproject.toml (jinja2>=3.1.0, pillow>=10.0.0).
  • gcode_thumbnail() now raises the same actionable ImportError render_template() already had, instead of a bare ModuleNotFoundError: No module named 'PIL'. Only the public entry point is guarded; _placeholder() is reached only after that import has succeeded.
  • New TestOptionalExtras in test_release_readiness.py asserts each extra named in a hint is present in Provides-Extra, so a hint can't drift from the metadata again.
  • README documents the extras.

Verified in a clean venv: pip install "bambox[templates,thumbnail]" resolves jinja2 3.1.6 + pillow 12.3.0 and gcode_thumbnail() renders; without them both functions raise the actionable message.

2. uv.lock drifted behind every release

Prepare Release bumps pyproject.toml but never re-locked, so the lockfile fell behind — it still said 0.4.7 while main was on 0.6.1, and it's already stale again at 0.6.2.

  • New Sync uv.lock to the new version step runs uv lock after the bump and asserts the lock reports the target version.
  • uv.lock added to the release commit's git add.
  • Lockfile re-locked to 0.6.2 in this PR.

Pre-PR checklist: ruff check ✔, ruff format ✔, mypy ✔, pytest -m "not e2e" 400 passed. (The test_e2e_cura_vs_bbl.py errors on a full local run are pre-existing — they need the estampo CLI + Docker.)

🤖 Generated with Claude Code

https://claude.ai/code/session_011aB9rCzbxyCrr7ZcXEN7g5

Paul Fremantle and others added 2 commits August 30, 2026 09:48
Two follow-ups from the 0.6.2 click fix.

render_template() and gcode_thumbnail() point users at
`pip install bambox[templates]` / `[thumbnail]`, but neither extra
existed — jinja2 and pillow were dev-only, so the hint installed
nothing. Declare both extras, give gcode_thumbnail() the same actionable
ImportError render_template() already had instead of a bare
ModuleNotFoundError, and gate it with a metadata test so a hint can
never again name an extra that does not exist.

Prepare Release bumped pyproject.toml but never re-locked, so uv.lock
drifted behind every release (it still said 0.4.7 at 0.6.1). Re-lock
after the bump, verify the lock reports the target version, and commit
it with the release.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011aB9rCzbxyCrr7ZcXEN7g5
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011aB9rCzbxyCrr7ZcXEN7g5
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/bambox/thumbnail.py 50.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@pzfreo
pzfreo merged commit 0f7ac92 into main Aug 30, 2026
12 checks passed
@pzfreo
pzfreo deleted the fix/extras-and-release-lock branch August 30, 2026 08:51
@pzfreo pzfreo mentioned this pull request Aug 30, 2026
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.

2 participants