Skip to content

Commit 92495d2

Browse files
authored
Clean up stray files (#3)
* Clean up stray files * Add better ci validation
1 parent ebd5164 commit 92495d2

File tree

10 files changed

+84
-7
lines changed

10 files changed

+84
-7
lines changed

.github/workflows/ci-check.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: CI Lint/Format/Test Check
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
check-python:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: '3.13'
21+
22+
- name: Install uv
23+
uses: astral-sh/setup-uv@v3
24+
25+
- name: Run Python checks
26+
run: uv run hatch run all-check
27+
28+
check-ui:
29+
runs-on: ubuntu-latest
30+
31+
steps:
32+
- name: Checkout repository
33+
uses: actions/checkout@v4
34+
35+
- name: Set up Node.js
36+
uses: actions/setup-node@v4
37+
with:
38+
node-version: '24'
39+
40+
- name: Enable Corepack
41+
run: corepack enable
42+
43+
- name: Activate pnpm version
44+
working-directory: ui
45+
run: corepack prepare --activate
46+
47+
48+
- name: Run UI checks
49+
run: pnpm run all-check
50+
working-directory: ui

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
__pycache__
33
uv.lock
44
pnpm-lock.yaml
5+
*.db

.gitignore.jinja

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.venv
22
__pycache__
3+
workflows.db

.gitignore.template

Lines changed: 0 additions & 2 deletions
This file was deleted.

copier.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
_exclude:
2+
- ".git"
3+
- ".github"
4+
- "copier.yaml"

pyproject.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,22 @@ build-backend = "hatchling.build"
1717
[dependency-groups]
1818
dev = [
1919
"ruff>=0.13.0",
20+
"ty>=0.0.1a16",
21+
"pytest>=8.4.1",
22+
"hatch>=1.14.1",
2023
]
2124

25+
26+
[tool.hatch.envs.default.scripts]
27+
"format" = "ruff format ."
28+
"format-check" = "ruff format --check ."
29+
"lint" = "ruff check --fix ."
30+
"lint-check" = ["ruff check ."]
31+
typecheck = "ty check src"
32+
test = "pytest"
33+
"all-check" = ["format-check", "lint-check", "test"]
34+
"all-fix" = ["format", "lint", "test"]
35+
2236
[tool.llamadeploy.ui]
2337
directory = "./ui"
2438

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

2842
[tool.llamadeploy.workflows]
2943
default = "app.workflow:workflow"
44+

src/app/workflow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import asyncio
22

33
from workflows import Context, Workflow, step
4-
from workflows.events import Event, StartEvent, StopEvent
4+
from workflows.events import StartEvent, StopEvent
55
import logging
66

77
logger = logging.getLogger(__name__)

tests/test_placeholder.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def test_placeholder():
2+
pass

ui/package.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@
55
"type": "module",
66
"scripts": {
77
"dev": "vite",
8-
"build": "tsc -b && vite build",
9-
"preview": "vite preview"
8+
"build": "tsc && vite build",
9+
"preview": "vite preview",
10+
"lint": "tsc --noEmit",
11+
"format": "prettier --write src",
12+
"format-check": "prettier --check src",
13+
"all-check": "pnpm i && pnpm run lint && pnpm run format-check && pnpm run build",
14+
"all-fix": "pnpm i && pnpm run lint && pnpm run format && pnpm run build"
1015
},
1116
"dependencies": {
1217
"canvas-confetti": "^1.9.3",
@@ -15,14 +20,15 @@
1520
"react-router-dom": "^7.8.0"
1621
},
1722
"devDependencies": {
23+
"@llamaindex/ui": "^1.0.2",
1824
"@tailwindcss/postcss": "^4",
1925
"@types/canvas-confetti": "^1.9.0",
20-
"@llamaindex/ui": "^1.0.2",
2126
"@types/node": "^20",
2227
"@types/react": "^19",
2328
"@types/react-dom": "^19",
2429
"@vitejs/plugin-react": "^4.3.4",
2530
"eslint": "^9",
31+
"prettier": "^3.6.2",
2632
"tailwindcss": "^4",
2733
"typescript": "^5",
2834
"vite": "^5.4.8"

ui/src/pages/Home.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ function HandlerOuput({ handlerId }: { handlerId: string }) {
7575
const taskData = useWorkflowTask(handlerId);
7676

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

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

0 commit comments

Comments
 (0)