-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
88 lines (62 loc) · 2.52 KB
/
Copy pathMakefile
File metadata and controls
88 lines (62 loc) · 2.52 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
76
77
78
79
80
81
82
83
84
85
86
# Just type 'make' to get help.
# Special targets:
.PHONY: * # In this makefile, targets are not built artifacts.
################################################################################
## General commands:: ##
help: ## print this help
@echo "Usage: make [TARGET]..."
@echo
@echo "TARGETs:"
@# capture section headers and documented targets:
@grep -E '^#* *[ a-zA-Z_-]+:.*?##.*$$' Makefile \
| awk 'BEGIN {FS = ":[^:]*?##"}; {printf " %-24s %s\n", $$1, $$2}' \
| sed -E 's/^ *#+/\n/g' \
| sed -E 's/ +$$//g'
@# capture notes:
@grep -E '^##[^#]*$$' Makefile | sed -E 's/^## ?//g'
venv: ## setup a local .venv and tell how to activate it
python3 -m venv .venv || \
(apt install python3.12-venv && python3 -m venv .venv)
@echo "Now please run:"
@echo ". .venv/bin/activate"
################################################################################
## Installation:: ##
require: ## install production dependencies
pip install -r requirements.txt
require-dev: ## install development dependencies
pip install -r requirements.txt -r requirements-dev.txt
################################################################################
## Quality:: ##
black: ## run black (changes shall be committed)
black --skip-string-normalization --line-length 100 .
lint: ## lint source files
./scripts/lint.sh
################################################################################
## Testing:: ##
test: ## run all tests
python3 -m pytest tests/
test-cov: ## run tests with coverage (requires pytest)
python3 -m pytest tests/ --cov=lib --cov-report=html --cov-report=term
################################################################################
## Running:: ##
stl-all: ## (re-)generate all surfaces in STL format
for f in $$(ls ./*.py); do $$f -s; done
usage: ## show what surfaces are available
@for f in $$(ls ./*.py); do \
$$f -h; \
echo "------------------------------------------------------------"; \
done
################################################################################
## Examples:: ##
example-gyroid-stl: ## generate STL for gyroid
python gyroid.py -s
example-interactive: ## show gyroid in matplotlib interactive mode
python gyroid.py -p
################################################################################
## Maintenance:: ##
clean: ## clean generated files
rm -rf __pycache__ .pytest_cache .coverage htmlcov
find . -name "*.pyc" -delete
find . -name "__pycache__" -type d -exec rm -rf {} +
update-deps: ## update dependencies
pip install --upgrade -r requirements.txt