Skip to content

Commit 021ee30

Browse files
committed
Allow package to be imported when not installed
1 parent 43e153b commit 021ee30

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/tentaclio_postgres/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
"""This package implements the tentaclio postgres client"""
22

3+
from importlib.metadata import PackageNotFoundError
34
from importlib.metadata import version as _version
45

56
from tentaclio import * # noqa
67

78
from .clients.postgres_client import PostgresClient
89
from .streams.postgres_handler import PostgresURLHandler
910

10-
__version__ = _version("tentaclio-postgres")
11+
try:
12+
__version__ = _version("tentaclio-postgres")
13+
except PackageNotFoundError:
14+
__version__ = "0.0.0"
1115

1216
# Db registry
1317
DB_REGISTRY.register("postgresql", PostgresClient) # type: ignore

0 commit comments

Comments
 (0)