Skip to content

Commit

Permalink
Remove deprecated usage of pkg_resources in favor of importlib.metadata.
Browse files Browse the repository at this point in the history
  • Loading branch information
tpapaioa authored and JacobCallahan committed Apr 16, 2024
1 parent 32093e5 commit f91b4eb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions broker/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,14 @@ def provider_cmd(ctx, *args, **kwargs): # the actual subcommand
def cli(version):
"""Command-line interface for interacting with providers."""
if version:
from importlib.metadata import version

from packaging.version import Version
import pkg_resources
import requests

broker_version = pkg_resources.get_distribution("broker").version
# check the latest version publish to PyPi
broker_version = version("broker")

# Check against the latest version published to PyPi
try:
latest_version = Version(
requests.get("https://pypi.org/pypi/broker/json", timeout=60).json()["info"][
Expand Down

0 comments on commit f91b4eb

Please sign in to comment.