Skip to content

Commit

Permalink
try source version from importlib metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
Ken Payne committed Dec 5, 2022
1 parent 93bcba3 commit 140e8cb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tap_snowflake/tap.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from singer_sdk.helpers._classproperty import classproperty
from singer_sdk.helpers._compat import metadata

from tap_snowflake import __version__
from tap_snowflake.client import SnowflakeStream


Expand Down Expand Up @@ -64,7 +63,11 @@ def plugin_version(cls) -> str:
Returns:
The package version number.
"""
return __version__
try:
version = metadata.version(__package__ or cls.name)
except metadata.PackageNotFoundError:
version = "[could not be detected]"
return version


if __name__ == "__main__":
Expand Down

0 comments on commit 140e8cb

Please sign in to comment.