refactor: derive __version__ from package metadata (single source)
Signed-off-by: disqualifier <dev@disqualifier.me>
This commit is contained in:
@@ -4,6 +4,8 @@ a module of functions grouped by concern: message/embed parsing, embed sanitizin
|
|||||||
limit-fitting, link extraction, text chunking, timestamp helpers, interactive await-prompts,
|
limit-fitting, link extraction, text chunking, timestamp helpers, interactive await-prompts,
|
||||||
and a limit-safe send. see each submodule's docstring for the contract.
|
and a limit-safe send. see each submodule's docstring for the contract.
|
||||||
"""
|
"""
|
||||||
|
from importlib.metadata import PackageNotFoundError, version
|
||||||
|
|
||||||
from .embeds import fit_embed, sanitize_embed, split_embeds
|
from .embeds import fit_embed, sanitize_embed, split_embeds
|
||||||
from .limits import (
|
from .limits import (
|
||||||
EMBED_AUTHOR,
|
EMBED_AUTHOR,
|
||||||
@@ -29,7 +31,10 @@ from .text import (
|
|||||||
wrap_bare_links,
|
wrap_bare_links,
|
||||||
)
|
)
|
||||||
|
|
||||||
__version__ = "0.1.2"
|
try:
|
||||||
|
__version__ = version("dpy_commons")
|
||||||
|
except PackageNotFoundError:
|
||||||
|
__version__ = "0.0.0+unknown"
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
"parse_message",
|
"parse_message",
|
||||||
|
|||||||
Reference in New Issue
Block a user