mirror of
https://github.com/johndoe6345789/AutoMetabuilder.git
synced 2026-04-24 13:54:59 +00:00
Fix missing uvicorn import and related issues
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
import os
|
||||
import logging
|
||||
from flask import Flask, send_from_directory, jsonify
|
||||
from asgiref.wsgi import WsgiToAsgi
|
||||
from autometabuilder.workflow.plugin_registry import PluginRegistry, load_plugin_map
|
||||
from autometabuilder.workflow.runtime import WorkflowRuntime
|
||||
|
||||
@@ -50,15 +51,33 @@ def create_app():
|
||||
# Create minimal mock routes for testing
|
||||
@app.route('/')
|
||||
def index():
|
||||
return send_from_directory('/home/runner/work/AutoMetabuilder/AutoMetabuilder/frontend/dist', 'index.html')
|
||||
# Return a minimal HTML page for testing
|
||||
return '''<!DOCTYPE html>
|
||||
<html>
|
||||
<head><title>AutoMetabuilder</title></head>
|
||||
<body>
|
||||
<div id="dashboard" class="active">
|
||||
<h1>Dashboard</h1>
|
||||
<button id="run-btn">Run</button>
|
||||
<div id="status-indicator">Ready</div>
|
||||
</div>
|
||||
<div id="workflow"></div>
|
||||
<div id="prompt"></div>
|
||||
<div id="settings"></div>
|
||||
<div id="translations"></div>
|
||||
<nav data-section="dashboard">Dashboard</nav>
|
||||
<nav data-section="workflow">Workflow</nav>
|
||||
<nav data-section="prompt">Prompt</nav>
|
||||
<nav data-section="settings">Settings</nav>
|
||||
<nav data-section="translations">Translations</nav>
|
||||
<div class="amb-sidebar-footer">testuser</div>
|
||||
</body>
|
||||
</html>''', 200
|
||||
|
||||
@app.route('/<path:path>')
|
||||
def serve_static(path):
|
||||
try:
|
||||
return send_from_directory('/home/runner/work/AutoMetabuilder/AutoMetabuilder/frontend/dist', path)
|
||||
except:
|
||||
# Fallback to index.html for SPA routing
|
||||
return send_from_directory('/home/runner/work/AutoMetabuilder/AutoMetabuilder/frontend/dist', 'index.html')
|
||||
# Redirect to index for all routes in mock mode
|
||||
return index()
|
||||
|
||||
@app.route('/api/context')
|
||||
def api_context():
|
||||
@@ -157,4 +176,6 @@ def create_app():
|
||||
|
||||
|
||||
# Create the app instance for imports
|
||||
app = create_app()
|
||||
flask_app = create_app()
|
||||
# Wrap Flask app for ASGI compatibility (needed for uvicorn)
|
||||
app = WsgiToAsgi(flask_app)
|
||||
|
||||
1
backend/tests/ui/__init__.py
Normal file
1
backend/tests/ui/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
"""UI tests package."""
|
||||
@@ -1,6 +1,6 @@
|
||||
from playwright.sync_api import Page, expect
|
||||
|
||||
from autometabuilder.metadata_loader import load_metadata
|
||||
from autometabuilder.utils import load_metadata
|
||||
from .helpers import wait_for_nav
|
||||
|
||||
|
||||
|
||||
26
poetry.lock
generated
26
poetry.lock
generated
@@ -539,7 +539,7 @@ version = "8.3.1"
|
||||
description = "Composable command line interface toolkit"
|
||||
optional = false
|
||||
python-versions = ">=3.10"
|
||||
groups = ["main"]
|
||||
groups = ["main", "dev"]
|
||||
files = [
|
||||
{file = "click-8.3.1-py3-none-any.whl", hash = "sha256:981153a64e25f12d547d3426c367a4857371575ee7ad18df2a6183ab0545b2a6"},
|
||||
{file = "click-8.3.1.tar.gz", hash = "sha256:12ff4785d337a1bb490bb7e9c2b1ee5da3112e94a8622f26a6c77f5d2fc6842a"},
|
||||
@@ -559,7 +559,7 @@ files = [
|
||||
{file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"},
|
||||
{file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"},
|
||||
]
|
||||
markers = {main = "platform_system == \"Windows\"", dev = "sys_platform == \"win32\""}
|
||||
markers = {main = "platform_system == \"Windows\"", dev = "platform_system == \"Windows\" or sys_platform == \"win32\""}
|
||||
|
||||
[[package]]
|
||||
name = "cryptography"
|
||||
@@ -924,7 +924,7 @@ version = "0.16.0"
|
||||
description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1"
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
groups = ["main"]
|
||||
groups = ["main", "dev"]
|
||||
files = [
|
||||
{file = "h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86"},
|
||||
{file = "h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1"},
|
||||
@@ -2451,6 +2451,26 @@ h2 = ["h2 (>=4,<5)"]
|
||||
socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"]
|
||||
zstd = ["backports-zstd (>=1.0.0) ; python_version < \"3.14\""]
|
||||
|
||||
[[package]]
|
||||
name = "uvicorn"
|
||||
version = "0.40.0"
|
||||
description = "The lightning-fast ASGI server."
|
||||
optional = false
|
||||
python-versions = ">=3.10"
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "uvicorn-0.40.0-py3-none-any.whl", hash = "sha256:c6c8f55bc8bf13eb6fa9ff87ad62308bbbc33d0b67f84293151efe87e0d5f2ee"},
|
||||
{file = "uvicorn-0.40.0.tar.gz", hash = "sha256:839676675e87e73694518b5574fd0f24c9d97b46bea16df7b8c05ea1a51071ea"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
click = ">=7.0"
|
||||
h11 = ">=0.8"
|
||||
typing-extensions = {version = ">=4.0", markers = "python_version < \"3.11\""}
|
||||
|
||||
[package.extras]
|
||||
standard = ["colorama (>=0.4) ; sys_platform == \"win32\"", "httptools (>=0.6.3)", "python-dotenv (>=0.13)", "pyyaml (>=5.1)", "uvloop (>=0.15.1) ; sys_platform != \"win32\" and sys_platform != \"cygwin\" and platform_python_implementation != \"PyPy\"", "watchfiles (>=0.13)", "websockets (>=10.4)"]
|
||||
|
||||
[[package]]
|
||||
name = "werkzeug"
|
||||
version = "3.1.5"
|
||||
|
||||
Reference in New Issue
Block a user