We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bc6bc33 commit dbd8456Copy full SHA for dbd8456
1 file changed
src/hawkapi_cache/__init__.py
@@ -6,13 +6,18 @@
6
7
from __future__ import annotations
8
9
-__version__ = "0.2.0"
+from importlib.metadata import PackageNotFoundError, version
10
11
from hawkapi_cache._backends import CacheBackend, MemoryCacheBackend
12
from hawkapi_cache._decorator import cache
13
from hawkapi_cache._plugin import CachePlugin, init_cache
14
from hawkapi_cache._redis import RedisCacheBackend
15
16
+try:
17
+ __version__ = version("hawkapi-cache")
18
+except PackageNotFoundError: # pragma: no cover - running from a source tree without install
19
+ __version__ = "0.0.0"
20
+
21
__all__ = [
22
"CacheBackend",
23
"CachePlugin",
0 commit comments