Buckets:
| import os | |
| from contextlib import suppress | |
| import importlib.metadata | |
| from pathlib import Path | |
| def get_cognee_version() -> str: | |
| """Returns either the version of installed cognee package or the one | |
| found in nearby pyproject.toml""" | |
| with suppress(FileNotFoundError, StopIteration): | |
| with open( | |
| os.path.join(Path(__file__).parent.parent, "pyproject.toml"), encoding="utf-8" | |
| ) as pyproject_toml: | |
| version = ( | |
| next(line for line in pyproject_toml if line.startswith("version")) | |
| .split("=")[1] | |
| .strip("'\"\n ") | |
| ) | |
| # Mark the version as a local Cognee library by appending “-dev” | |
| return f"{version}-local" | |
| try: | |
| return importlib.metadata.version("cognee") | |
| except importlib.metadata.PackageNotFoundError: | |
| return "unknown" | |
Xet Storage Details
- Size:
- 874 Bytes
- Xet hash:
- 9d5b266ae072fa13a64bd4b1bcc787c4bec5cb1c5c6658a7cec0f1f0a4b41f5d
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.