mdshw5 / pyfaidx

Efficient pythonic random access to fasta subsequences
https://pypi.python.org/pypi/pyfaidx
Other
449 stars 75 forks source link

DeprecationWarning: pkg_resources #212

Closed antonylebechec closed 1 year ago

antonylebechec commented 1 year ago

Hi,

A deprecated warning appear when using pyfaidx:

================== warnings summary ===================
../../python/current/lib/python3.10/site-packages/pyfaidx/__init__.py:21
  /tools/python/current/lib/python3.10/site-packages/pyfaidx/__init__.py:21: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
    from pkg_resources import get_distribution

It seems to be this code location: https://github.com/mdshw5/pyfaidx/blob/master/pyfaidx/__init__.py#L21

As mentioned in the provided URL:

Use of pkg_resources is deprecated in favor of importlib.resources, importlib.metadata and their backports (importlib_resources, importlib_metadata). Some useful APIs are also provided by packaging (e.g. requirements and version parsing). Users should refrain from new usage of pkg_resources and should work to port to importlib-based solutions.

Python 3.10.12 | packaged by conda-forge | (main, Jun 23 2023, 22:40:32) [GCC 12.3.0] on linux SetupTools 68.2.2

mdshw5 commented 1 year ago

Thanks @antonylebechec for reporting this. It looks like a simple solution and I will build a new point release to implement.

mdshw5 commented 1 year ago

New version is released and should be up on PyPI in a few minutes. @antonylebechec: when you have time can you please confirm this issue is fixed?