refactor: derive __version__ from package metadata (single source)
Signed-off-by: disqualifier <dev@disqualifier.me>
This commit is contained in:
1 parent
0d9d93e4c1
commit
1662d73d36
1 file changed
+6
-1
@@ -5,10 +5,15 @@ WebhookResult and never raises on a send failure. see README for usage. the
|
|||||||
[discord] extra adds DiscordWebhook (aiowebhooks.discord).
|
[discord] extra adds DiscordWebhook (aiowebhooks.discord).
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from importlib.metadata import PackageNotFoundError, version
|
||||||
|
|
||||||
from .errors import NoUrlsError, WebhookError
|
from .errors import NoUrlsError, WebhookError
|
||||||
from .result import WebhookResult
|
from .result import WebhookResult
|
||||||
from .sender import Webhook
|
from .sender import Webhook
|
||||||
|
|
||||||
__all__ = ["Webhook", "WebhookResult", "WebhookError", "NoUrlsError"]
|
__all__ = ["Webhook", "WebhookResult", "WebhookError", "NoUrlsError"]
|
||||||
|
|
||||||
__version__ = "0.1.8"
|
try:
|
||||||
|
__version__ = version("aiowebhooks")
|
||||||
|
except PackageNotFoundError:
|
||||||
|
__version__ = "0.0.0+unknown"
|
||||||
Reference in new issue
Block a user