-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
114 lines (84 loc) · 2.25 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
.DEFAULT: help
help:
@echo "install"
@echo " Install wandb_preempt and dependencies"
@echo "uninstall"
@echo " Uninstall wandb_preempt"
@echo "lint"
@echo " Run all linting commands"
@echo "install-dev"
@echo " Install all development tools"
@echo "install-test"
@echo " Install only the testing tools (included in install-dev)"
@echo "test"
@echo " Run pytest on test and report coverage"
@echo "test-light"
@echo " Run pytest on the light part of test and report coverage"
@echo "install-lint"
@echo " Install only the linter tools (included in install-dev)"
@echo "black"
@echo " Run black on the project"
@echo "black-check"
@echo " Check if black would change files"
@echo "isort"
@echo " Run isort (sort imports) on the project"
@echo "isort-check"
@echo " Check if isort (sort imports) would change files"
@echo "flake8"
@echo " Run flake8 on the project"
@echo "conda-env"
@echo " Create conda environment 'wandb_preempt' with dev setup"
@echo "darglint-check"
@echo " Run darglint (docstring check) on the project"
@echo "pydocstyle-check"
@echo " Run pydocstyle (docstring check) on the project"
.PHONY: install
install:
@pip install -e .
.PHONY: uninstall
uninstall:
@pip uninstall wandb_preempt
.PHONY: install-dev
install-dev:
@pip install -e ."[test]"
@pip install -e ."[lint]"
.PHONY: install-test
install-test:
@pip install -e ."[test]"
.PHONY: test test-light
test:
@pytest -vx --run-optional-tests=expensive --cov=wandb_preempt test
test-light:
@pytest -vx --cov=wandb_preempt test
.PHONY: lint
lint:
make black-check
make isort-check
make flake8
make darglint-check
make pydocstyle-check
.PHONY: install-lint
install-lint:
@pip install -e ."[lint]"
.PHONY: black black-check
black:
@black . --config=black.toml
black-check:
@black . --config=black.toml --check
.PHONY: isort isort-check
isort:
@isort .
isort-check:
@isort . --check --diff
.PHONY: flake8
flake8:
@flake8 .
.PHONY: darglint-check
darglint-check:
@darglint --verbosity 2 wandb_preempt test
.PHONY: pydocstyle-check
pydocstyle-check:
@pydocstyle --count .
.PHONY: conda-env
conda-env:
@conda env create --file .conda_env.yml