From 74a5f00e48bea7eb78a3dd9a918cdb4daf8f84dd Mon Sep 17 00:00:00 2001 From: kedhammar Date: Tue, 2 Jul 2024 10:37:01 +0000 Subject: [PATCH] further modernize --- anglerfish/anglerfish.py | 4 ++-- anglerfish/cli.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/anglerfish/anglerfish.py b/anglerfish/anglerfish.py index 9dfe5ea..3d6b582 100755 --- a/anglerfish/anglerfish.py +++ b/anglerfish/anglerfish.py @@ -7,11 +7,11 @@ import sys import uuid from collections import Counter +from importlib.metadata import version as get_version from itertools import groupby import Levenshtein as lev import numpy as np -from setuptools import pkg_resources from .demux.demux import ( Alignment, @@ -46,7 +46,7 @@ def run_demux(args): # Boilerplate multiprocessing.set_start_method("spawn") - version = pkg_resources.get_distribution("bio-anglerfish").version + version = get_version("bio-anglerfish") run_uuid = str(uuid.uuid4()) # Parse arguments diff --git a/anglerfish/cli.py b/anglerfish/cli.py index a7bb20a..2f45438 100644 --- a/anglerfish/cli.py +++ b/anglerfish/cli.py @@ -2,10 +2,10 @@ import datetime as dt import os from enum import Enum +from importlib.metadata import version as get_version from typing import Optional import typer -from setuptools import pkg_resources from typing_extensions import Annotated from .anglerfish import run_demux @@ -23,7 +23,7 @@ class IndexOrientations(str, Enum): def version_callback(value: bool): if value: - print(f'anglerfish {pkg_resources.get_distribution("bio-anglerfish").version}') + print(f'anglerfish {get_version("bio-anglerfish")}') raise typer.Exit()