fix(ci): fix black/ruff failures, add CoC and PR template
- Fix Python formatting (sync no longer strips blank lines from .py files) - Remove test_community_build.py (tests private sync module) - Fix ruff warnings in test files - Add CODE_OF_CONDUCT.md - Add .github/PULL_REQUEST_TEMPLATE.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -12,6 +12,7 @@ from typing import Any
|
||||
|
||||
from plugins.appwrite.client import AppwriteClient
|
||||
|
||||
|
||||
def get_tool_specifications() -> list[dict[str, Any]]:
|
||||
"""Return tool specifications for ToolGenerator (14 tools)"""
|
||||
return [
|
||||
@@ -337,10 +338,12 @@ def get_tool_specifications() -> list[dict[str, Any]]:
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
# =====================
|
||||
# HANDLER FUNCTIONS
|
||||
# =====================
|
||||
|
||||
|
||||
async def list_functions(
|
||||
client: AppwriteClient, queries: list[str] | None = None, search: str | None = None
|
||||
) -> str:
|
||||
@@ -359,6 +362,7 @@ async def list_functions(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def get_function(client: AppwriteClient, function_id: str) -> str:
|
||||
"""Get function by ID."""
|
||||
try:
|
||||
@@ -368,6 +372,7 @@ async def get_function(client: AppwriteClient, function_id: str) -> str:
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def create_function(
|
||||
client: AppwriteClient,
|
||||
function_id: str,
|
||||
@@ -410,6 +415,7 @@ async def create_function(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def update_function(
|
||||
client: AppwriteClient,
|
||||
function_id: str,
|
||||
@@ -442,6 +448,7 @@ async def update_function(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def delete_function(client: AppwriteClient, function_id: str) -> str:
|
||||
"""Delete function."""
|
||||
try:
|
||||
@@ -453,6 +460,7 @@ async def delete_function(client: AppwriteClient, function_id: str) -> str:
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def list_deployments(
|
||||
client: AppwriteClient,
|
||||
function_id: str,
|
||||
@@ -477,6 +485,7 @@ async def list_deployments(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def get_deployment(client: AppwriteClient, function_id: str, deployment_id: str) -> str:
|
||||
"""Get deployment by ID."""
|
||||
try:
|
||||
@@ -486,6 +495,7 @@ async def get_deployment(client: AppwriteClient, function_id: str, deployment_id
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def delete_deployment(client: AppwriteClient, function_id: str, deployment_id: str) -> str:
|
||||
"""Delete deployment."""
|
||||
try:
|
||||
@@ -498,6 +508,7 @@ async def delete_deployment(client: AppwriteClient, function_id: str, deployment
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def activate_deployment(client: AppwriteClient, function_id: str, deployment_id: str) -> str:
|
||||
"""Activate deployment."""
|
||||
try:
|
||||
@@ -515,6 +526,7 @@ async def activate_deployment(client: AppwriteClient, function_id: str, deployme
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def get_active_deployment(client: AppwriteClient, function_id: str) -> str:
|
||||
"""Get active deployment for function."""
|
||||
try:
|
||||
@@ -542,6 +554,7 @@ async def get_active_deployment(client: AppwriteClient, function_id: str) -> str
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def list_executions(
|
||||
client: AppwriteClient,
|
||||
function_id: str,
|
||||
@@ -566,6 +579,7 @@ async def list_executions(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def get_execution(client: AppwriteClient, function_id: str, execution_id: str) -> str:
|
||||
"""Get execution by ID."""
|
||||
try:
|
||||
@@ -575,6 +589,7 @@ async def get_execution(client: AppwriteClient, function_id: str, execution_id:
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def execute_function(
|
||||
client: AppwriteClient,
|
||||
function_id: str,
|
||||
@@ -616,6 +631,7 @@ async def execute_function(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def delete_execution(client: AppwriteClient, function_id: str, execution_id: str) -> str:
|
||||
"""Delete execution."""
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user