-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathMakefile
More file actions
66 lines (58 loc) · 1.71 KB
/
Makefile
File metadata and controls
66 lines (58 loc) · 1.71 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
.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 check --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 check 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
# Use -n 1: -n auto causes flaky failures with Django+SQLite (database is locked, 500s). conftest
# uses a per-worker DB and SQLite timeout when xdist is used, but parallel runs remain unreliable.
.PHONY: test
test:
@exec poetry run pytest -n 1 --cov=fastadmin --cov-report=term-missing --cov-report=xml --cov-fail-under=100 -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