File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121from functools import partial
2222from os .path import abspath , isdir , isfile , join
2323
24- from pkg_resources import DistributionNotFound , get_distribution
24+ try :
25+ from importlib .metadata import version
26+ except ImportError :
27+ from importlib_metadata import version
2528
2629try :
2730 from urllib .parse import urlparse
@@ -48,9 +51,8 @@ def find_locale_dir():
4851
4952LOGGER = logging .getLogger (MODULE_NAME )
5053
51- try :
52- VERSION = get_distribution (MODULE_NAME ).version
53- except DistributionNotFound :
54+ VERSION = version (MODULE_NAME )
55+ if not VERSION :
5456 VERSION = "0.0.dev0"
5557
5658PROJECT_URL = "https://github.com/LibraryOfCongress/bagit-python"
Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ def get_message_catalogs():
6262 platforms = ["POSIX" ],
6363 test_suite = "test" ,
6464 setup_requires = ["setuptools_scm" ],
65+ install_requires = ["importlib_metadata ; python_version < '3.8'" ],
6566 tests_require = tests_require ,
6667 classifiers = [
6768 "License :: Public Domain" ,
You can’t perform that action at this time.
0 commit comments