mirror of
https://github.com/lancedb/lancedb.git
synced 2026-01-10 05:42:58 +00:00
chore: replace semver dependency with packaging (#1311)
Fixes #1296 per title. See https://github.com/lancedb/lancedb/pull/1298#discussion_r1603931457 Cc @wjones127 --------- Co-authored-by: Will Jones <willjones127@gmail.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import os
|
||||
import semver
|
||||
from packaging.version import Version
|
||||
from functools import cached_property
|
||||
from typing import Union
|
||||
|
||||
@@ -44,9 +44,8 @@ class CohereReranker(Reranker):
|
||||
def _client(self):
|
||||
cohere = attempt_import_or_raise("cohere")
|
||||
# ensure version is at least 0.5.0
|
||||
if (
|
||||
hasattr(cohere, "__version__")
|
||||
and semver.compare(cohere.__version__, "5.0.0") < 0
|
||||
if hasattr(cohere, "__version__") and Version(cohere.__version__) < Version(
|
||||
"0.5.0"
|
||||
):
|
||||
raise ValueError(
|
||||
f"cohere version must be at least 0.5.0, found {cohere.__version__}"
|
||||
|
||||
Reference in New Issue
Block a user