File: Makefile

package info (click to toggle)
python-test2ref 1.1.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 336 kB
  • sloc: python: 490; makefile: 51
file content (75 lines) | stat: -rw-r--r-- 1,796 bytes parent folder | download
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
_GREEN:=\033[0;32m
_BLUE:=\033[0;34m
_BOLD:=\033[1m
_NORM:=\033[0m
ENV:=uv run --frozen --
PYTEST_OPTIONS=


.PHONY: help
help:  ## [DEFAULT] Show this help
	@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?##"}; {printf "${_BLUE}${_BOLD}%-10s${_NORM} %s\n", $$1, $$2}'


.PHONY: all
all:  ## Do everything taggged with [ALL] below
	@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | grep "\[ALL\]" | grep -v "^all" | awk 'BEGIN {FS = ":.*?##"}; {printf "%s ", $$1}' | xargs make
	@echo "\n    ${_GREEN}${_BOLD}PASS${_NORM}\n"


.PHONY: pre-commit
pre-commit: .venv/.valid .git/hooks/pre-commit ## [ALL] Run 'pre-commit' on all files
	${ENV} pre-commit run --all-files

.git/hooks/pre-commit: .venv/.valid
	${ENV} pre-commit install --install-hooks


.PHONY: test
test: .venv/.valid ## [ALL] Run Unittests via 'pytest' with {PYTEST_OPTIONS}
	${ENV} pytest -vv ${PYTEST_OPTIONS}
	@echo  "See coverage report:\n\n    file://${PWD}/htmlcov/index.html\n"


.PHONY: checktypes
checktypes: .venv/.valid ## [ALL] Run Type-Checking via 'mypy'
	${ENV} mypy .


.PHONY: doc
doc: .venv/.valid ## [ALL] Build Documentation via 'mkdocs'
	${ENV} mkdocs build


.PHONY: doc-serve
doc-serve: .venv/.valid ## Start Local Documentation Server via 'mkdocs'
	${ENV} mkdocs serve --no-strict


.PHONY: code
code:  ## Start Visual Studio Code
	code test2ref.code-workspace &


.PHONY: clean
clean:  ## Remove everything mentioned by '.gitignore' file
	git clean -xdf


.PHONY: distclean
distclean:  ## Remove everything mentioned by '.gitignore' file and UNTRACKED files
	git clean -xdf


.PHONY: shell
shell:  ## Open a project specific SHELL. For leaving use 'exit'.
	${ENV} ${SHELL}


# Helper
.venv/.valid: pyproject.toml uv.lock
	uv sync --frozen
	@touch $@

uv.lock:
	uv lock