Skip to content

Commit

Permalink
Use importlib instead
Browse files Browse the repository at this point in the history
  • Loading branch information
chezou committed Apr 20, 2024
1 parent 82ffe8a commit 354c4a4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"]
requires = ["setuptools>=64", "setuptools_scm>=8"]
build-backend = "setuptools.build_meta"

[project]
Expand Down
7 changes: 3 additions & 4 deletions tdworkflow/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import logging

import pkg_resources
from importlib.metadata import PackageNotFoundError, version

from . import (
attempt,
Expand All @@ -15,8 +14,8 @@
)

try:
__version__ = pkg_resources.get_distribution(__name__).version
except pkg_resources.DistributionNotFound:
__version__ = version("tdworkflow")
except PackageNotFoundError:
# package is not installed
pass

Expand Down

0 comments on commit 354c4a4

Please sign in to comment.