-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (49 loc) · 1.19 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
DIRS_PYTHON := .
.PHONY: help
help:
@echo "Usage: make <target>"
@echo
@echo "Targets:"
@echo " help This help (default target)"
@echo " deps Install all dependencies"
@echo " format Format source code"
@echo " lint Run lint checks"
@echo " jupyterlab Run jupyterlab"
.PHONY: deps
deps:
pipenv install --dev
.PHONY: format
format: \
format-isort \
format-black
.PHONY: format-isort
format-isort:
pipenv run isort --profile=black $(DIRS_PYTHON)
.PHONY: format-black
format-black:
pipenv run black --line-length 100 $(DIRS_PYTHON)
.PHONY: lint
lint: \
lint-isort \
lint-black \
lint-flake8 \
lint-mypy
.PHONY: lint-isort
lint-isort:
pipenv run isort --profile=black --check-only --diff $(DIRS_PYTHON)
.PHONY: lint-black
lint-black:
pipenv run black --check --line-length 100 --diff $(DIRS_PYTHON)
.PHONY: lint-flake8
flake8:
pipenv run flake8 --max-line-length 100 $(DIRS_PYTHON)
.PHONY: lint-mypy
lint-mypy:
MYPYPATH=$(PWD)/stubs pipenv run mypy $(DIRS_PYTHON)
.PHONY: jupyterlab
jupyterlab:
cp utils/minimal.ipynb tmp.ipynb && \
PYTHON=. pipenv run \
jupyter lab \
--ip=0.0.0.0 --allow-root --NotebookApp.custom_display_url=http://127.0.0.1:8888 \
tmp.ipynb