Spaces:
Sleeping
Sleeping
fix: add uv.lock, server entry point and openenv-core dependency for openenv validate
Browse files- api.py +10 -0
- pyproject.toml +4 -0
- uv.lock +0 -0
api.py
CHANGED
|
@@ -163,3 +163,13 @@ def action_space():
|
|
| 163 |
@app.get("/docs", include_in_schema=False)
|
| 164 |
def custom_docs():
|
| 165 |
return get_swagger_ui_html(openapi_url="/openapi.json", title="API Docs")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 163 |
@app.get("/docs", include_in_schema=False)
|
| 164 |
def custom_docs():
|
| 165 |
return get_swagger_ui_html(openapi_url="/openapi.json", title="API Docs")
|
| 166 |
+
|
| 167 |
+
|
| 168 |
+
def main():
|
| 169 |
+
"""Entry point for 'server' script defined in pyproject.toml."""
|
| 170 |
+
import uvicorn
|
| 171 |
+
uvicorn.run("api:app", host="0.0.0.0", port=7860)
|
| 172 |
+
|
| 173 |
+
|
| 174 |
+
if __name__ == "__main__":
|
| 175 |
+
main()
|
pyproject.toml
CHANGED
|
@@ -12,6 +12,7 @@ dependencies = [
|
|
| 12 |
"uvicorn>=0.23.0",
|
| 13 |
"pydantic>=2.0.0",
|
| 14 |
"pyyaml>=6.0",
|
|
|
|
| 15 |
]
|
| 16 |
|
| 17 |
[project.optional-dependencies]
|
|
@@ -20,6 +21,9 @@ dev = [
|
|
| 20 |
"pytest>=7.0",
|
| 21 |
]
|
| 22 |
|
|
|
|
|
|
|
|
|
|
| 23 |
[tool.setuptools.packages.find]
|
| 24 |
where = ["."]
|
| 25 |
include = ["tasks*", "graders*"]
|
|
|
|
| 12 |
"uvicorn>=0.23.0",
|
| 13 |
"pydantic>=2.0.0",
|
| 14 |
"pyyaml>=6.0",
|
| 15 |
+
"openenv-core>=0.2.0",
|
| 16 |
]
|
| 17 |
|
| 18 |
[project.optional-dependencies]
|
|
|
|
| 21 |
"pytest>=7.0",
|
| 22 |
]
|
| 23 |
|
| 24 |
+
[project.scripts]
|
| 25 |
+
server = "api:main"
|
| 26 |
+
|
| 27 |
[tool.setuptools.packages.find]
|
| 28 |
where = ["."]
|
| 29 |
include = ["tasks*", "graders*"]
|
uv.lock
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|