Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (34 loc) · 1.43 KB
/
Copy pathMakefile
File metadata and controls
43 lines (34 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
.PHONY: sync config corpus index test integration-test check deploy
# Fast, offline unit tests (mocked OpenAI + index).
test:
uv run --group test python -m pytest tests -q
# Optional end-to-end tests against the real OpenAI API.
# Requires OPENAI_API_KEY; tests that call the API fail without it.
integration-test:
uv run --group test --group ingest python -m pytest tests_integration -q -rs
sync:
uv sync
config:
uv run python scripts/compile_config.py
# Rebuild the search corpus from the sources (needs the `ingest` group).
corpus:
uv run --group ingest python scripts/build_search_corpus.py
# Fit the search index from the corpus and write the packed .zsx artifact.
index:
uv run python scripts/build_search_index.py
check:
uv run python scripts/compile_config.py
uv run --group test python -m pytest tests -q
uv run python scripts/build_search_index.py
uv run python scripts/check_handler.py
uv run python -m compileall -q src scripts
# Assemble the Lambda deployment package. Invoked by SAM (BuildMethod: makefile);
# CWD is the repo root and ARTIFACTS_DIR is provided by `sam build`.
build-FaqWorkerFunction:
uv pip install --target "$(ARTIFACTS_DIR)" zerosearch==0.4.0
cp -r src/faq_assistant "$(ARTIFACTS_DIR)/faq_assistant"
cp artifacts/search/search-index.zsx "$(ARTIFACTS_DIR)/search-index.zsx"
# Build the index, package, and deploy. First run: `uv run sam deploy --guided`.
deploy: index
uv run sam build
uv run sam deploy