File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 21
21
from functools import partial
22
22
from os .path import abspath , isdir , isfile , join
23
23
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
25
28
26
29
try :
27
30
from urllib .parse import urlparse
@@ -48,9 +51,8 @@ def find_locale_dir():
48
51
49
52
LOGGER = logging .getLogger (MODULE_NAME )
50
53
51
- try :
52
- VERSION = get_distribution (MODULE_NAME ).version
53
- except DistributionNotFound :
54
+ VERSION = version (MODULE_NAME )
55
+ if not VERSION :
54
56
VERSION = "0.0.dev0"
55
57
56
58
PROJECT_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():
62
62
platforms = ["POSIX" ],
63
63
test_suite = "test" ,
64
64
setup_requires = ["setuptools_scm" ],
65
+ install_requires = ["importlib_metadata ; python_version < '3.8'" ],
65
66
tests_require = tests_require ,
66
67
classifiers = [
67
68
"License :: Public Domain" ,
You can’t perform that action at this time.
0 commit comments