Skip to content

Pre-commit hooks bypass the mise-pinned uv #1161

Description

@marcusds

Follow-up to #1134, which routes the make targets through the uv pinned in mise.toml but leaves the pre-commit surface alone.

Problem

Five hooks in .pre-commit-config.yaml are language: system and resolve uv straight off PATH:

Hook Entry Reaches uv
uv-lock uv lock directly
copyright-fix uv run script/copyright_fixer.py directly
config-reference-docs bash -c 'uv run generate-config-docs && …' directly
ty bash tools/lint/run-ty-check.sh via the script
openapi-generator bash script/generate-openapi-spec.sh via the script

With a global uv outside pyproject.toml's required-version = ">=0.9.14,<0.10.0", uv lock fails:

error: Required uv version `>=0.9.14, <0.10.0` does not match the running version `0.11.4`

That blocks any commit touching pyproject.toml. It's the same failure #1134 fixes for make, on a surface that fires far more often — and the advice it removes from AGENTS.md (downgrade your global uv) is still the only workaround here.

Pre-existing, not a regression from #1134.

Options

  1. Prefix the entries with mise exec --. Smallest diff. Breaks anyone using NMP_SKIP_MISE=1 or without mise, since pre-commit has no equivalent opt-out.
  2. Add a script/uv shim that resolves the mise-managed uv, honours NMP_SKIP_MISE, and falls back to PATH. Pre-commit entries become script/uv lock; the Makefile's UV := collapses onto the same shim, giving both surfaces one resolution path. Preferred.

Out of scope but related

  • packages/models, packages/filesets, packages/nemo_evaluator_sdk and services/core/models have bare-uv Makefiles. None are reachable from the root Makefile — they're run directly as make -C ….
  • The docs-* targets call npm/npx off PATH, bypassing the Node pinned in mise.toml since build(bootstrap): use mise to manage Node.js and pnpm #1109.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions