Convert formatting to use ruff instead of yapf + isort (#26247)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
Harry Mellor
2025-10-05 15:06:22 +01:00
committed by GitHub
parent 17edd8a807
commit d6953beb91
1508 changed files with 115244 additions and 94146 deletions

View File

@@ -8,7 +8,7 @@ import vllm.envs as envs
logger = logging.getLogger(__name__)
DEFAULT_PLUGINS_GROUP = 'vllm.general_plugins'
DEFAULT_PLUGINS_GROUP = "vllm.general_plugins"
# make sure one process only loads plugins once
plugins_loaded = False
@@ -16,6 +16,7 @@ plugins_loaded = False
def load_plugins_by_group(group: str) -> dict[str, Callable[[], Any]]:
import sys
if sys.version_info < (3, 10):
from importlib_metadata import entry_points
else:
@@ -29,7 +30,7 @@ def load_plugins_by_group(group: str) -> dict[str, Callable[[], Any]]:
return {}
# Check if the only discovered plugin is the default one
is_default_group = (group == DEFAULT_PLUGINS_GROUP)
is_default_group = group == DEFAULT_PLUGINS_GROUP
# Use INFO for non-default groups and DEBUG for the default group
log_level = logger.debug if is_default_group else logger.info
@@ -38,8 +39,10 @@ def load_plugins_by_group(group: str) -> dict[str, Callable[[], Any]]:
log_level("- %s -> %s", plugin.name, plugin.value)
if allowed_plugins is None:
log_level("All plugins in this group will be loaded. "
"Set `VLLM_PLUGINS` to control which plugins to load.")
log_level(
"All plugins in this group will be loaded. "
"Set `VLLM_PLUGINS` to control which plugins to load."
)
plugins = dict[str, Callable[[], Any]]()
for plugin in discovered_plugins: