Skip to content

Commit

Permalink
Remove use of pkg_resource
Browse files Browse the repository at this point in the history
This import is causing warning messages in all programs that import this
library.
  • Loading branch information
JHolba committed Oct 20, 2023
1 parent d9fc6b7 commit 1f70533
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
import pkg_resources
import datetime
from importlib import metadata

# -- Project information -----------------------------------------------------

Expand All @@ -26,7 +26,7 @@
# The short X.Y version
import ecl2df # noqa

release = pkg_resources.get_distribution("ecl2df").version
release = metadata.version("ecl2df")
version = release

# -- General configuration ---------------------------------------------------
Expand Down
8 changes: 4 additions & 4 deletions ecl2df/hook_implementations/jobs.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import importlib
from pathlib import Path

from pkg_resources import resource_filename
import pkgutil
from os.path import dirname

try:
from ert.shared.plugins.plugin_manager import hook_implementation
Expand All @@ -19,7 +18,8 @@ def decorator(func):


def _get_jobs_from_directory(directory):
resource_directory = Path(resource_filename("ecl2df", directory))
ert_shared_loader = pkgutil.get_loader("ecl2df")
resource_directory = dirname(ert_shared_loader.get_filename()) + directory

all_files = [
resource_directory / filename
Expand Down

0 comments on commit 1f70533

Please sign in to comment.