File tree Expand file tree Collapse file tree 5 files changed +121
-0
lines changed Expand file tree Collapse file tree 5 files changed +121
-0
lines changed Original file line number Diff line number Diff line change
1
+ # doc: https://github.com/pytorch/test-infra/blob/main/tools/stronghold/docs/bc_linter_config.md
2
+ version : 1
3
+ paths :
4
+ # We temporarily disable globally, and will only enable with `annotations.include`
5
+ # include:
6
+ # - "vllm/v1/attetion/*.py"
7
+ # - "vllm/v1/core/*.py"
8
+ exclude :
9
+ - " **/*.py"
10
+
11
+ scan :
12
+ functions : true # check free functions and methods
13
+ classes : true # check classes/dataclasses
14
+ public_only : true # ignore names starting with "_" at any level
15
+
16
+ annotations :
17
+ include : # decorators that force‑include a symbol
18
+ - name : " bc_linter_include" # matched by simple name or dotted suffix
19
+ propagate_to_members : false # for classes, include methods/inner classes
20
+ exclude : # decorators that force‑exclude a symbol
21
+ - name : " bc_linter_skip" # matched by simple name or dotted suffix
22
+ propagate_to_members : true # for classes, exclude methods/inner classes
23
+
24
+ excluded_violations : [] # e.g. ["ParameterRenamed", "FieldTypeChanged"]
Original file line number Diff line number Diff line change
1
+ name : BC Lint
2
+
3
+ on :
4
+ pull_request :
5
+ types :
6
+ - opened
7
+ - synchronize
8
+ - reopened
9
+
10
+ jobs :
11
+ bc_lint :
12
+ if : github.repository_owner == 'vllm-project'
13
+ runs-on : ubuntu-latest
14
+ steps :
15
+ - name : Run BC Lint Action
16
+ uses : pytorch/test-infra/.github/actions/bc-lint@main
17
+ with :
18
+ repo : ${{ github.event.pull_request.head.repo.full_name }}
19
+ base_sha : ${{ github.event.pull_request.base.sha }}
20
+ head_sha : ${{ github.event.pull_request.head.sha }}
21
+ suppression : ${{ contains(github.event.pull_request.labels.*.name, 'suppress-bc-linter') }}
22
+ docs_link : ' https://github.com/pytorch/test-infra/wiki/BC-Linter'
23
+ config_dir : .github
24
+
25
+ concurrency :
26
+ group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
27
+ cancel-in-progress : true
Original file line number Diff line number Diff line change 14
14
import vllm .env_override # noqa: F401
15
15
16
16
MODULE_ATTRS = {
17
+ "bc_linter_skip" : "._bc_linter:bc_linter_skip" ,
18
+ "bc_linter_include" : "._bc_linter:bc_linter_include" ,
17
19
"AsyncEngineArgs" : ".engine.arg_utils:AsyncEngineArgs" ,
18
20
"EngineArgs" : ".engine.arg_utils:EngineArgs" ,
19
21
"AsyncLLMEngine" : ".engine.async_llm_engine:AsyncLLMEngine" ,
54
56
ScoringRequestOutput )
55
57
from vllm .pooling_params import PoolingParams
56
58
from vllm .sampling_params import SamplingParams
59
+
60
+ from ._bc_linter import bc_linter_include , bc_linter_skip
57
61
else :
58
62
59
63
def __getattr__ (name : str ) -> typing .Any :
@@ -70,6 +74,8 @@ def __getattr__(name: str) -> typing.Any:
70
74
71
75
__all__ = [
72
76
"__version__" ,
77
+ "bc_linter_skip" ,
78
+ "bc_linter_include" ,
73
79
"__version_tuple__" ,
74
80
"LLM" ,
75
81
"ModelRegistry" ,
Original file line number Diff line number Diff line change
1
+ # SPDX-License-Identifier: Apache-2.0
2
+ # SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3
+ # vllm/_bc_linter.py
4
+ from __future__ import annotations
5
+
6
+ from typing import Any , Callable , TypeVar , overload
7
+
8
+ T = TypeVar ("T" )
9
+
10
+
11
+ @overload
12
+ def bc_linter_skip (obj : T ) -> T :
13
+ ...
14
+
15
+
16
+ @overload
17
+ def bc_linter_skip (* , reason : str | None = ...) -> Callable [[T ], T ]:
18
+ ...
19
+
20
+
21
+ def bc_linter_skip (obj : Any = None , * , reason : str | None = None ):
22
+ """
23
+ No-op decorator to mark symbols/files for BC-linter suppression.
24
+
25
+ Usage:
26
+ @bc_linter_skip
27
+ def legacy_api(...): ...
28
+ """
29
+
30
+ def _wrap (x : T ) -> T :
31
+ return x
32
+
33
+ return _wrap if obj is None else obj
34
+
35
+
36
+ @overload
37
+ def bc_linter_include (obj : T ) -> T :
38
+ ...
39
+
40
+
41
+ @overload
42
+ def bc_linter_include (* , reason : str | None = ...) -> Callable [[T ], T ]:
43
+ ...
44
+
45
+
46
+ def bc_linter_include (obj : Any = None , * , reason : str | None = None ):
47
+ """
48
+ Usage:
49
+ @bc_linter_include
50
+ def public_api(...): ...
51
+ """
52
+
53
+ def _wrap (x : T ) -> T :
54
+ return x
55
+
56
+ return _wrap if obj is None else obj
57
+
58
+
59
+ __all__ = ["bc_linter_skip" , "bc_linter_include" ]
Original file line number Diff line number Diff line change 6
6
from dataclasses import dataclass
7
7
from typing import TYPE_CHECKING , Optional
8
8
9
+ from vllm import bc_linter_include
10
+
9
11
if TYPE_CHECKING :
10
12
import numpy as np
11
13
import numpy .typing as npt
19
21
from vllm .v1 .request import Request
20
22
21
23
24
+ @bc_linter_include
22
25
@dataclass
23
26
class NewRequestData :
24
27
@@ -80,6 +83,7 @@ def anon_repr(self):
80
83
")" )
81
84
82
85
86
+ @bc_linter_include
83
87
@dataclass
84
88
class CachedRequestData :
85
89
@@ -109,6 +113,7 @@ def make_empty(cls) -> CachedRequestData:
109
113
)
110
114
111
115
116
+ @bc_linter_include
112
117
@dataclass
113
118
class SchedulerOutput :
114
119
You can’t perform that action at this time.
0 commit comments