-
Notifications
You must be signed in to change notification settings - Fork 317
/
Makefile
67 lines (52 loc) · 1.61 KB
/
Makefile
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
.DEFAULT_GOAL:=all
path = src/python-fastui
.PHONY: install
install:
pip install -U pip pre-commit pip-tools
pip install -r $(path)/requirements/all.txt
pip install -e $(path)
pre-commit install
.PHONY: install-docs
install-docs:
pip install -r requirements/docs.txt
# note -- mkdocstrings-typescript and griffe-typedoc are not yet publicly available
# but the following can be added above the pip install -r requirements/docs.txt line in the future
# pip install mkdocstrings-python mkdocstrings-typescript griffe-typedoc
.PHONY: update-lockfiles
update-lockfiles:
@echo "Updating requirements files using pip-compile"
pip-compile -q --strip-extras -o $(path)/requirements/lint.txt $(path)/requirements/lint.in
pip-compile -q --strip-extras -o $(path)/requirements/pyproject.txt -c $(path)/requirements/lint.txt $(path)/pyproject.toml --extra=fastapi
pip-compile -q --strip-extras -o $(path)/requirements/test.txt -c $(path)/requirements/lint.txt -c $(path)/requirements/pyproject.txt $(path)/requirements/test.in
pip install --dry-run -r $(path)/requirements/all.txt
.PHONY: format
format:
ruff check --fix-only $(path) demo
ruff format $(path) demo
.PHONY: lint
lint:
ruff check $(path) demo
ruff format --check $(path) demo
.PHONY: typecheck
typecheck:
pyright
.PHONY: test
test:
coverage run -m pytest
.PHONY: testcov
testcov: test
coverage html
.PHONY: typescript-models
typescript-models:
fastui generate fastui:FastUI src/npm-fastui/src/models.d.ts
.PHONY: dev
dev:
uvicorn demo:app --reload --reload-dir .
.PHONY: docs
docs:
mkdocs build
.PHONY: serve
serve:
mkdocs serve
.PHONY: all
all: testcov lint