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

Pkg resources deprecation #3646

Merged
merged 2 commits into from
Jul 11, 2024
Merged
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
6 changes: 3 additions & 3 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 @@ -61,7 +61,7 @@ class CpuInfo(Base):
def get_web_dir() -> Path:
"""Get the working directory for the next.js commands.

Can be overriden with REFLEX_WEB_WORKDIR.
Can be overridden with REFLEX_WEB_WORKDIR.

Returns:
The working directory.
Expand All @@ -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
Loading