diff --git a/bagit.py b/bagit.py index a27780c..3db74a3 100755 --- a/bagit.py +++ b/bagit.py @@ -21,7 +21,7 @@ from functools import partial from os.path import abspath, isdir, isfile, join -from pkg_resources import DistributionNotFound, get_distribution +from importlib.metadata import version try: from urllib.parse import urlparse @@ -48,9 +48,8 @@ def find_locale_dir(): LOGGER = logging.getLogger(MODULE_NAME) -try: - VERSION = get_distribution(MODULE_NAME).version -except DistributionNotFound: +VERSION = version(MODULE_NAME) +if not VERSION: VERSION = "0.0.dev0" PROJECT_URL = "https://github.com/LibraryOfCongress/bagit-python"