-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
75 lines (45 loc) · 1.16 KB
/
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
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
.PHONY: build docs
_: check
# Development Environment Setup
pip:
python -m pip install --upgrade pip
install: install-req
python -m pip install -e .
install-all: pip
python -m pip install --upgrade -e . -r requirements.txt -r docs/requirements.txt
install-req: pip
python -m pip install --upgrade -r requirements.txt
install-req-all: pip
python -m pip install --upgrade -r requirements.txt -r docs/requirements.txt
install-req-docs: pip
python -m pip install --upgrade -r docs/requirements.txt
uninstall:
pip uninstall -y termvisage
# Pre-commit Checks and Corrections
check: check-code
py_files := *.py src/ docs/source/conf.py
## Code Checks
check-code: lint check-format check-imports
lint:
flake8 $(py_files) && echo
check-format:
black --check --diff --color $(py_files) && echo
check-imports:
isort --check --diff --color $(py_files) && echo
## Code Corrections
format:
black $(py_files)
imports:
isort $(py_files)
# Building the Docs
docs:
cd docs/ && make html
clean-docs:
cd docs/ && make clean
# Packaging
build:
python -m pip install --upgrade pip
python -m pip install --upgrade build
python -m build
clean:
rm -rf build dist