Skip to content

Commit 215aa69

Browse files
authored
edits (#1)
* adding test-proj * add github * Add py tests/lints * reformats * hmm * fix formats * m * m
1 parent 2405947 commit 215aa69

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1805
-327
lines changed

.env

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

.env.template

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Copy this to .env and set any necessary secrets
2+
OPENAI_API_KEY=sk-your-openai-api-key-here
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Check Template Regeneration
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
check-template:
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 regeneration check
26+
run: uv run copier/copy_utils.py check-regeneration
27+
28+
check-python:
29+
runs-on: ubuntu-latest
30+
31+
steps:
32+
- name: Checkout repository
33+
uses: actions/checkout@v4
34+
35+
- name: Set up Python
36+
uses: actions/setup-python@v5
37+
with:
38+
python-version: '3.13'
39+
40+
- name: Install uv
41+
uses: astral-sh/setup-uv@v3
42+
43+
- name: Run Python checks
44+
run: uv run hatch run all-check
45+
working-directory: test-proj
46+
47+
check-ui:
48+
runs-on: ubuntu-latest
49+
50+
steps:
51+
- name: Checkout repository
52+
uses: actions/checkout@v4
53+
54+
- name: Set up Node.js
55+
uses: actions/setup-node@v4
56+
with:
57+
node-version: '24'
58+
59+
- name: Enable Corepack
60+
run: corepack enable
61+
62+
- name: Activate pnpm version
63+
working-directory: test-proj/ui
64+
run: corepack prepare --activate
65+
66+
67+
- name: Run UI checks
68+
run: pnpm run all-check
69+
working-directory: test-proj/ui

.gitignore.jinja

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.env
2+
__pycache__
3+
workflows.db
4+
.venv

copier.yaml

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,21 @@ project_name:
88
Project name must contain only letters, numbers, and dashes
99
{% endif %}
1010
11-
llama_project_id:
12-
type: str
13-
help: What is your Llama Cloud project ID?
14-
default: ""
15-
required: true
16-
17-
llama_org_id:
11+
project_title:
1812
type: str
19-
help: What is your Llama Cloud organization ID?
20-
default: ""
21-
required: true
13+
help: What is the title of your project? This will be used in the UI Title Bar.
14+
default: "{{ project_name.replace('-', ' ').title() }}"
2215

2316
# computed variables
2417
project_name_snake:
2518
type: str
2619
default: "{{ project_name.replace('-', '_') }}"
2720
when: false
2821

29-
project_title:
30-
type: str
31-
default: "{{ (project_name.replace('-', ' '))[:1] | upper ~ (project_name.replace('-', ' '))[1:] }}"
32-
when: false
33-
3422
_exclude:
3523
- "test-proj"
3624
- ".git"
3725
- ".github"
3826
- "copier"
3927
- "CONTRIBUTING.md"
40-
- "copier.yaml"
28+
- "copier.yaml"

copier/copy_utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ def run_copier_quietly(src_path: str, dst_path: str, data: Dict[str, str]) -> No
4444
data=data,
4545
unsafe=True,
4646
quiet=True,
47+
vcs_ref="HEAD",
4748
)
4849

4950

llama_deploy.yaml

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

llama_deploy.yaml.jinja

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

pyproject.toml

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

pyproject.toml.jinja

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,48 @@
11
[project]
2-
name = "{{project_name_snake}}"
2+
name = "{{ project_name_snake }}"
33
version = "0.1.0"
44
description = "Add your description here"
55
readme = "README.md"
6-
authors = [
7-
{ name = "Terry Zhao", email = "[email protected]" }
8-
]
6+
authors = []
97
requires-python = ">=3.12"
108
dependencies = [
11-
"llama-index-workflows>=2.2.0",
12-
"python-cowsay>=1.2.1",
13-
"llama-cloud-services>=0.6.0",
14-
"llama-index-core>=0.12.0",
15-
"llama-index-llms-openai>=0.3.0",
16-
"llama-index-embeddings-openai>=0.3.0",
17-
"python-dotenv>=1.0.1",
9+
"llama-index-workflows>=2.2.0,<3.0.0",
10+
"llama-cloud-services>=0.6.68",
11+
"llama-index-core>=0.14.0",
12+
"llama-index-llms-openai>=0.5.6",
13+
"llama-index-embeddings-openai>=0.5.1",
14+
"python-dotenv>=1.1.1",
1815
]
1916

2017
[build-system]
2118
requires = ["hatchling"]
2219
build-backend = "hatchling.build"
2320

2421
[dependency-groups]
25-
dev = []
22+
dev = [
23+
"hatch>=1.14.1",
24+
"pytest>=8.4.2",
25+
"ruff>=0.13.0",
26+
"ty>=0.0.1a20",
27+
]
28+
29+
[tool.hatch.envs.default.scripts]
30+
"format" = "ruff format ."
31+
"format-check" = "ruff format --check ."
32+
"lint" = "ruff check --fix ."
33+
"lint-check" = ["ruff check ."]
34+
typecheck = "ty check src"
35+
test = "pytest"
36+
"all-check" = ["format-check", "lint-check", "test"]
37+
"all-fix" = ["format", "lint", "test"]
38+
39+
[tool.llamadeploy]
40+
env-files = [".env"]
41+
llama_cloud = true
42+
43+
[tool.llamadeploy.ui]
44+
directory = "./ui"
2645

46+
[tool.llamadeploy.workflows]
47+
upload = "test_proj.qa_workflows:upload"
48+
chat = "test_proj.qa_workflows:chat"

0 commit comments

Comments
 (0)