-
Notifications
You must be signed in to change notification settings - Fork 280
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (46 loc) · 1.07 KB
/
Makefile
File metadata and controls
63 lines (46 loc) · 1.07 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
# Capture extra CLI arguments as ARGS
ARGS ?= $(filter-out $@,$(MAKECMDGOALS))
# Prevent make from treating extra args as targets
%:
@:
PY_ARGS := $(filter %.py,$(ARGS))
actions = \
setup \
test \
cov \
lint-check \
lint-format \
docs-build \
docs-serve \
docs-deploy \
build \
publish
# ARGS used for `test`. `PY_ARGS` used for `lint` and `format`
PY_ARGS := $(or $(filter %.py,$(ARGS)),sqladmin tests)
setup:
uv sync --all-groups
test:
uv run coverage run -a --concurrency=thread,greenlet -m pytest $(ARGS)
cov:
uv run coverage report
uv run coverage xml
lint:
uv run ruff check $(PY_ARGS)
uv run ruff format --check $(PY_ARGS)
uv run mypy $(PY_ARGS)
format:
uv run ruff format $(PY_ARGS)
uv run ruff check --fix $(PY_ARGS)
secure:
uv run bandit -r sqladmin --config pyproject.toml
docs-build:
uv run mkdocs build
docs-serve:
uv run mkdocs serve --dev-addr localhost:8080
docs-deploy:
uv run mkdocs gh-deploy --force
build:
uv build
publish:
uv publish
.PHONY: setup test cov lint-check lint-format docs-build docs-serve docs-deploy build publish