uv export in bump-my-version pre_commit_hooks runs from wrong directory, breaking just release #54
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When
just releaserunsbump-my-version, itspre_commit_hooksexecutesuv exportfrom the package directory (e.g.packages/zhongli/). This exports only that package's dependencies and writes a partialpylock.toml(~1032 lines for zhongli). The workspace-leveluv-exportpre-commit hook then re-runsuv exportfrom the repo root, producing the full workspace-widepylock.toml(~1645 lines). The file is modified, the hook fails, and the version-bump commit is aborted.Fix: add
--directory ../.to theuv exportcall inpre_commit_hooksin bothpackages/fenliu/pyproject.tomlandpackages/zhongli/pyproject.toml, so it always runs against the workspace root regardless of where bumpversion is invoked from.Root cause confirmed:
uv exportfrompackages/zhongli/produces 1032 lines (zhongli deps only); from the workspace root it produces 1645 lines (all workspace deps).bump-my-versionstages the 1032-line version; the pre-commituv-exporthook overwrites it with 1645 lines and fails.Plan: Add
--directory ../.to theuv exportcall in[tool.bumpversion].pre_commit_hooksin both packagepyproject.tomlfiles. This makesuv exportresolve from the workspace root regardless of CWD, matching the pre-commit hook's output exactly.Files to change:
packages/fenliu/pyproject.toml—pre_commit_hooksentrypackages/zhongli/pyproject.toml—pre_commit_hooksentryOne commit, both files. No other changes needed.