Files
qdrant-client/tests/utils.py
George edde944bb3 Drop python 3.8 (#848)
* new: drop python 3.8 support, update type hints

* fix: remove 3.8 from ci

* fix: update type hints

* fix: make netlify use python3.10

* fix: try python3.9 for sphinx

* debug: try updating sphinx

* new: bump ffastembed to 0.4.2

* fix: install numpy<2 for mypy

* fix: install numpy via poetry
2025-01-16 13:38:04 +01:00

22 lines
805 B
Python

import os
from typing import Optional
def read_version() -> tuple[Optional[int], Optional[int], Optional[int], bool]:
"""Read Qdrant's version from env and parse it into a tuple
Returns:
Tuple[Optional[int], Optional[int], Optional[int], bool] - A tuple of (major, minor, patch, dev), where `dev` is a boolean indicating
if it's a development version. If the version is not set or is "dev", returns (None, None, None, True)
"""
version_str = os.getenv("QDRANT_VERSION")
if version_str is None:
return None, None, None, False
if version_str == "dev":
return None, None, None, True
semver = version_str.replace("v", "").split(".")
major, minor, patch = int(semver[0]), int(semver[1]), int(semver[2])
return major, minor, patch, False