From 9202e1770dd98e3a64e3942847527d1e99a0c69c Mon Sep 17 00:00:00 2001 From: Red Giuliano Date: Thu, 9 Jan 2025 13:20:44 -0500 Subject: [PATCH] removing unused package and matplotlib dependency. --- zt_backend/main.py | 7 ++++++- zt_backend/router.py | 1 - zt_backend/utils/file_utils.py | 1 - 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/zt_backend/main.py b/zt_backend/main.py index 06611fa5..ea9daf05 100644 --- a/zt_backend/main.py +++ b/zt_backend/main.py @@ -11,7 +11,6 @@ import webbrowser import logging import traceback -import matplotlib app = FastAPI() logger = logging.getLogger("__name__") @@ -39,7 +38,13 @@ @app.on_event("startup") def open_project(): try: + import matplotlib matplotlib.use("Agg") + except Exception as e: + logger.info('matplotlib not found') + try: + + notebook_path = Path(settings.zt_path) / "notebook.ztnb" if not notebook_path.exists(): logger.info("No notebook file found, creating with empty notebook") diff --git a/zt_backend/router.py b/zt_backend/router.py index 1582f06c..00587af1 100644 --- a/zt_backend/router.py +++ b/zt_backend/router.py @@ -52,7 +52,6 @@ from typing import Optional import mimetypes from typing import Dict, Tuple, Optional -import aiofiles import tempfile from zt_backend.utils.file_utils import * diff --git a/zt_backend/utils/file_utils.py b/zt_backend/utils/file_utils.py index 2bdde2b8..c42ba8ac 100644 --- a/zt_backend/utils/file_utils.py +++ b/zt_backend/utils/file_utils.py @@ -4,7 +4,6 @@ from typing import Dict, Optional, Tuple from fastapi import HTTPException from pathlib import Path -import aiofiles import os from pathlib import Path from typing import Dict, Set, AsyncGenerator