/
Makefile
60 lines (48 loc) · 1.28 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
SHELL := /bin/bash
define USAGE
Run commands for a project
Commands:
bump Bumps the version string to the next major, minor, or patch version. Must be passed major, minor, or patch as the argument
check Runs black, isort, and flake8 over all Python files but does not make changes
dev_setup Sets up development environment
fix Runs black and isort over all Python files and makes changes
test Runs tests
typehint Runs mypy over code base with --ignore-missing-imports flag
update Updates environment. Must be passed either dev or prod as the argument
endef
export USAGE
help:
@echo "$$USAGE"
.PHONY: bump
bump:
@echo "Bumping VERSION" && \
sh scripts/bump $(filter-out $@,$(MAKECMDGOALS)) \
|| exit 1
.PHONY: check
check:
@echo "Checking Python files" && \
sh scripts/check \
|| exit 1
.PHONY: dev_setup
dev_setup:
@echo "Setting up dev environment" && \
sh scripts/dev_setup \
|| exit 1
.PHONY: fix
fix:
@echo "Fixing Python files" && \
sh scripts/fix \
|| exit 1
.PHONY: test
test:
@echo "Runing tests" && \
sh scripts/test \
|| exit 1
.PHONY: update
update:
@echo "Updating environment" && \
sh scripts/update $(filter-out $@,$(MAKECMDGOALS)) \
|| exit 1
.PHONY: typehint
typehint:
mypy --ignore-missing-imports --exclude='$(VIRTUAL_ENV)' ./