Description: replace deprecated pkg_resources to importlib.metadata The pkg_resources module is deprecated[1], and obsoleted in the upcoming Python 3.13. This change replaces the use of pkg_resources to obtain the module version from egg info files by importlib.metadata[2], available since Python 3.8. . [1]: https://setuptools.pypa.io/en/latest/pkg_resources.html [2]: https://docs.python.org/3.11/library/importlib.metadata.html#module-importlib.metadata Author: Étienne Mollier Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1083383 Forwarded: https://github.com/sanger-pathogens/Fastaq/pull/85 Last-Update: 2024-10-16 --- This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ Index: fastaq/pyfastaq/__init__.py =================================================================== --- fastaq.orig/pyfastaq/__init__.py +++ fastaq/pyfastaq/__init__.py @@ -1,9 +1,12 @@ -from pkg_resources import get_distribution - try: - __version__ = get_distribution('pyfastaq').version + from importlib.metadata import version + __version__ = version('pyfastaq') except: - __version__ = 'local' + try: + from pkg_resources import get_distribution + __version__ = get_distribution('pyfastaq').version + except: + __version__ = 'local'