refactor: derive __version__ from package metadata (single source)

Signed-off-by: disqualifier <dev@disqualifier.me>
This commit is contained in:
2026-07-03 16:59:45 -04:00
parent e86184986f
commit 33ade498da
+6 -1
View File
@@ -3,6 +3,8 @@
base is stdlib only, no dependencies (the addr geo lookups add aiohttp via the base is stdlib only, no dependencies (the addr geo lookups add aiohttp via the
`commons[addr]` extra). see each submodule's docstring for its api. `commons[addr]` extra). see each submodule's docstring for its api.
""" """
from importlib.metadata import PackageNotFoundError, version
from . import addr, masking, paths, timing from . import addr, masking, paths, timing
from .masking import credit, cvv, mask_proxy, mask_url, phantom, provider from .masking import credit, cvv, mask_proxy, mask_url, phantom, provider
from .paths import deep_get, deep_set from .paths import deep_get, deep_set
@@ -53,4 +55,7 @@ __all__ = [
"aretry", "aretry",
] ]
__version__ = "0.3.4" try:
__version__ = version("commons")
except PackageNotFoundError:
__version__ = "0.0.0+unknown"