Skip to content

Commit b07abed

Browse files
committed
Use importlib instead
1 parent 82ffe8a commit b07abed

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Diff for: pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build-system]
2-
requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"]
2+
requires = ["setuptools>=64", "setuptools_scm>=8"]
33
build-backend = "setuptools.build_meta"
44

55
[project]

Diff for: tdworkflow/__init__.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import logging
22

3-
import pkg_resources
3+
from importlib.metadata import version, PackageNotFoundError
44

55
from . import (
66
attempt,
@@ -15,8 +15,8 @@
1515
)
1616

1717
try:
18-
__version__ = pkg_resources.get_distribution(__name__).version
19-
except pkg_resources.DistributionNotFound:
18+
__version__ = version("tdworkflow")
19+
except PackageNotFoundError:
2020
# package is not installed
2121
pass
2222

0 commit comments

Comments
 (0)