Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/ci-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: CI Lint/Format/Test Check

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
check-python:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'

- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Run Python checks
run: uv run hatch run all-check

check-ui:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '24'

- name: Enable Corepack
run: corepack enable

- name: Activate pnpm version
working-directory: ui
run: corepack prepare --activate


- name: Run UI checks
run: pnpm run all-check
working-directory: ui
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
__pycache__
uv.lock
pnpm-lock.yaml
*.db
1 change: 1 addition & 0 deletions .gitignore.jinja
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.venv
__pycache__
workflows.db
2 changes: 0 additions & 2 deletions .gitignore.template

This file was deleted.

4 changes: 4 additions & 0 deletions copier.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
_exclude:
- ".git"
- ".github"
- "copier.yaml"
15 changes: 15 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,22 @@ build-backend = "hatchling.build"
[dependency-groups]
dev = [
"ruff>=0.13.0",
"ty>=0.0.1a16",
"pytest>=8.4.1",
"hatch>=1.14.1",
]


[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.ui]
directory = "./ui"

Expand All @@ -27,3 +41,4 @@ env-files = [".env"]

[tool.llamadeploy.workflows]
default = "app.workflow:workflow"

2 changes: 1 addition & 1 deletion src/app/workflow.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import asyncio

from workflows import Context, Workflow, step
from workflows.events import Event, StartEvent, StopEvent
from workflows.events import StartEvent, StopEvent
import logging

logger = logging.getLogger(__name__)
Expand Down
2 changes: 2 additions & 0 deletions tests/test_placeholder.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def test_placeholder():
pass
12 changes: 9 additions & 3 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"preview": "vite preview"
"build": "tsc && vite build",
"preview": "vite preview",
"lint": "tsc --noEmit",
"format": "prettier --write src",
"format-check": "prettier --check src",
"all-check": "pnpm i && pnpm run lint && pnpm run format-check && pnpm run build",
"all-fix": "pnpm i && pnpm run lint && pnpm run format && pnpm run build"
},
"dependencies": {
"canvas-confetti": "^1.9.3",
Expand All @@ -15,14 +20,15 @@
"react-router-dom": "^7.8.0"
},
"devDependencies": {
"@llamaindex/ui": "^1.0.2",
"@tailwindcss/postcss": "^4",
"@types/canvas-confetti": "^1.9.0",
"@llamaindex/ui": "^1.0.2",
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"@vitejs/plugin-react": "^4.3.4",
"eslint": "^9",
"prettier": "^3.6.2",
"tailwindcss": "^4",
"typescript": "^5",
"vite": "^5.4.8"
Expand Down
2 changes: 1 addition & 1 deletion ui/src/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function HandlerOuput({ handlerId }: { handlerId: string }) {
const taskData = useWorkflowTask(handlerId);

const result = taskData.events.find((event) =>
event.type.match(/PongEvent$/)
event.type.match(/PongEvent$/),
) as { type: string; data: { message: string } } | undefined;

return <Output>{result ? result.data.message : "Running... "}</Output>;
Expand Down