-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
36 lines (27 loc) · 974 Bytes
/
Makefile
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
.PHONY: conda format style types black test link check notebooks
.DEFAULT_GOAL = help
PYTHON = python
VERSION = 3.10
NAME = py_name
ROOT = ./
PIP = pip
CONDA = conda
SHELL = bash
PKGROOT = finitevolx
help: ## Display this help
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
##@ Formatting
black: ## Format code in-place using black.
black ${PKGROOT}/ -l 79 .
isort: ## Format imports in-place using isort.
isort ${PKGROOT}/
format: ## Code styling - black, isort
black ${PKGROOT}/ -l 100 .
@printf "\033[1;34mBlack passes!\033[0m\n\n"
isort ${PKGROOT}/
@printf "\033[1;34misort passes!\033[0m\n\n"
##@ Testing
test: ## Test code using pytest.
@printf "\033[1;34mRunning tests with pytest...\033[0m\n\n"
pytest -v finitevolx
@printf "\033[1;34mPyTest passes!\033[0m\n\n"