Skip to content

feat: move to uv from pip#275

Merged
arekay-nv merged 2 commits intomainfrom
feat/viraatc-uv
Apr 27, 2026
Merged

feat: move to uv from pip#275
arekay-nv merged 2 commits intomainfrom
feat/viraatc-uv

Conversation

@viraatc
Copy link
Copy Markdown
Collaborator

@viraatc viraatc commented Apr 10, 2026

What does this PR do?

close #274

Type of change

  • Bug fix
  • New feature
  • Documentation update
  • Refactor/cleanup

Related issues

Testing

  • Tests added/updated
  • All tests pass locally
  • Manual testing completed

Checklist

  • Code follows project style
  • Pre-commit hooks pass
  • Documentation updated (if needed)

@viraatc viraatc requested review from a team and Copilot April 10, 2026 00:33
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 10, 2026

MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request migrates the project's dependency management and build system from setuptools and pip to uv. Key changes include updating the pyproject.toml to use uv_build, adding a uv-lock-check pre-commit hook, and revising the README and AGENTS documentation to prioritize uv-based workflows while maintaining backward compatibility for pip. The Dockerfile has also been updated to use uv for faster, reproducible builds. Feedback identifies a critical issue in the Dockerfile where the virtual environment may be shadowed by volume mounts and a pathing error in the build exclusion list within pyproject.toml.

Comment thread scripts/Dockerfile.dev
Comment thread pyproject.toml Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates the project’s Python dependency/build tooling from pip/setuptools-centric workflows to uv, updating local developer setup, Docker dev image, and CI pipelines accordingly.

Changes:

  • Switch pyproject.toml build backend to uv_build and add tool.uv configuration for platform environments and build packaging rules.
  • Update developer workflows and docs (README/AGENTS) to use uv sync / uv run and add a pre-commit hook to enforce uv.lock freshness.
  • Update GitHub Actions to use astral-sh/setup-uv and run tests/audits/pre-commit via uv.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
scripts/Dockerfile.dev Installs uv in the dev container and uses uv sync for dev/test dependencies.
README.md Documents uv as the default dependency manager and adds a pip+venv fallback section.
pyproject.toml Moves build backend to uv_build and configures uv build/data/exclude behavior.
AGENTS.md Updates common commands and dependency guidance to use uv.
.python-version Adds a Python version file intended for tool/CI alignment.
.pre-commit-config.yaml Adds a uv lock --check hook to keep uv.lock in sync.
.github/workflows/test.yml Runs tests and dependency audit via uv.
.github/workflows/pre-commit.yml Runs pre-commit via uv.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/Dockerfile.dev Outdated
Comment thread README.md Outdated
Comment thread .pre-commit-config.yaml
Comment thread .github/workflows/test.yml Outdated
Comment thread pyproject.toml Outdated
Comment thread pyproject.toml Outdated
Comment thread .python-version Outdated
Comment thread .github/workflows/pre-commit.yml
Copilot AI review requested due to automatic review settings April 10, 2026 00:40
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 9 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pyproject.toml
Comment thread .github/workflows/test.yml
Comment thread .github/workflows/pre-commit.yml
Comment thread README.md Outdated
Comment thread AGENTS.md Outdated
Copy link
Copy Markdown
Collaborator Author

@viraatc viraatc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Council — Multi-AI Code Review

Reviewed by: Codex + Claude | Depth: thorough (3001 lines)

Found 5 issues across 4 files.

Comment thread scripts/Dockerfile.dev Outdated
Comment thread pyproject.toml Outdated
Comment thread .pre-commit-config.yaml Outdated
Comment thread scripts/Dockerfile.dev Outdated
Comment thread .github/workflows/test.yml Outdated
@viraatc
Copy link
Copy Markdown
Collaborator Author

viraatc commented Apr 10, 2026

Review Council — Multi-AI Code Review

Reviewed by: Codex + Claude | Depth: thorough (3001 lines, 9 files)

Found 5 issues across 4 files.

🔴 Must Fix (critical)

Issues that will cause build failures or incorrect behavior in production.

# File Line Category Reviewer(s) Summary
1 scripts/Dockerfile.dev 27 bug Codex Missing COPY README.mduv_build needs it for metadata, Docker build fails

🟡 Should Fix (medium)

Real issues that trigger under specific conditions or diverge from project policy.

