Skip to content

Commit

Permalink
Add autodocs requirements, mock imports
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanzwicknagl committed Dec 6, 2024
1 parent 2a424e6 commit 641688a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
6 changes: 1 addition & 5 deletions backend/src/viasp/server/database.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from os.path import join, dirname, abspath
from typing import Set, List
from uuid import UUID, uuid4
from functools import wraps
from flask import session

Expand All @@ -17,8 +14,7 @@
except ImportError:
from threading import get_ident as _get_ident # type: ignore

SQLALCHEMY_DATABASE_URL = "sqlite:////" + join(dirname(abspath(__file__)),
GRAPH_PATH)
SQLALCHEMY_DATABASE_URL = f"sqlite:///{GRAPH_PATH}"

engine = create_engine(SQLALCHEMY_DATABASE_URL)#, connect_args={"check_same_thread": False})
db_session = scoped_session(
Expand Down
1 change: 1 addition & 0 deletions backend/src/viasp/shared/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
LOCALES_PATH = pathlib.Path(__file__).parent.parent.resolve() / "locales" / DEFAULT_LOCALE
SHARED_PATH = pathlib.Path(__file__).parent.resolve()
GRAPH_PATH = SHARED_PATH / "viasp_graph_storage.db"
print(f'Type of GRAPH_PATH: {type(GRAPH_PATH)}', flush=True)
SERVER_PATH = pathlib.Path(__file__).parent.parent.resolve() / "server/"
STATIC_PATH = os.path.join(SERVER_PATH, "static")
CLINGRAPH_PATH = os.path.join(STATIC_PATH, "clingraph")
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
# sys.path.append(os.path.join(os.path.abspath(os.pardir)))
autodoc_mock_imports = [
"clingo", "_clingo", "graphviz", "networkx", "viasp.shared",
"viasp.wrapper", "viasp.clingoApiClient",
"viasp_dash", "dash"
"viasp.wrapper", "viasp.clingoApiClient", "viasp_dash", "dash",
"viasp.server", "viasp.asp", "viasp.locales"
]

# -- General configuration ---------------------------------------------------
Expand Down

0 comments on commit 641688a

Please sign in to comment.