Skip to content

chore: Replace remaining bare uv commands with $(UV_BIN) in Makefile#4123

Merged
jonpspri merged 1 commit intomainfrom
fix/issue-3946-replace-bare-uv-commands
Apr 11, 2026
Merged

chore: Replace remaining bare uv commands with $(UV_BIN) in Makefile#4123
jonpspri merged 1 commit intomainfrom
fix/issue-3946-replace-bare-uv-commands

Conversation

@MohanLaksh
Copy link
Copy Markdown
Collaborator

Problem

PR #3886 introduced $(UV_BIN) to resolve uv from PATH or ~/.local/bin/uv and converted 16 call sites. However, ~70 bare uv commands remained in the Makefile, all subject to the same "No such file or directory" failure when uv isn't on PATH inside an activated venv or in certain installation layouts.

Impact: Build failures across multiple make targets when uv is not directly accessible on PATH.

Closes #3946

Root Cause

When PR #3886 added the UV_BIN variable to fix uv resolution issues, it only converted the 16 most problematic call sites. The remaining ~70 bare uv commands (tool install, run, pip, build) were not systematically converted at that time.

Solution

Mechanical find-and-replace of all remaining bare uv commands with $(UV_BIN), following the established pattern from PR #3886.

Why this approach: Simple, consistent with existing pattern, no logic changes required, maintains backward compatibility with all existing developer setups.

Categories replaced:

  • uv tool install$(UV_BIN) tool install (highest priority - runs outside venv)
  • uv run$(UV_BIN) run
  • uv pip$(UV_BIN) pip
  • uv build$(UV_BIN) build

Implementation Details

  • uv tool install: 2 instances (lines 4730, 4735)

    • sonar-deps-podman target
    • sonar-deps-docker target
    • Highest priority as these run outside any venv
  • uv run: 31 instances

    • Test targets: test-mcp-cli, test-mcp-rbac, test-mcp-access-matrix, etc.
    • Demo scripts: demo-a2a-agent-auth targets
    • Formatter/linter targets: black, isort, pylint, ruff
  • uv pip: 35 instances

    • Package installations: grpcio-tools, playwright, mutmut, handsdown, code2flow, etc.
    • Dev dependencies: pytest-xdist, radon, yamllint, tomlcheck, etc.
    • Special cases: devpi, local PyPI, fuzzing dependencies
  • uv build: 3 instances (lines 4904, 4920, 4932)

    • dist target (full build)
    • wheel target (wheel only)
    • sdist target (source distribution only)

Total: 71 replacements

Testing

Syntax validation: Verified make targets parse correctly

make -n sonar-deps-podman  # UV_BIN expanded correctly

Pattern verification: Confirmed all bare uv commands replaced

# Only comments and target dependencies remain (no command invocations)
grep -n " uv " Makefile | grep -v "UV_BIN" | grep -v "^[0-9]*:#"

Category breakdown verified:

  • uv tool install: 2 ✅
  • uv run: 31 ✅
  • uv pip: 35 ✅
  • uv build: 3 ✅
  • Total: 71

Git diff verified: 71 deletions, 71 additions (1:1 replacement)

Breaking Changes

None - this maintains backward compatibility with all existing developer setups.

Checklist

@MohanLaksh MohanLaksh added release-fix Critical bugfix required for the release ready Validated, ready-to-work-on items labels Apr 10, 2026
@jonpspri jonpspri force-pushed the fix/issue-3946-replace-bare-uv-commands branch 2 times, most recently from 2e76a07 to 0b14b4c Compare April 11, 2026 00:55
Replaced 71 bare uv commands with $(UV_BIN) for consistent resolution across different installation layouts, following the pattern established in PR #3886.

Changes by category:
- uv tool install: 2 instances (highest priority - runs outside venv)
- uv run: 31 instances
- uv pip: 35 instances
- uv build: 3 instances

This ensures uv is correctly resolved from PATH or ~/.local/bin/uv in all make targets, preventing "No such file or directory" failures.

Closes #3946

Signed-off-by: Mohan Lakshmaiah <mohan.economist@gmail.com>
@jonpspri jonpspri force-pushed the fix/issue-3946-replace-bare-uv-commands branch from 0b14b4c to 50c9009 Compare April 11, 2026 01:08
@jonpspri jonpspri merged commit d31c9f8 into main Apr 11, 2026
17 checks passed
@jonpspri jonpspri deleted the fix/issue-3946-replace-bare-uv-commands branch April 11, 2026 01:17
claudia-gray pushed a commit that referenced this pull request Apr 13, 2026
…4123)

Replaced 71 bare uv commands with $(UV_BIN) for consistent resolution across different installation layouts, following the pattern established in PR #3886.

Changes by category:
- uv tool install: 2 instances (highest priority - runs outside venv)
- uv run: 31 instances
- uv pip: 35 instances
- uv build: 3 instances

This ensures uv is correctly resolved from PATH or ~/.local/bin/uv in all make targets, preventing "No such file or directory" failures.

Closes #3946

Signed-off-by: Mohan Lakshmaiah <mohan.economist@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready Validated, ready-to-work-on items release-fix Critical bugfix required for the release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CHORE]: Replace remaining bare uv commands with $(UV_BIN) in Makefile

2 participants