-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile
65 lines (57 loc) · 1.53 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
.PHONY: clean
clean:
@exec find . -type d -name "__pycache__" -exec rm -rf {} + > /dev/null 2>&1
@exec find . -type f -name "*.pyc" -exec rm -rf {} + > /dev/null 2>&1
@exec rm -rf htmlcov
@exec rm -rf .coverage
.PHONY: fix
fix:
@echo "Run ruff"
@exec poetry run ruff --fix fastadmin tests docs examples
@echo "Run isort"
@exec poetry run isort fastadmin tests docs examples
@echo "Run black"
@exec poetry run black fastadmin tests docs examples
@echo "Run mypy"
@exec poetry run mypy -p fastadmin -p docs
@echo "Run frontend linters"
@exec make -C frontend fix
.PHONY: lint
lint:
@echo "Run ruff"
@exec poetry run ruff fastadmin tests docs examples
@echo "Run isort"
@exec poetry run isort --check-only fastadmin tests docs examples
@echo "Run black"
@exec poetry run black --check --diff fastadmin tests docs examples
@echo "Run mypy"
@exec poetry run mypy -p fastadmin -p docs
@echo "Run frontend linters"
@exec make -C frontend lint
# -n auto : fix django
.PHONY: test
test:
@exec poetry run pytest --cov=fastadmin --cov-report=term-missing --cov-report=xml --cov-fail-under=80 -s tests
@exec make -C frontend test
.PHONY: kill
kill:
@exec kill -9 $$(lsof -t -i:8090)
@exec kill -9 $$(lsof -t -i:3030)
.PHONY: install
install:
@exec pip install poetry
@exec poetry install --all-extras
@exec make -C frontend install
.PHONY: docs
docs:
@exec make -C docs build
.PHONY: build
build:
@exec make docs
@exec make -C frontend build
.PHONY: push
pre-push:
@exec make fix
@exec make lint
@exec make docs
@exec make build