Spaces:
Sleeping
Sleeping
Mahir commited on
Commit ·
000cdbf
1
Parent(s): 7932d11
Fix: server entry point uses main() as required by openenv validate
Browse files- pyproject.toml +1 -1
- server/app.py +3 -12
pyproject.toml
CHANGED
|
@@ -25,7 +25,7 @@ dependencies = [
|
|
| 25 |
]
|
| 26 |
|
| 27 |
[project.scripts]
|
| 28 |
-
server = "server.app:
|
| 29 |
|
| 30 |
[project.urls]
|
| 31 |
Homepage = "https://huggingface.co/spaces/MahirPatelCG/openenv-support"
|
|
|
|
| 25 |
]
|
| 26 |
|
| 27 |
[project.scripts]
|
| 28 |
+
server = "server.app:main"
|
| 29 |
|
| 30 |
[project.urls]
|
| 31 |
Homepage = "https://huggingface.co/spaces/MahirPatelCG/openenv-support"
|
server/app.py
CHANGED
|
@@ -1,21 +1,12 @@
|
|
| 1 |
-
"""
|
| 2 |
-
server/app.py — OpenEnv required server entry point.
|
| 3 |
-
Satisfies: openenv validate check for server/app.py
|
| 4 |
-
"""
|
| 5 |
-
|
| 6 |
import os
|
| 7 |
import sys
|
| 8 |
|
| 9 |
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
| 10 |
|
| 11 |
-
from app.main import app # noqa: F401
|
| 12 |
|
| 13 |
|
| 14 |
-
def
|
| 15 |
-
"""
|
| 16 |
-
Entry point for [project.scripts] in pyproject.toml.
|
| 17 |
-
Called when running: uv run server (or python -m server.app)
|
| 18 |
-
"""
|
| 19 |
import uvicorn
|
| 20 |
port = int(os.getenv("PORT", "7860"))
|
| 21 |
uvicorn.run(
|
|
@@ -28,4 +19,4 @@ def start():
|
|
| 28 |
|
| 29 |
|
| 30 |
if __name__ == "__main__":
|
| 31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import os
|
| 2 |
import sys
|
| 3 |
|
| 4 |
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
| 5 |
|
| 6 |
+
from app.main import app # noqa: F401
|
| 7 |
|
| 8 |
|
| 9 |
+
def main():
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
import uvicorn
|
| 11 |
port = int(os.getenv("PORT", "7860"))
|
| 12 |
uvicorn.run(
|
|
|
|
| 19 |
|
| 20 |
|
| 21 |
if __name__ == "__main__":
|
| 22 |
+
main()
|