mirror of
https://github.com/imartinez/privateGPT.git
synced 2026-07-17 01:48:03 +00:00
* chore: fix uv lock after update (cherry picked from commit29137d673e) * chore(docs): fix postupdate (cherry picked from commit 3a6fb0179a1183ed60b8ca28bdff248aa1358df4) * chore(docs): use node 24 (cherry picked from commit3c30538a32) * chore(build): copy version.txt (cherry picked from commitbb1ea2f1d6)
16 lines
486 B
Python
16 lines
486 B
Python
from __future__ import annotations
|
|
|
|
from importlib.metadata import PackageNotFoundError, version
|
|
from pathlib import Path
|
|
|
|
|
|
def get_version() -> str:
|
|
try:
|
|
return version("private-gpt")
|
|
except PackageNotFoundError:
|
|
version_file = Path(__file__).resolve().parents[2] / "version.txt"
|
|
try:
|
|
return version_file.read_text(encoding="utf-8").strip()
|
|
except OSError as exc:
|
|
raise ImportError("Version metadata not found") from exc
|