Skip to content

Commit f44fda2

Browse files
josixclaude
andcommitted
refactor: declare render_diff.py dependencies inline (PEP 723)
`uv run <script>` now installs polib, beautifulsoup4, playwright and pillow itself, so the --no-project/--with flags are no longer needed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_014pJTfUKUkCc4HFprcvhxRe
1 parent cc687fc commit f44fda2

2 files changed

Lines changed: 15 additions & 4 deletions

File tree

‎.claude/skills/review-rendered-diff/SKILL.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ mode used, e.g. `[blocks: rewritten, 87% changed]`.
2525
From the repo root:
2626

2727
```bash
28-
uv run --no-project --with polib --with beautifulsoup4 --with playwright --with pillow \
29-
python .claude/skills/review-rendered-diff/scripts/render_diff.py howto/logging.po --base origin/3.15
28+
uv run .claude/skills/review-rendered-diff/scripts/render_diff.py howto/logging.po --base origin/3.15
3029
```
3130

31+
The script declares its dependencies inline (PEP 723), so `uv run` needs no `--with` flags.
32+
3233
| Flag | Default | Use |
3334
|---|---|---|
3435
| `--base` | `origin/3.15` | "before" version (fetch it first; SSH may fail, see below) |

‎.claude/skills/review-rendered-diff/scripts/render_diff.py‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
1+
# /// script
2+
# requires-python = ">=3.10"
3+
# dependencies = [
4+
# "beautifulsoup4",
5+
# "pillow",
6+
# "playwright",
7+
# "polib",
8+
# ]
9+
# ///
110
"""Render a PO file's translation changes as inline red/green diffs on the built HTML page.
211
312
Builds the page twice (base version of the PO, then the working-tree version), finds every
413
entry whose msgstr changed, injects an inline diff into the new page's paragraph, and saves
514
one screenshot per changed paragraph plus a stitched overview.
615
716
usage (from the repo root):
8-
uv run --no-project --with polib --with beautifulsoup4 --with playwright --with pillow \
9-
python .claude/skills/review-rendered-diff/scripts/render_diff.py howto/logging.po --base origin/3.15
17+
uv run .claude/skills/review-rendered-diff/scripts/render_diff.py howto/logging.po --base origin/3.15
18+
19+
Dependencies are declared above (PEP 723), so uv installs them into a cached environment.
1020
1121
Outputs go to .render-review/<po path without .po>/ unless --out is given.
1222
"""

0 commit comments

Comments
 (0)