-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
59 lines (46 loc) · 1.17 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
virtualenv:
python -m venv virtualenv
virtualenv/bin/pip install "pip>=20.3" --upgrade
VENV = virtualenv/bin
$(VENV): virtualenv
$(VENV)/pip: $(VENV)
.git/hooks/pre-commit:
ln -sf ../../devconfig/pre-commit.sh .git/hooks/pre-commit
# Development tools
.PHONY: dev-setup
dev-setup: .git/hooks/pre-commit $(VENV)/flake8 $(VENV)/black $(VENV)/mypy
deps: $(VENV)
$(VENV)/pip install -e '.[dev]'
$(VENV)/flake8 $(VENV)/black $(VENV)/mypy $(VENV)/pytest $(VENV)/sphinx-build &: $(VENV)/pip
$(VENV)/pip install -e '.[dev]'
.PHONY: lint check-format format typecheck precommit test
lint: $(VENV)/flake8
$(VENV)/flake8 ./src
$(VENV)/flake8 ./test
check-format: $(VENV)/black
$(VENV)/black \
--target-version py38 \
--check \
./src/alertbase
$(VENV)/black \
--target-version py38 \
--check \
./test
format: $(VENV)/black
$(VENV)/black \
--target-version py38 \
./src/alertbase
$(VENV)/black \
--target-version py38 \
./test
typecheck: $(VENV)/mypy
$(VENV)/mypy --strict ./src
test: $(VENV)/pytest
$(VENV)/pytest .
precommit: check-format typecheck lint test
.PHONY: docs
docs: $(VENV)/sphinx-build
$(MAKE) -C docs html
.PHONY: clean
clean:
rm -rf virtualenv