-
Notifications
You must be signed in to change notification settings - Fork 103
/
Makefile
77 lines (60 loc) · 1.77 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
CHECK_SRC := ./omnizart
.PHONY: all
all: lint test
# --------------------------------------------------------------
# Linter
# --------------------------------------------------------------
.PHONY: lint
lint: check-flake check-pylint
.PHONY: check-flake
check-flake:
@echo "Checking with flake..."
@flake8 --config .config/flake $(CHECK_SRC)
.PHONY: check-pylint
check-pylint:
@echo "Checking with pylint..."
@pylint --fail-under 9.5 --rcfile .config/pylintrc $(CHECK_SRC)
.PHONY: check-black
check-black:
@echo "Checking with black..."
@black --check $(CHECK_SRC)
.PHONY: format
format:
@echo "Format code with black"
@black $(CHECK_SRC)
@echo "Format code with yapf"
@yapf $(CHECK_SRC) --in-place --recursive --style .config/yapf.style
# --------------------------------------------------------------
# Unittest
# --------------------------------------------------------------
.PHONY: test
test:
@echo "Run unit tests"
@pytest --cov-fail-under=25 --cov-report=html --cov=omnizart tests
# --------------------------------------------------------------
# Other convenient utilities
# --------------------------------------------------------------
.PHONY: export
export:
@echo "Exporting requirements.txt and setup.py"
@poetry export -f requirements.txt -o requirements.txt
@./scripts/create_setup.sh
.PHONY: install
install:
@./scripts/install.sh venv
.PHONY: install-dev
install-dev:
@poetry config virtualenvs.create false
@poetry install
@./scripts/gdrive.sh https://drive.google.com/file/d/10i8z1zH60a2coKEst47lELdkvZUmgd1b/view?usp=sharing
@unzip resource.zip
@mv resource/* tests/resource
@rm -d resource
@rm resource.zip
.PHONY: clean
clean:
@rm -rf .venv/
@rm -rf ~/.cache/pypoetry/
.PHONY: build-docker
build-docker:
docker build --network=host -t omnizart:dev ./