"vllm/model_executor/models/solar.py" did not exist on "64172a976c8d975b3aec946f1675716d2532d94f"
_bc_linter.py 1.08 KB
Newer Older
1
2
3
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
# vllm/_bc_linter.py
4
5
from collections.abc import Callable
from typing import Any, TypeVar, overload
6
7
8
9
10

T = TypeVar("T")


@overload
11
def bc_linter_skip(obj: T) -> T: ...
12
13
14


@overload
15
def bc_linter_skip(*, reason: str | None = ...) -> Callable[[T], T]: ...
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33


def bc_linter_skip(obj: Any = None, *, reason: str | None = None):
    """
    No-op decorator to mark symbols/files for BC-linter suppression.

    Usage:
        @bc_linter_skip
        def legacy_api(...): ...
    """

    def _wrap(x: T) -> T:
        return x

    return _wrap if obj is None else obj


@overload
34
def bc_linter_include(obj: T) -> T: ...
35
36
37


@overload
38
def bc_linter_include(*, reason: str | None = ...) -> Callable[[T], T]: ...
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54


def bc_linter_include(obj: Any = None, *, reason: str | None = None):
    """
    Usage:
        @bc_linter_include
        def public_api(...): ...
    """

    def _wrap(x: T) -> T:
        return x

    return _wrap if obj is None else obj


__all__ = ["bc_linter_skip", "bc_linter_include"]