[Misc] Add deprecated environment variable utilities#33677
[Misc] Add deprecated environment variable utilities#33677vllm-bot merged 2 commits intovllm-project:mainfrom
Conversation
There was a problem hiding this comment.
Code Review
The pull request introduces general-purpose utilities for handling deprecated environment variables, which is a valuable addition for managing feature deprecation in the codebase. The new functions get_deprecated_env_var and set_from_deprecated_env_var provide a centralized mechanism for issuing warnings and facilitating transitions. However, there are critical issues in the type handling and conversion logic within these functions that need to be addressed to ensure correct behavior.
375fef3 to
b93b894
Compare
hmellor
left a comment
There was a problem hiding this comment.
Thanks for this PR! Could the utilities please be moved to the config utils? The only place we should be using these is when we are forwarding environment variables to the config fields that replace them
3f42db1 to
ca21c2b
Compare
|
@hmellor updated. |
|
This pull request has merge conflicts that must be resolved before it can be |
ca21c2b to
3d607f5
Compare
|
Hi @carlory, the pre-commit checks have failed. Please run: uv pip install pre-commit
pre-commit install
pre-commit run --all-filesThen, commit the changes and push to your branch. For future commits, Tip Is
|
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: carlory <baofa.fan@daocloud.io>
3d607f5 to
b3e4b78
Compare
hmellor
left a comment
There was a problem hiding this comment.
LGTM! Thanks for adding back these utilities
Purpose
Add general-purpose utilities for handling deprecated environment variables with deprecation warnings. These functions can be reused across the codebase when deprecating environment variables in favor of CLI arguments or config options.
This addresses the suggestion from @hmellor in PR #33536 to add general versions of the removed
_get_from_env_if_setand_set_from_env_if_setmethods toutils.pyfor reuse in future deprecations.New functions added to
vllm/utils/system_utils.py:get_deprecated_env_var(): Get value from deprecated env var with warningset_from_deprecated_env_var(): Set object field from deprecated env var with optional type conversion (bool/int)Usage example:
Test Plan
pre-commit run --files vllm/utils/system_utils.pypre-commit run --hook-stage manual mypy-3.12 --files vllm/utils/system_utils.pypython -c "from vllm.utils.system_utils import get_deprecated_env_var, set_from_deprecated_env_var; print('OK')"Test Result
All pre-commit hooks pass:
Import verification: