Skip to content

Commit

Permalink
Replace usage of pkg_resources API
Browse files Browse the repository at this point in the history
Try to use importlib from python > 3.8: https://docs.python.org/3/library/importlib.metadata.html#module-importlib.metadata

Otherwise use the installed backport package: https://pypi.org/project/importlib-metadata/

Fix for mdshw5#212
  • Loading branch information
mdshw5 authored Sep 22, 2023
1 parent bbe7425 commit 199000d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pyfaidx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
from os.path import getmtime
from tempfile import TemporaryFile
from threading import Lock
from pkg_resources import get_distribution

try:
from importlib.metadata import version
except ImportError: #python < 3.8
from importlib_metadata import version

from six import PY2, PY3, integer_types, string_types
from six.moves import zip_longest
Expand All @@ -33,7 +37,7 @@
except ImportError:
fsspec = None

__version__ = get_distribution("pyfaidx").version
__version__ = version("pyfaidx")

if sys.version_info > (3, ):
buffer = memoryview
Expand Down

0 comments on commit 199000d

Please sign in to comment.