Files
qdrant-client/tests/utils.py
George e823402cf5 new: add b64 encoding function (#1031)
* new: add b64 encoding function

* tests: remove garbage

* refactor base64 function name and params

* manual test for remove iamge inference with base64

* use tempfile

* fix: rename remove_inference->remote_inference

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-07-15 18:41:58 +03:00

26 lines
867 B
Python

import os
from typing import Optional
from pathlib import Path
TESTS_PATH = Path(__file__).parent
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