[CI] Ignore ruff D209, rejoin the docstrings it split, and silence incompatible-rule warnings (#57212)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Harry Mellor
2026-09-16 10:57:24 -07:00
committed by GitHub
co-authored by Claude Opus 5
parent 1085b64425
commit 651a88c09a
693 changed files with 2088 additions and 4171 deletions
+1 -2
View File
@@ -3,8 +3,7 @@
"""The CLI entrypoints of vLLM.
Note that all future modules must be lazily loaded within main
to avoid certain eager import breakage.
"""
to avoid certain eager import breakage."""
import importlib.metadata
import sys
+1 -2
View File
@@ -295,8 +295,7 @@ class GenerateBaseServing(BaseServing, BeamSearchOnlineMixin):
) -> _T:
"""Wrap a `create_*` coroutine so that, if it raises or returns an
ErrorResponse (i.e. the request never reached the engine), the KV
connector is notified to free any pinned remote-prefill blocks.
"""
connector is notified to free any pinned remote-prefill blocks."""
kv_transfer_params = self.has_kv_connector and request.kv_transfer_params
if not kv_transfer_params or not kv_transfer_params.get("do_remote_prefill"):
return await awaitable
+2 -4
View File
@@ -123,8 +123,7 @@ class OpenAIServingModels:
async def init_static_loras(self):
"""Loads all static LoRA modules.
Raises if any fail to load
"""
Raises if any fail to load"""
if self.static_lora_modules is None:
return
for lora in self.static_lora_modules:
@@ -149,8 +148,7 @@ class OpenAIServingModels:
async def show_available_models(self) -> ModelList:
"""Show available models. This includes the base model and all
adapters.
"""
adapters."""
model_list = await self.registry.show_available_models()
lora_cards = [
ModelCard(
+1 -2
View File
@@ -408,8 +408,7 @@ class ParsableContext(ConversationContext):
def need_builtin_tool_call(self) -> bool:
"""Return true if the last message is a builtin tool call
that the request has enabled.
"""
that the request has enabled."""
last_message = self.response_messages[-1]
if last_message.type != "function_call":
return False
+1 -2
View File
@@ -52,8 +52,7 @@ logger = init_logger(__name__)
def _parse_harmony_format_message(chat_msg: dict) -> Message:
"""Reconstruct a Message from Harmony-format dict,
preserving channel, recipient, and content_type.
"""
preserving channel, recipient, and content_type."""
author_dict = chat_msg["author"]
role = author_dict.get("role")
name = author_dict.get("name")
@@ -117,8 +117,7 @@ def serialize_messages(msgs):
class ResponseRawMessageAndToken(OpenAIBaseModel):
"""Class to show the raw message.
If message / tokens diverge, tokens is the source of truth
"""
If message / tokens diverge, tokens is the source of truth"""
message: str
tokens: list[int]
@@ -44,8 +44,7 @@ class PluginWithoutIOProcessorPlugins(PoolingIOProcessor):
class PluginWithIOProcessorPlugins(PoolingIOProcessor):
"""IO Processor plugins are a feature that allows pre- and post-processing
of the model input and output for pooling models.
"""
of the model input and output for pooling models."""
name = "plugin"
@@ -1,8 +1,7 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
"""Encode/decode utilities for multimodal tensors and field metadata
over JSON/HTTP, used by the disaggregated generate endpoint.
"""
over JSON/HTTP, used by the disaggregated generate endpoint."""
from __future__ import annotations
@@ -126,8 +126,7 @@ def _format_error(err: object) -> str:
def _is_internal_loc_segment(segment: str) -> bool:
"""True if `segment` is a Pydantic-internal wrapper/union-branch
marker rather than a user-meaningful field name or list index.
"""
marker rather than a user-meaningful field name or list index."""
if _BRACKETED_INTERNAL_RE.search(segment):
return True
return segment.lower() in _INTERNAL_LOC_MARKERS
+2 -4
View File
@@ -63,8 +63,7 @@ def _attach_router(app: FastAPI):
@router.post("/v1/load_lora_adapter", dependencies=[Depends(validate_json_request)])
async def load_lora_adapter(request: LoadLoRAAdapterRequest, raw_request: Request):
"""Handle POST /v1/load_lora_adapter: load a LoRA adapter into the
serving engine.
"""
serving engine."""
handler: OpenAIServingModels = models(raw_request)
response = await handler.load_lora_adapter(request)
if isinstance(response, ErrorResponse):
@@ -86,8 +85,7 @@ def _attach_router(app: FastAPI):
request: UnloadLoRAAdapterRequest, raw_request: Request
):
"""Handle POST /v1/unload_lora_adapter: unload a LoRA adapter from
the serving engine.
"""
the serving engine."""
handler: OpenAIServingModels = models(raw_request)
response = await handler.unload_lora_adapter(request)
if isinstance(response, ErrorResponse):
@@ -30,8 +30,7 @@ EndpointFn = Callable[[RequestType, Request], Awaitable[Any]]
def _snapshot_handler_levels() -> list[tuple[logging.Handler, int]]:
"""Snapshot handler levels for loggers that may be affected by third-party
logging configuration side effects (e.g. model_hosting_container_standards
calling configure_root_logger() at import time).
"""
calling configure_root_logger() at import time)."""
loggers = [logging.getLogger(), logging.getLogger("vllm")]
seen: set[int] = set()
snapshot: list[tuple[logging.Handler, int]] = []
@@ -74,8 +73,7 @@ def _attach_router(
model_config: ModelConfig | None = None,
):
"""Register the SageMaker hosting routes (/ping, /invocations) on the
app.
"""
app."""
import model_hosting_container_standards.sagemaker as sagemaker_standards
router = APIRouter()
+2 -4
View File
@@ -33,8 +33,7 @@ def set_default_fingerprint_mode(
custom_value: str | None = None,
) -> None:
"""Configure the fingerprint mode for subsequent ``get_system_fingerprint``
calls. Called once at server startup.
"""
calls. Called once at server startup."""
global _DEFAULT_MODE, _CUSTOM_VALUE
_DEFAULT_MODE = mode
_CUSTOM_VALUE = custom_value
@@ -42,8 +41,7 @@ def set_default_fingerprint_mode(
def get_system_fingerprint(vllm_config: Any) -> str | None:
"""Return the fingerprint for ``vllm_config`` using the mode configured by
``set_default_fingerprint_mode``.
"""
``set_default_fingerprint_mode``."""
return build_system_fingerprint(vllm_config, _DEFAULT_MODE, _CUSTOM_VALUE)
@@ -92,8 +92,7 @@ def asr_inter_chunk_separator(
class SpeechToTextBaseServing(GenerateBaseServing):
"""Base class for speech-to-text operations like transcription and
translation.
"""
translation."""
def __init__(
self,
@@ -427,8 +426,7 @@ class SpeechToTextBaseServing(GenerateBaseServing):
stream_generator_method: Callable[..., AsyncGenerator[str, None]],
) -> T | V | AsyncGenerator[str, None] | ErrorResponse:
"""Base method for speech-to-text operations like transcription and
translation.
"""
translation."""
if request.stream and request.use_beam_search:
return self.create_error_response(
"Streaming is not currently supported with beam search"