COMP: Auto-install pixi pre-commit env for git worktrees (supersedes #6522)#6560
Open
hjmjohnson wants to merge 2 commits into
Open
COMP: Auto-install pixi pre-commit env for git worktrees (supersedes #6522)#6560hjmjohnson wants to merge 2 commits into
hjmjohnson wants to merge 2 commits into
Conversation
The launcher resolves ./.pixi/envs/pre-commit relative to the checkout root, and pixi envs are per-worktree, so kw commit-msg hooks failed in fresh git worktrees. Install the env on first use when pixi is available; otherwise name the command to run.
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Keeps the per-worktree pixi mechanism (per @thewtex on #6522) but removes the fresh-worktree trap:
run-pixi-python.shnow installs thepre-commitpixi env on first use, and the contributing guide documentspixi install -e pre-commitfor worktrees. Supersedes #6522.Details
Utilities/Hooks/run-pixi-python.sh: when./.pixi/envs/pre-commitis missing andpixiis on PATH, runspixi install -e pre-commitbefore resolving the interpreter; if it still cannot resolve, the error message names the exact command to run instead of the bare "Python executable not found".Documentation/docs/contributing/index.md: notes that each additional git worktree needspixi install -e pre-commitonce, since the commit-msg hooks resolve the pixi env relative to the checkout root.language: python, so no system Python is assumed (the Windows concern raised by @blowekamp and @thewtex).Verified locally in a fresh worktree with
.pixi/envs/pre-commitdeleted: the launcher auto-installed the env and both kw commit-msg hooks passed during a realgit commit.