NVIDIA-NeMo / NVIDIA-NeMo/nemo-platform

Pre-commit hooks bypass the mise-pinned uv

Open
#1,161 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
78
Forks
23
Avg merge
1d 14h
Merged PRs (30d)
578

Description

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 #1109.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with .pre-commit-config.yaml and compare the five listed hooks with the root Makefile's UV resolution. Read tools/lint/run-ty-check.sh and script/generate-openapi-spec.sh, then reproduce the version-mismatch failure with the affected pre-commit surface. Done means the hooks and root Makefile share one uv resolution path while preserving the documented skip and PATH fallback behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, shell
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.