File tree Expand file tree Collapse file tree 6 files changed +68
-222
lines changed Expand file tree Collapse file tree 6 files changed +68
-222
lines changed Original file line number Diff line number Diff line change 18
18
uses : astral-sh/setup-uv@v5
19
19
with :
20
20
enable-cache : true
21
- cache-dependency-glob : " uv.lock"
21
+ cache-dependency-glob : " backend/ uv.lock"
22
22
# Install a specific version of uv.
23
23
version : " 0.7.12"
24
24
31
31
- name : Run formatter checks
32
32
run : uv run ruff format --check
33
33
34
+ - name : Run lint checks
35
+ run : uv run ruff check
36
+
37
+ - name : Run type checks
38
+ run : uv run ty check
39
+
34
40
- name : Run tests
35
41
env :
36
42
OPENAI_API_KEY : XXXX
Original file line number Diff line number Diff line change @@ -23,9 +23,50 @@ Live at https://tenantfirstaid.com/
23
23
1 . Go to http://localhost:5173
24
24
1 . Start chatting
25
25
26
- ### Run backend tests
26
+ ### Backend Development & Checks
27
27
28
- In the ` backend/ ` directory, run ` uv run pytest `
28
+ 1 . change to the ` backend/ ` directory
29
+ ``` sh
30
+ % cd backend
31
+ ```
32
+ - run individual checks
33
+ 1 . * format* Python code with ` ruff `
34
+ ``` sh
35
+ % uv run ruff format
36
+ ```
37
+ or
38
+ ` ` ` sh
39
+ % make fmt
40
+ ` ` `
41
+ 1. * lint* Python code with ` ruff`
42
+ ` ` ` sh
43
+ % uv run ruff check
44
+ ` ` `
45
+ or
46
+ ` ` ` sh
47
+ % make lint
48
+ ` ` `
49
+ 1. * typecheck* Python code with ` ty`
50
+ ` ` ` sh
51
+ % uv run ty check
52
+ ` ` `
53
+ or
54
+ ` ` ` sh
55
+ % make typecheck
56
+ ` ` `
57
+ 1. * test* Python code with ` pytest`
58
+ ` ` ` sh
59
+ % uv run pytest
60
+ ` ` `
61
+ or
62
+ ` ` ` sh
63
+ % make test
64
+ ` ` `
65
+ - or run the above checks in one-shot
66
+ ` ` ` sh
67
+ % make --keep-going check
68
+ ` ` `
69
+ ` --keep-going` will continue to run checks, even if previous ` make` rule fail. Omit if you want to stop after the first ` make` rule fails.
29
70
30
71
# # Contributing
31
72
Original file line number Diff line number Diff line change @@ -5,14 +5,26 @@ PIP := $(PYTHON) pip
5
5
6
6
all : check
7
7
8
+ uv.lock : pyproject.toml
9
+ $(PYTHON ) sync
10
+
8
11
install :
9
12
$(PIP ) install .
10
13
11
- test :
12
- uv run pytest -v -s
14
+ fmt : uv.lock
15
+ $(PYTHON ) run ruff format
16
+
17
+ lint : uv.lock
18
+ $(PYTHON ) run ruff check $(LINT_OPTIONS )
19
+
20
+ typecheck : uv.lock
21
+ $(PYTHON ) run ty check $(TYPECHECK_OPTIONS )
22
+
23
+ test : uv.lock
24
+ uv run pytest -v -s $(TEST_OPTIONS )
13
25
14
26
clean :
15
27
find . -type d -name ' __pycache__' -exec rm -r {} +
16
28
rm -rf dist build * .egg-info
17
29
18
- check : clean install test
30
+ check : clean install fmt lint typecheck test
Original file line number Diff line number Diff line change 1
- import textwrap , pathlib , json
1
+ import textwrap
2
+ import pathlib
3
+ import json
2
4
3
5
# Build the two eval samples as Python dicts
4
6
samples = [
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments