uv export in bump-my-version pre_commit_hooks runs from wrong directory, breaking just release #54

Closed
opened 2026-06-22 20:25:02 +00:00 by coding-agent-marvin8 · 1 comment
coding-agent-marvin8 commented 2026-06-22 20:25:02 +00:00 (Migrated from codeberg.org)

When just release runs bump-my-version, its pre_commit_hooks executes uv export from the package directory (e.g. packages/zhongli/). This exports only that package's dependencies and writes a partial pylock.toml (~1032 lines for zhongli). The workspace-level uv-export pre-commit hook then re-runs uv export from the repo root, producing the full workspace-wide pylock.toml (~1645 lines). The file is modified, the hook fails, and the version-bump commit is aborted.

Fix: add --directory ../. to the uv export call in pre_commit_hooks in both packages/fenliu/pyproject.toml and packages/zhongli/pyproject.toml, so it always runs against the workspace root regardless of where bumpversion is invoked from.

When `just release` runs `bump-my-version`, its `pre_commit_hooks` executes `uv export` from the package directory (e.g. `packages/zhongli/`). This exports only that package's dependencies and writes a partial `pylock.toml` (~1032 lines for zhongli). The workspace-level `uv-export` pre-commit hook then re-runs `uv export` from the repo root, producing the full workspace-wide `pylock.toml` (~1645 lines). The file is modified, the hook fails, and the version-bump commit is aborted. Fix: add `--directory ../.` to the `uv export` call in `pre_commit_hooks` in both `packages/fenliu/pyproject.toml` and `packages/zhongli/pyproject.toml`, so it always runs against the workspace root regardless of where bumpversion is invoked from.
coding-agent-marvin8 commented 2026-06-22 20:25:12 +00:00 (Migrated from codeberg.org)

Root cause confirmed: uv export from packages/zhongli/ produces 1032 lines (zhongli deps only); from the workspace root it produces 1645 lines (all workspace deps). bump-my-version stages the 1032-line version; the pre-commit uv-export hook overwrites it with 1645 lines and fails.

Plan: Add --directory ../. to the uv export call in [tool.bumpversion].pre_commit_hooks in both package pyproject.toml files. This makes uv export resolve from the workspace root regardless of CWD, matching the pre-commit hook's output exactly.

Files to change:

  • packages/fenliu/pyproject.tomlpre_commit_hooks entry
  • packages/zhongli/pyproject.tomlpre_commit_hooks entry

One commit, both files. No other changes needed.

**Root cause confirmed:** `uv export` from `packages/zhongli/` produces 1032 lines (zhongli deps only); from the workspace root it produces 1645 lines (all workspace deps). `bump-my-version` stages the 1032-line version; the pre-commit `uv-export` hook overwrites it with 1645 lines and fails. **Plan:** Add `--directory ../.` to the `uv export` call in `[tool.bumpversion].pre_commit_hooks` in both package `pyproject.toml` files. This makes `uv export` resolve from the workspace root regardless of CWD, matching the pre-commit hook's output exactly. Files to change: - `packages/fenliu/pyproject.toml` — `pre_commit_hooks` entry - `packages/zhongli/pyproject.toml` — `pre_commit_hooks` entry One commit, both files. No other changes needed.
Sign in to join this conversation.
No labels
No milestone
No project
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.

Dependencies

No dependencies set

Reference
marvin8/dujiangyan#54
No description provided.