2020-08-06 22:16:57 +02:00
|
|
|
import sys
|
2022-08-14 15:20:49 +02:00
|
|
|
from importlib.metadata import PackageNotFoundError, version
|
2020-08-06 22:16:57 +02:00
|
|
|
|
|
|
|
# Check that we're not running on an unsupported Python version.
|
2022-08-14 15:20:49 +02:00
|
|
|
if sys.version_info < (3, 9):
|
|
|
|
print("matrix_alertbot requires Python 3.9 or above.")
|
2020-08-06 22:16:57 +02:00
|
|
|
sys.exit(1)
|
|
|
|
|
2022-08-14 15:20:49 +02:00
|
|
|
try:
|
|
|
|
__version__ = version("matrix_alertbot")
|
|
|
|
except PackageNotFoundError:
|
|
|
|
# package is not installed
|
|
|
|
pass
|