-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.py
36 lines (33 loc) · 1.06 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import sys
import mesop as me
import mesop.bin.bin as mesop_bin
from dyad import logger as logger
from dyad_app import main as main
logger().info("Using Mesop version: %s", me.__version__)
# TODO: start file indexing
# TODO(wwwillchen): come up with a better hot reloading solution.
# This is a hack to get hot reloading to work because the dyad imports
# do not match with the direct file paths that mesop expects due to the
# workspace layout configured by uv.
for mod in sys.modules:
if (
(
mod.startswith("dyad")
and all(
[
stateful_module not in mod
for stateful_module in [
"dyad_fs_watcher",
"suggestions",
"logging",
"dyad.agents",
"agents",
"agent_api",
]
]
)
)
or mod.startswith("sqlalchemy")
or mod.startswith("sqlmodel")
):
mesop_bin.app_modules.add(mod)