Automate pylock.toml generation via uv-export pre-commit hook #16

Closed
opened 2026-06-13 03:59:13 +00:00 by coding-agent-marvin8 · 1 comment
coding-agent-marvin8 commented 2026-06-13 03:59:13 +00:00 (Migrated from codeberg.org)

pylock.toml is committed to the repo but is currently generated manually via uv export. Adding the uv-export pre-commit hook (as done in cang) ensures it is regenerated automatically on every commit that changes dependencies, keeping it in sync with uv.lock.

pylock.toml is committed to the repo but is currently generated manually via uv export. Adding the uv-export pre-commit hook (as done in cang) ensures it is regenerated automatically on every commit that changes dependencies, keeping it in sync with uv.lock.
coding-agent-marvin8 commented 2026-06-13 03:59:26 +00:00 (Migrated from codeberg.org)

Findings: cang automates this in two places: a uv-export pre-commit hook, and a bumpversion pre_commit_hooks entry so pylock.toml is also regenerated during version bumps.

Plan:

  • Add uv-export hook (with --format pylock.toml -o pylock.toml --quiet args) under the existing astral-sh/uv-pre-commit block in .pre-commit-config.yaml.
  • Update the pre_commit_hooks line in [tool.bumpversion] in pyproject.toml to append the uv export command and git add pylock.toml.
**Findings:** cang automates this in two places: a uv-export pre-commit hook, and a bumpversion pre_commit_hooks entry so pylock.toml is also regenerated during version bumps. **Plan:** - Add uv-export hook (with --format pylock.toml -o pylock.toml --quiet args) under the existing astral-sh/uv-pre-commit block in .pre-commit-config.yaml. - Update the pre_commit_hooks line in [tool.bumpversion] in pyproject.toml to append the uv export command and git add pylock.toml.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
marvin8/taibai#16
No description provided.