ar9avg commited on
Commit
f32a4be
·
1 Parent(s): c293dc3
Files changed (3) hide show
  1. pyproject.toml +6 -1
  2. server/app.py +36 -0
  3. uv.lock +0 -0
pyproject.toml CHANGED
@@ -21,11 +21,16 @@ dependencies = [
21
  "sse-starlette>=2.1.0",
22
  "aiosqlite>=0.20.0",
23
  "psycopg2-binary>=2.9.0",
 
24
  ]
25
 
 
 
 
26
  [project.urls]
27
  Homepage = "https://huggingface.co/spaces/ar9av/sql-agent-openenv"
28
  Repository = "https://github.com/Ar9av/sql-agent-openenv"
29
 
30
  [tool.setuptools.packages.find]
31
- where = ["backend"]
 
 
21
  "sse-starlette>=2.1.0",
22
  "aiosqlite>=0.20.0",
23
  "psycopg2-binary>=2.9.0",
24
+ "openenv-core>=0.2.0",
25
  ]
26
 
27
+ [project.scripts]
28
+ serve = "server.app:serve"
29
+
30
  [project.urls]
31
  Homepage = "https://huggingface.co/spaces/ar9av/sql-agent-openenv"
32
  Repository = "https://github.com/Ar9av/sql-agent-openenv"
33
 
34
  [tool.setuptools.packages.find]
35
+ where = ["."]
36
+ include = ["server*"]
server/app.py ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ server/app.py — Self-Improving SQL Agent
3
+ =========================================
4
+ Entry point for multi-mode deployment (uv / pyproject.toml).
5
+
6
+ Adds the backend directory to sys.path so all backend modules are importable,
7
+ then re-exports the FastAPI application as `app`.
8
+ """
9
+
10
+ from __future__ import annotations
11
+
12
+ import os
13
+ import sys
14
+
15
+ # Make backend modules importable when running from repo root
16
+ _BACKEND = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "backend")
17
+ if _BACKEND not in sys.path:
18
+ sys.path.insert(0, _BACKEND)
19
+
20
+ from main import app # noqa: E402 (FastAPI application)
21
+
22
+
23
+ def serve() -> None:
24
+ """Entry point for `[project.scripts] serve = 'server.app:serve'`."""
25
+ import uvicorn
26
+
27
+ port = int(os.environ.get("PORT", os.environ.get("GRADIO_SERVER_PORT", "7860")))
28
+ uvicorn.run(
29
+ "server.app:app",
30
+ host="0.0.0.0",
31
+ port=port,
32
+ log_level="info",
33
+ )
34
+
35
+
36
+ __all__ = ["app", "serve"]
uv.lock ADDED
The diff for this file is too large to render. See raw diff