mirror of
https://github.com/qdrant/qdrant-client.git
synced 2026-08-05 01:20:55 -05:00
21 lines
565 B
Python
21 lines
565 B
Python
import os
|
|
from typing import Tuple, Optional
|
|
|
|
|
|
def read_version() -> Tuple[Optional[int], Optional[int], Optional[int], bool]:
|
|
"""Read Qdrant's version from env and parse
|
|
|
|
Returns:
|
|
Tuple[int, int, int, bool] - major, minor, patch, dev
|
|
"""
|
|
version = os.getenv("QDRANT_VERSION")
|
|
if version == "dev":
|
|
return None, None, None, True
|
|
|
|
if version is not None:
|
|
semver = version.replace("v", "").split(".")
|
|
|
|
return int(semver[0]), int(semver[1]), int(semver[2]), False
|
|
else:
|
|
return None, None, None, False
|