Skip to content

Commit 3837652

Browse files
authored
Refactor version retrieval to use importlib.metadata
1 parent a1f0948 commit 3837652

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

tabcmd/version.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
# when we drop python 3.8, this could be replaced with this lighter weight option
2-
# from importlib.metadata import version, PackageNotFoundError
3-
from pkg_resources import get_distribution, DistributionNotFound
1+
from importlib.metadata import version, PackageNotFoundError
42

53
try:
6-
version = get_distribution("tabcmd").version
7-
except DistributionNotFound:
4+
version = version("tabcmd")
5+
except PackageNotFoundError:
86
version = "2.0.0"
9-
pass

0 commit comments

Comments
 (0)