Skip to content

fix: use venv python in agent-bootstrap to fix PEP 668 environments#1605

Closed
KJyang-0114 wants to merge 3 commits intovllm-project:mainfrom
KJyang-0114:fix/issue-1598-pep668-agent-bootstrap
Closed

fix: use venv python in agent-bootstrap to fix PEP 668 environments#1605
KJyang-0114 wants to merge 3 commits intovllm-project:mainfrom
KJyang-0114:fix/issue-1598-pep668-agent-bootstrap

Conversation

@KJyang-0114
Copy link
Copy Markdown
Contributor

Summary

Fixes #1598.

Problem

make agent-bootstrap calls python3 -m pip install -r tools/agent/requirements.txt directly on the system Python. On Homebrew-managed Python environments that enforce PEP 668, this fails with:

error: externally-managed-environment

Solution

Introduce AGENT_VENV_DIR (default: .venv-agent) and VENV_PYTHON (= .venv-agent/bin/python3).

  • agent-bootstrap: creates the venv if missing, then uses $(VENV_PYTHON) for pip install
  • All downstream targets (agent-validate, agent-scorecard, agent-lint, agent-fast-gate, agent-ci-gate, agent-smoke-local, agent-e2e-affected, agent-feature-gate, agent-report): use $(VENV_PYTHON) consistently

Files changed

  • tools/make/agent.mk: +25 lines / -17 lines

Testing

  • Locally verified: venv created at .venv-agent/bin/python3 and pip install succeeds without PEP 668 error

Risk

Low. Only affects the make agent-* tooling path. The venv is created on-demand and isolated from the system Python.

Rollback

Revert this commit. Contributors who already ran make agent-bootstrap can remove .venv-agent/ manually.

Fixes issue vllm-project#1598.

On Homebrew-managed Python environments that enforce PEP 668
(externally-managed-environment), 'make agent-bootstrap' fails because
it calls 'python3 -m pip install' directly on the system Python.

Fix: introduce AGENT_VENV_DIR (.venv-agent) and VENV_PYTHON.
agent-bootstrap now creates the venv if missing, then uses
$(VENV_PYTHON) (= .venv-agent/bin/python3) for all pip installs
and script invocations.

All downstream targets (agent-validate, agent-scorecard, agent-lint,
agent-fast-gate, agent-ci-gate, agent-smoke-local, agent-e2e-affected,
agent-feature-gate, agent-report) now use $(VENV_PYTHON) consistently.

Contributors on PEP-668-enforcing systems can now run
'make agent-bootstrap' without breaking their system Python.
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 19, 2026

Deploy Preview for vllm-semantic-router ready!

Name Link
🔨 Latest commit 2ff5ffe
🔍 Latest deploy log https://app.netlify.com/projects/vllm-semantic-router/deploys/69bedf240750060008b0fe61
😎 Deploy Preview https://deploy-preview-1605--vllm-semantic-router.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 19, 2026

👥 vLLM Semantic Team Notification

The following members have been identified for the changed files in this PR and have been automatically assigned:

📁 tools

Owners: @yuluo-yx, @rootfs, @Xunzhuo
Files changed:

  • tools/make/agent.mk

vLLM

🎉 Thanks for your contributions!

This comment was automatically generated based on the OWNER files in the repository.

@rootfs
Copy link
Copy Markdown
Collaborator

rootfs commented Mar 20, 2026

@KJyang-0114 can you fix precommit failure? you can run it locally via "make precommit-local`

@rootfs
Copy link
Copy Markdown
Collaborator

rootfs commented Mar 24, 2026

@KJyang-0114 can you fix the pre commit issue and sign the DCO? thanks

@Xunzhuo
Copy link
Copy Markdown
Member

Xunzhuo commented Apr 2, 2026

close this via done in a separated PR, thanks

@Xunzhuo Xunzhuo closed this Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: make agent-bootstrap fails on PEP 668 Homebrew Python environments

4 participants