Repository navigation
🔨🤖 Install pre-commit as a uv tool so the git hook works in every worktree - #9908
Conversation
|
@mergify queue |
Merge Queue Status🛑 Queue command has been cancelled |
GitHK
left a comment
There was a problem hiding this comment.
I see hooks go in user space now
@GitHK no as explained in the description, only pre-commit goes in user space. the hooks are attache into the repository (shared by all its worktrees actually). |
correct I meant to say the library |
…tree Git worktrees share .git/hooks, and `pre-commit install` writes the path of the Python that ran it into the hook. With pre-commit in .venv, the hook pointed to the .venv of whichever worktree ran `make devenv` (or `pre-commit install`) last, and commits failed in every worktree once that .venv was removed or recreated. - `make devenv` installs pre-commit as a uv tool, removes it from .venv and installs the hook from the uv tool - `make clean-hooks` removes the hook from the common git dir, which also works inside a worktree - requirements/devenv.txt: drop pre-commit; */requirements/_tools.txt regenerated without --upgrade, so they only lose pre-commit and the packages only it needed Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
CI installs with `uv pip sync requirements/ci.txt`, which installs only what the lockfiles list. pytest-simcore needs filelock, but the lockfiles only had it through pre-commit (virtualenv) in _tools.txt, so removing pre-commit broke every unit-test job. settings-library had pyyaml the same way and loads pytest_simcore.environment_configs, which imports yaml. _test.txt regenerated with `make reqs upgrade=filelock` (settings-library: `upgrade="filelock pyyaml"`); no other pin changes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Track Renovate's uv constraint with the shared uv group, enable action digest pinning, remove the director Python exemption, and use explicit Valkey patch tags without changing image digests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
0101f1a to
05e22de
Compare
🛑 The queue request has been cancelled: new commits were pushedDetails@sanderegg pushed to this pull request after |
|
|
@mergify queue |
Merge Queue Status
Waiting for
All conditions
|



Important
After pulling, run
make devenvonce in any worktree.What do these changes do?
Git worktrees share one pre-commit hook, and it pointed to the
.venvof the worktree that installed it last. Commits failed in all worktrees once that.venvwas gone.make devenvinstalls pre-commit as a uv tool and installs the hook from it.requirements/devenv.txtand from the_tools.txtfiles. They were regenerated without--upgrade, so versions stay the same.make clean-hooksalso works inside a worktree.filelock, which pytest-simcore needs, is added to the test requirements. The lockfiles only had it through pre-commit (andpyyamlin settings-library).Notes:
.pre-commit-config.yaml.uv tool upgrade pre-commitormake devenv.Bonus: Renovate and dependency tracking
Renovate now tracks its own pinned uv constraint in the shared uv update group, with a regression test, and enables GitHub Actions SHA pinning through
helpers:pinGitHubActionDigests(Renovate will propose the workflow conversions). The obsolete director frozen-service rule and Python-test exemption are removed. All five Valkey Compose references use the explicit7.2.14tag while retaining their existing image digest, so the deployed image is unchanged. Debian tracking/migration is not included. Validation: 9 focused Python/uv tests, pre-commit hooks (including Compose validation), and Pylint passed.Related issue/s
Split out of #9850.
How to test
Run
make devenv, thensed -n 6p .git/hooks/pre-commit. It prints the Python of the uv tool, not of.venv. Commit from a second worktree.Dev-ops
Developer tooling only.
Assisted-by: GitHub Copilot
Before and after
Before: the shared hook runs the
.venvof the worktree that ranmake devenvlast.After: the hook runs the per-user uv tool, whatever the worktree.