version.py 1.39 KB
Newer Older
1

2
try:
maxiao1's avatar
maxiao1 committed
3
4
5
6
7
    __version__ = "0.9.2"
    __version_tuple__ = (0, 9, 2)
    __hcu_version__ = f'0.9.2+das.opt1.rc2.dtk25041' 
    
    from vllm.version import __version__, __version_tuple__, __hcu_version__
8
except Exception as e:
9
10
    import warnings

maxiao1's avatar
maxiao1 committed
11
    warnings.warn(f"Failed to read commit hash:\n + str(e)",
12
13
                  RuntimeWarning,
                  stacklevel=2)
14
15
    __version__ = "dev"
    __version_tuple__ = (0, 0, __version__)
maxiao1's avatar
maxiao1 committed
16
17
    
    
18
def _prev_minor_version_was(version_str):
maxiao1's avatar
maxiao1 committed
19
    '''Check whether a given version matches the previous minor version.
20
21
22
23
24
25
26

    Return True if version_str matches the previous minor version.

    For example - return True if the current version if 0.7.4 and the
    supplied version_str is '0.6'.

    Used for --show-hidden-metrics-for-version.
maxiao1's avatar
maxiao1 committed
27
    '''
28
29
30
31
32
    # Match anything if this is a dev tree
    if __version_tuple__[0:2] == (0, 0):
        return True

    # Note - this won't do the right thing when we release 1.0!
maxiao1's avatar
maxiao1 committed
33
    # assert __version_tuple__[0] == 0
34
    assert isinstance(__version_tuple__[1], int)
35
    return version_str == f"{__version_tuple__[0]}.{__version_tuple__[1] - 1}"
36
37
38


def _prev_minor_version():
maxiao1's avatar
maxiao1 committed
39
    '''For the purpose of testing, return a previous minor version number.'''
40
41
42
    # In dev tree, this will return "0.-1", but that will work fine"
    assert isinstance(__version_tuple__[1], int)
    return f"{__version_tuple__[0]}.{__version_tuple__[1] - 1}"