Skip to content

Commit 1e31969

Browse files
committed
fix pkg_resources api deprecated warning
Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
1 parent 3a1f3d1 commit 1e31969

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Diff for: pymilvus/client/__init__.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@
22
import re
33
import subprocess
44
from contextlib import suppress
5-
6-
from pkg_resources import DistributionNotFound, get_distribution
5+
from importlib.metadata import version, PackageNotFoundError
76

87
log = logging.getLogger(__name__)
98

109

1110
__version__ = "0.0.0.dev"
1211

1312

14-
with suppress(DistributionNotFound):
15-
__version__ = get_distribution("pymilvus").version
13+
with suppress(PackageNotFoundError):
14+
__version__ = version("pymilvus")
1615

1716

1817
def get_commit(version: str = "", short: bool = True) -> str:

0 commit comments

Comments
 (0)