-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
85 lines (49 loc) · 1.31 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
76
77
78
79
80
81
82
83
84
85
.PHONY: build docs
_: check
# Development Environment Setup
pip: # Upgrade pip
python -m pip install --upgrade pip
# # [Un]Install Package
install: pip # Install package
python -m pip install .
install-dev: pip # Install package in develop/editable mode
python -m pip install -e .
uninstall: pip # Uninstall package
python -m pip uninstall --yes termvisage
# # Install Dev/Doc Dependencies
req: pip # Install dev dependencies
python -m pip install --upgrade -r requirements.txt
req-doc: pip # Install doc dependencies
python -m pip install --upgrade -r docs/requirements.txt
req-all: req req-doc
# # Install Dev/Doc Dependencies and Package
dev: req install-dev
dev-doc: req-doc install-dev
dev-all: req-all install-dev
# Pre-commit Checks and Corrections
check: check-code
py_files := 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: pip
python -m pip install --upgrade build
python -m build
clean:
rm -rf build dist