forked from jamalex/notion-py
-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
88 lines (52 loc) · 2.06 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
.PHONY: help clean install dev-install self-install
.PHONY: build bump-% publish docs serve-docs lock
.PHONY: format try-format test try-test smoke-test try-smoke-test
tests = $(or $(word 2, $(MAKECMDGOALS)), tests/)
smoke_tests = $(or $(word 2, $(MAKECMDGOALS)), smoke_tests/)
temp_files = $(shell sed '/\# -/q' .gitignore | cut -d'\#' -f1)
help: ## display this help
@awk ' \
BEGIN { \
FS = ":.*##"; \
printf "Usage:\n\t make \033[36m"; \
printf "<target>\033[0m\n\nTargets:\n"; \
} /^[\-a-z%]+:.*##/ { \
printf "\033[36m%17s\033[0m -%s\n", $$1, $$2; \
}' $(MAKEFILE_LIST)
clean: ## clean all temp files
rm -rf $(temp_files)
find . -type f -name "*.pyc" -delete
find . -type d -name "__pycache__" -delete
install: ## install requirements
python -m pip install -r requirements.lock
dev-install: ## install dev requirements
python -m pip install -r dev-requirements.txt
self-install: ## install the package locally
python setup.py install
build: ## build wheel package
python setup.py sdist bdist_wheel
bump-%: ## bump version (major, minor, patch)
@bash docs/bump-version.sh $(subst bump-,,$@)
publish: ## publish the package on PyPI
twine check dist/*
twine upload --skip-existing dist/*
docs: ## generate documentation in HTML
sphinx-build -b dirhtml docs/ public/
serve-docs: ## generate and serve documentation
python docs/serve.py
lock: ## lock all dependency versions
python -m pip freeze | xargs pip uninstall -y
python -m pip install --upgrade -r requirements.txt
python -m pip freeze > requirements.lock
format: ## format code with black
python -m black .
try-format: ## try to format code with black
python -m black --check .
test: ## test code with unit tests
python -m pytest --cache-clear -v $(tests)
try-test: ## try test code with unit tests
python -m pytest --cache-clear -v -x --pdb $(tests)
smoke-test: ## test code with smoke tests
python -m pytest --cache-clear -v $(smoke_tests)
try-smoke-test: ## try to test code with smoke tests
python -m pytest --cache-clear -v -x --pdb $(smoke_tests)