From f15771dc8d144af616d7cd6b08e4fa74ff99193f Mon Sep 17 00:00:00 2001 From: danielfromearth Date: Wed, 7 Feb 2024 11:34:22 -0500 Subject: [PATCH] replace deprecated pkg_resources with importlib.resources --- earthaccess/formatters.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/earthaccess/formatters.py b/earthaccess/formatters.py index d37d4e22..f9b5ee2c 100644 --- a/earthaccess/formatters.py +++ b/earthaccess/formatters.py @@ -1,7 +1,7 @@ from typing import Any, List from uuid import uuid4 -import pkg_resources +import importlib.resources STATIC_FILES = ["css/iso_bootstrap4.0.0min.css", "css/styles.css"] @@ -9,7 +9,9 @@ def _load_static_files() -> List[str]: """Load styles""" return [ - pkg_resources.resource_string("earthaccess", fname).decode("utf8") + ( + importlib.resources.files("earthaccess") / fname + ).read_text("utf8") for fname in STATIC_FILES ]