-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathMakefile
More file actions
75 lines (57 loc) · 2.03 KB
/
Makefile
File metadata and controls
75 lines (57 loc) · 2.03 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
67
68
69
70
71
72
73
74
75
.DEFAULT_GOAL := help
.PHONY: help
help: ## Show this help.
@grep -E '^\S+:.*?## .*$$' $(firstword $(MAKEFILE_LIST)) | \
awk 'BEGIN {FS = ":.*?## "}; {printf "%-30s %s\n", $$1, $$2}'
pre-requirements:
@scripts/pre-requirements.sh
.PHONY: local-setup
local-setup: pre-requirements ## Sets up the local environment (e.g. install git hooks)
scripts/local-setup.sh
make install
.PHONY: install
install: pre-requirements ## Install the app packages
uv python install 3.12.8
uv python pin 3.12.8
uv sync --no-install-project
.PHONY: update
update: pre-requirements ## Updates the app packages
uv lock --upgrade
.PHONY: add-dev-package
add-dev-package: pre-requirements ## Installs a new package in the app. ex: make add-dev-package package=XXX
uv add --dev $(package)
.PHONY: add-package
add-package: pre-requirements ## Installs a new package in the app. ex: make add-package package=XXX
uv add $(package)
.PHONY: run
run: pre-requirements ## Runs the app
python main.py
.PHONY: check-typing
check-typing: pre-requirements ## Run a static analyzer over the code to find issues
ty check .
.PHONY: check-lint
check-lint: pre-requirements ## Checks the code style
ruff check
.PHONY: lint
lint: pre-requirements ## Lints the code format
ruff check --fix
.PHONY: check-format
check-format: pre-requirements ## Check format python code
ruff format --check
.PHONY: format
format: pre-requirements ## Format python code
ruff format
.PHONY: checks
checks: pre-requirements check-lint check-format check-typing ## Run all checks
.PHONY: test
test: pre-requirements ## Run all the tests
PYTHONPATH=. pytest tests -ra -x --durations=5
.PHONY: watch
watch: pre-requirements ## Run all the tests in watch mode
PYTHONPATH=. ptw --runner "pytest tests -ra -x --durations=5"
.PHONY: pre-commit
pre-commit: pre-requirements check-format check-typing check-lint test
.PHONY: rename-project
rename-project: ## Rename project make rename name=new-name
sed -i 's/python-boilerplate/$(name)/' Makefile
sed -i 's/python-boilerplate/$(name)/' pyproject.toml