Add py tests/lints

This commit is contained in:
Adrian Lyjak
2025-09-18 14:08:38 -04:00
parent b4f56862be
commit 3e56a0cf1d
5 changed files with 37 additions and 9 deletions
+16 -1
View File
@@ -19,7 +19,22 @@ requires = ["hatchling"]
build-backend = "hatchling.build"
[dependency-groups]
dev = []
dev = [
"hatch>=1.14.1",
"pytest>=8.4.2",
"ruff>=0.13.0",
"ty>=0.0.1a20",
]
[tool.hatch.envs.default.scripts]
"format" = "ruff format ."
"format-check" = "ruff format --check ."
"lint" = "ruff check --fix ."
"lint-check" = ["ruff check ."]
typecheck = "ty check src"
test = "pytest"
"all-check" = ["format-check", "lint-check", "test"]
"all-fix" = ["format", "lint", "test"]
[tool.llamadeploy]
env-files = [".env"]
+2 -3
View File
@@ -1,6 +1,5 @@
import logging
import os
import uuid
import httpx
from llama_cloud.types import RetrievalMode
@@ -23,7 +22,6 @@ from llama_index.embeddings.openai import OpenAIEmbedding
from llama_index.core.memory import ChatMemoryBuffer
from .clients import (
INDEX_NAME,
LLAMA_CLOUD_API_KEY,
LLAMA_CLOUD_BASE_URL,
get_custom_client,
@@ -335,5 +333,6 @@ class ChatWorkflow(Workflow):
result={"success": False, "error": f"Error processing query: {str(e)}"}
)
upload = DocumentUploadWorkflow(timeout=None)
chat = ChatWorkflow(timeout=None)
chat = ChatWorkflow(timeout=None)
+16 -1
View File
@@ -19,7 +19,22 @@ requires = ["hatchling"]
build-backend = "hatchling.build"
[dependency-groups]
dev = []
dev = [
"hatch>=1.14.1",
"pytest>=8.4.2",
"ruff>=0.13.0",
"ty>=0.0.1a20",
]
[tool.hatch.envs.default.scripts]
"format" = "ruff format ."
"format-check" = "ruff format --check ."
"lint" = "ruff check --fix ."
"lint-check" = ["ruff check ."]
typecheck = "ty check src"
test = "pytest"
"all-check" = ["format-check", "lint-check", "test"]
"all-fix" = ["format", "lint", "test"]
[tool.llamadeploy]
env-files = [".env"]
+1 -1
View File
@@ -1,2 +1,2 @@
PROJECT_ID = "asdf"
ORGANIZATION_ID = "asdf"
ORGANIZATION_ID = "asdf"
+2 -3
View File
@@ -1,6 +1,5 @@
import logging
import os
import uuid
import httpx
from llama_cloud.types import RetrievalMode
@@ -23,7 +22,6 @@ from llama_index.embeddings.openai import OpenAIEmbedding
from llama_index.core.memory import ChatMemoryBuffer
from .clients import (
INDEX_NAME,
LLAMA_CLOUD_API_KEY,
LLAMA_CLOUD_BASE_URL,
get_custom_client,
@@ -335,5 +333,6 @@ class ChatWorkflow(Workflow):
result={"success": False, "error": f"Error processing query: {str(e)}"}
)
upload = DocumentUploadWorkflow(timeout=None)
chat = ChatWorkflow(timeout=None)
chat = ChatWorkflow(timeout=None)