Skip to content

Commit

Permalink
replace deprecated pkg_resources with importlib.resources
Browse files Browse the repository at this point in the history
  • Loading branch information
danielfromearth committed Feb 7, 2024
1 parent dd61f23 commit f15771d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions earthaccess/formatters.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
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"]

Check failure on line 6 in earthaccess/formatters.py

View workflow job for this annotation

GitHub Actions / check-with-ruff

Ruff (I001)

earthaccess/formatters.py:1:1: I001 Import block is un-sorted or un-formatted


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
]

Expand Down

0 comments on commit f15771d

Please sign in to comment.