Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: pkg_resources has been deprecated and changed importlib #2268

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions pymilvus/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@
import subprocess
from contextlib import suppress

from pkg_resources import DistributionNotFound, get_distribution
try:
from importlib.metadata import version, PackageNotFoundError
except ImportError:
# For Python versions < 3.8
from importlib_metadata import version, PackageNotFoundError

log = logging.getLogger(__name__)


__version__ = "0.0.0.dev"


with suppress(DistributionNotFound):
__version__ = get_distribution("pymilvus").version
with suppress(PackageNotFoundError):
__version__ = version("pymilvus")


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