mirror of
https://github.com/pablorevilla-meshtastic/meshview.git
synced 2026-03-04 23:27:46 +01:00
Update to check for new requirements
This commit is contained in:
13
meshview/deps.py
Normal file
13
meshview/deps.py
Normal file
@@ -0,0 +1,13 @@
|
||||
import logging
|
||||
from importlib.util import find_spec
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def check_optional_deps() -> None:
|
||||
if find_spec("pyitm") is None:
|
||||
logger.warning(
|
||||
"Optional dependency missing: pyitm. "
|
||||
"Coverage prediction is disabled. "
|
||||
"Run: ./env/bin/pip install -r requirements.txt"
|
||||
)
|
||||
@@ -21,6 +21,7 @@ from meshview import config, database, decode_payload, migrations, models, store
|
||||
from meshview.__version__ import (
|
||||
__version_string__,
|
||||
)
|
||||
from meshview.deps import check_optional_deps
|
||||
from meshview.web_api import api
|
||||
|
||||
logging.basicConfig(
|
||||
@@ -38,6 +39,7 @@ env = Environment(loader=PackageLoader("meshview"), autoescape=select_autoescape
|
||||
|
||||
# Start Database
|
||||
database.init_database(CONFIG["database"]["connection_string"])
|
||||
check_optional_deps()
|
||||
|
||||
BASE_DIR = os.path.dirname(__file__)
|
||||
LANG_DIR = os.path.join(BASE_DIR, "lang")
|
||||
|
||||
@@ -11,6 +11,7 @@ from sqlalchemy.engine.url import make_url
|
||||
|
||||
from meshview import migrations, models, mqtt_database, mqtt_reader, mqtt_store
|
||||
from meshview.config import CONFIG
|
||||
from meshview.deps import check_optional_deps
|
||||
|
||||
# -------------------------
|
||||
# Basic logging configuration
|
||||
@@ -237,6 +238,7 @@ async def load_database_from_mqtt(
|
||||
# Main function
|
||||
# -------------------------
|
||||
async def main():
|
||||
check_optional_deps()
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# Initialize database
|
||||
|
||||
Reference in New Issue
Block a user