litellm/litellm/_version.py
joshua-berri f48d837cd2
feat(sdk): build core from an independent packaging manifest (#44340)
* feat(sdk): build core from an independent packaging manifest

* test(sdk): compare rebuilt core payload without generated SBOM identity

* fix(sdk): retain native build configuration in the core sdist

* test(sdk): collect coverage from the core build entry point

* fix(ci): isolate core packaging coverage configuration

* fix(test): identify installed core metadata on Python 3.10

* fix(packaging): preserve Git ignore rules in core staging

* fix(packaging): support source-only core builds

* fix(packaging): reject overlapping SDK distributions

* fix(packaging): align core requirements with current main

---------

Co-authored-by: Joshua Valluru <326636767+joshua-berri@users.noreply.github.com>
2026-10-08 18:40:14 -07:00

22 lines
620 B
Python

from typing import Final
import importlib_metadata
def _installed_version(distribution: str) -> str | None:
try:
return importlib_metadata.version(distribution)
except Exception:
return None
_legacy_version: Final = _installed_version("litellm")
_core_version: Final = _installed_version("litellm-core")
if _legacy_version is not None and _core_version is not None:
raise RuntimeError(
"litellm and litellm-core are both installed and share the litellm namespace. "
"Install them in separate environments."
)
version = _legacy_version or _core_version or "unknown"