Skip to content

Commit

Permalink
migrate pkg_resources to importlib
Browse files Browse the repository at this point in the history
  • Loading branch information
benedikt-bartscher committed Jul 9, 2024
1 parent 10c27bd commit 3c449e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions reflex/utils/prerequisites.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import functools
import glob
import importlib
import importlib.metadata
import inspect
import json
import os
Expand All @@ -23,7 +24,6 @@
from typing import Callable, List, Optional

import httpx
import pkg_resources
import typer
from alembic.util.exc import CommandError
from packaging import version
Expand Down Expand Up @@ -78,7 +78,7 @@ def check_latest_package_version(package_name: str):
"""
try:
# Get the latest version from PyPI
current_version = pkg_resources.get_distribution(package_name).version
current_version = importlib.metadata.version(package_name)
url = f"https://pypi.org/pypi/{package_name}/json"
response = httpx.get(url)
latest_version = response.json()["info"]["version"]
Expand Down

0 comments on commit 3c449e2

Please sign in to comment.