Fix TYPE_CHECKING stub defaults in envs.py to match actual runtime defaults#35645
Conversation
…faults The TYPE_CHECKING block in envs.py provides stubs for IDE autocompletion and type-checking, but three variables had default values inconsistent with their actual lambda defaults in the environment variables dict: - VLLM_USAGE_SOURCE: stub said "" but lambda defaults to "production" - VLLM_CPU_OMP_THREADS_BIND: stub said "" but lambda defaults to "auto" - VLLM_USE_BYTECODE_HOOK: stub said False but lambda defaults to True (via "1") Update the stubs to match the runtime behavior so that type checkers and IDE tooling reflect the correct default values. Made-with: Cursor
|
👋 Hi! Thank you for contributing to the vLLM project. 💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels. Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run You ask your reviewers to trigger select CI tests on top of Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging. To run CI, PR reviewers can either: Add If you have any questions, please reach out to us on Slack at https://slack.vllm.ai. 🚀 |
There was a problem hiding this comment.
Code Review
This pull request correctly aligns the default values of several environment variable stubs within the TYPE_CHECKING block in vllm/envs.py with their actual runtime defaults. The changes for VLLM_USAGE_SOURCE, VLLM_CPU_OMP_THREADS_BIND, and VLLM_USE_BYTECODE_HOOK are accurate and improve the developer experience by ensuring static analysis tools and IDEs reflect the correct behavior. The changes are well-contained and have no impact on runtime logic. I have no further comments.
|
@yewentao256 Hi! Could you take a look at this PR when you get a chance? It fixes inconsistencies between the |
yewentao256
left a comment
There was a problem hiding this comment.
LGTM, thanks for the work!
…faults (vllm-project#35645) Signed-off-by: wendyliu235 <wenjun.liu@intel.com>
Summary
The
TYPE_CHECKINGblock invllm/envs.pyprovides stubs used by IDE tools and static type-checkers (e.g. mypy/pyright). However, three variables had stub default values that differed from the actual defaults returned by their runtime lambdas in theenvironment_variablesdict:VLLM_USAGE_SOURCE"""production"VLLM_CPU_OMP_THREADS_BIND"""auto"VLLM_USE_BYTECODE_HOOKFalseTrue(fromint("1"))Note:
VLLM_MAIN_CUDA_VERSIONlooks inconsistent at first glance (str = "12.9"vsos.getenv(..., "").lower() or "12.9"), but the effective default is the same"12.9"and does not need fixing.Changes
Updated the three stub defaults to match the actual runtime behavior so that IDEs, type-checkers, and documentation reflect correct values.
Test Plan
grepthat stub values now match lambda defaults.