From 730cb82eb7f198ce327da5e0058bdccd6e767744 Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Sun, 15 Nov 2020 16:18:23 +0800 Subject: [PATCH] :egg: add __version__ --- nonebot/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nonebot/__init__.py b/nonebot/__init__.py index eefb5f8f..c704479e 100644 --- a/nonebot/__init__.py +++ b/nonebot/__init__.py @@ -21,8 +21,13 @@ """ import importlib +import pkg_resources from nonebot.typing import Bot, Dict, Type, Union, Driver, Optional, NoReturn +_dist: pkg_resources.Distribution = pkg_resources.get_distribution("nonebot2") +__version__ = _dist.version +VERSION = _dist.parsed_version + _driver: Optional[Driver] = None