Skip to content

Commit

Permalink
Not using deprecated 'pkg_resources' package.
Browse files Browse the repository at this point in the history
  • Loading branch information
elongl committed Jul 17, 2024
1 parent 6065222 commit 1b873fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
import webbrowser
from typing import Optional, Tuple

import pkg_resources

from elementary.clients.azure.client import AzureClient
from elementary.clients.gcs.client import GCSClient
from elementary.clients.s3.client import S3Client
Expand Down Expand Up @@ -70,7 +68,7 @@ def generate_report(
exclude_elementary_models=exclude_elementary_models,
project_name=project_name,
)
template_html_path = pkg_resources.resource_filename(__name__, "index.html")
template_html_path = os.path.join(os.path.dirname(__file__), "index.html")

with open(template_html_path, "r", encoding="utf-8") as template_html_file:
template_html_code = template_html_file.read()
Expand Down
4 changes: 2 additions & 2 deletions elementary/utils/package.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import importlib.metadata
from typing import Optional

import pkg_resources
import requests

_PYPI_URL = "https://pypi.org/pypi/elementary-data/json"


def get_package_version() -> str:
return pkg_resources.get_distribution("elementary-data").version
return importlib.metadata.version("elementary-data")


def get_latest_package_version() -> Optional[str]:
Expand Down

0 comments on commit 1b873fc

Please sign in to comment.