# File Line Category Reviewer(s) Summary
2 pyproject.toml 16 bug Claude data key may install templates to data scheme instead of package dir — verify with uv build && unzip -l dist/*.whl
3 .pre-commit-config.yaml 70 bug Claude additional_dependencies: [uv] unpinned — should be ["uv==0.7.6"] per project policy

🔵 Consider (low)

Valid improvements that could be follow-ups.

# File Line Category Reviewer(s) Summary
4 scripts/Dockerfile.dev 26 design Claude Misleading "layer caching" comment — COPY src/ busts the cache; consider --no-install-project split
5 .github/workflows/test.yml 21 design Claude Implicit uv sync via uv run — explicit step improves CI diagnostics

Note: 6 issues from the Claude reviewer were dropped during verification — they referenced files not changed in this PR (schema.py, init.py, test_cli.py, test_benchmark_command.py, main.py). All remaining issues were verified against HEAD source files.

Copilot AI review requested due to automatic review settings April 10, 2026 05:55
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .pre-commit-config.yaml Outdated
Comment thread pyproject.toml
Copilot AI review requested due to automatic review settings April 16, 2026 00:02
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 29 out of 30 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/inference_endpoint/openai/Readme.md Outdated
Comment thread docs/async_utils/services/metrics_aggregator/DESIGN.md Outdated
Copy link
Copy Markdown
Collaborator

@arekay-nv arekay-nv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Review by Claude] Reviewed locally against main. Build direction (setuptools → uv_build, lockfile-based CI, pinned uv) is sound, but there's one blocker: the [tool.uv-build] table is silently ignored because the correct name is [tool.uv.build-backend], AND exclude should be source-exclude. Net effect: _server.py (which imports fastapi, not a project dep) ships in the wheel where main intentionally excluded it. Verified by building both ways.

Severity Issue
🔴 [tool.uv-build] + exclude silently ignored → _server.py ships with unresolvable fastapi import
🟡 README primary (uv) path shows bare inference-endpoint after uv sync with no activation or uv run
🟡 Dockerfile.dev: COPY src/ after USER appuser without --chown
🟢 Pre-commit uv-lock-check hook uses language: python to install uv via pip — wasteful
🟢 Redundant index-url = "https://pypi.org/simple" (PyPI is the default)
🟢 23 commits, many fix:-the-previous-fix: — consider squashing before merge

Details on the inline comments below.

Comment thread pyproject.toml Outdated
Comment thread README.md Outdated
Comment thread scripts/Dockerfile.dev Outdated
Comment thread .pre-commit-config.yaml Outdated
Comment thread pyproject.toml Outdated
@viraatc viraatc added type: enhancement Improvement to existing functionality dependencies labels Apr 22, 2026
Migrate project tooling from pip+setuptools to uv+uv_build for
reproducible, lockfile-driven dependency management.

Packaging:
- Switch build backend to uv_build, pinned to uv_build==0.7.6
- Add [tool.uv.build-backend] with source-exclude for livecodebench _server.py
- Pin .python-version to 3.12.11 (matches docker base image)
- Add uv.lock covering Linux x86_64/aarch64 and macOS x86_64/arm64

CI:
- Migrate test, pre-commit workflows from pip to uv with setup-uv action
- Add build smoke-test job (build wheel, install in clean venv, inference-endpoint --help)
- Add uv-lock-check pre-commit hook (language: system) triggered by
  pyproject.toml or uv.lock changes

Docker:
- Dockerfile.dev uses uv from ghcr.io/astral-sh/uv:0.7.6
- UV_PROJECT_ENVIRONMENT=/opt/venv to survive volume mounts
- Two-stage COPY for dependency-layer caching (--no-install-project then full sync)
- --chown on COPY src/ so appuser owns files

Docs:
- README.md: uv primary path, pip+venv backward-compat collapsed into details
- AGENTS.md, CONTRIBUTING.md, DEVELOPMENT.md, CLI_DESIGN.md etc:
  uv run prefix for all command examples
- Per-module READMEs updated consistently

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@arekay-nv arekay-nv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks!

Signed-off-by: Rashid Kaleem <230885705+arekay-nv@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 27, 2026 16:52
@arekay-nv arekay-nv merged commit ede4b82 into main Apr 27, 2026
8 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 27, 2026
@viraatc viraatc deleted the feat/viraatc-uv branch April 27, 2026 18:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

dependencies type: enhancement Improvement to existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Move to uv

4 participants