Skip to content

Sync blacken-docs' black pin via sync-with-uv pragma#58

Merged
tsvikas merged 1 commit into
mainfrom
sync-blacken-docs-with-pragma
Jul 14, 2026
Merged

Sync blacken-docs' black pin via sync-with-uv pragma#58
tsvikas merged 1 commit into
mainfrom
sync-blacken-docs-with-pragma

Conversation

@tsvikas

@tsvikas tsvikas commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Replace the custom _sync-blacken-docs justfile recipe with the # sync-with-uv pragma comment (sync-with-uv 0.6.0), letting the existing uvx sync-with-uv step in deps-update keep blacken-docs' black== additional_dependency in sync with uv.lock.

Why the dependency form changed too

The released pragma parser only matches a block-style list item (- black==...) and needs a parseable version, so two adjustments were required beyond swapping the pragma in:

  • flow-style [black==...] # sync-with-uv is rejected (no dependency to sync, exit 123), so it moves to a block list.
  • black==<placeholder_until_update_deps> cannot be rewritten (not a valid version) and would abort the first just deps-update at the uvx sync-with-uv step, so it seeds black==0, which sync-with-uv rewrites to the locked version on that first run.

Verification

Confirmed against the released uvx sync-with-uv:

  • block + black==0sync-with-uv rewrites to the locked version, exit 0
  • sync-pre-commit-deps preserves the block style and pragma comment
  • re-running sync-with-uv is idempotent (exit 0)

Note: like every rev: <placeholder> line, a freshly generated project's blacken-docs hook can't install black until deps-update has run once.

🤖 Generated with Claude Code

https://claude.ai/code/session_015vNv6wUpJczEwAbapjWs7p

Replace the custom `_sync-blacken-docs` justfile recipe with the
`# sync-with-uv` pragma comment (sync-with-uv 0.6.0), letting the
existing `uvx sync-with-uv` step in `deps-update` keep blacken-docs'
`black==` additional_dependency in sync with uv.lock.

The pragma parser only matches a block-style list item and needs a
parseable version, so the dependency moves from the flow-style
`[black==...]` to a block list and seeds `black==0` instead of the
`<placeholder_until_update_deps>` token (which sync-with-uv cannot
rewrite, and which would abort the first `just deps-update`).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015vNv6wUpJczEwAbapjWs7p
@tsvikas
tsvikas marked this pull request as ready for review July 14, 2026 11:53

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@tsvikas
tsvikas merged commit 650ad90 into main Jul 14, 2026
5 checks passed
@tsvikas
tsvikas deleted the sync-blacken-docs-with-pragma branch July 14, 2026 12:03
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.

1 participant