refactor: derive __version__ from package metadata (single source)
Signed-off-by: disqualifier <dev@disqualifier.me>
This commit is contained in:
@@ -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"
|
||||||
|
|||||||
Reference in New Issue
Block a user