forked from redis/redis-vl-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
102 lines (76 loc) · 2.29 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
MAKEFLAGS += --no-print-directory
# Do not remove this block. It is used by the 'help' rule when
# constructing the help output.
# help:
# help: Developer Makefile
# help:
SHELL:=/bin/bash
# help: help - display this makefile's help information
.PHONY: help
help:
@grep "^# help\:" Makefile | grep -v grep | sed 's/\# help\: //' | sed 's/\# help\://'
# help:
# help: Style
# help: -------
# help: check - run all checks for a commit
.PHONY: check
check: check-format check-sort-imports mypy
# help: format - perform code style format
.PHONY: format
format: sort-imports
@black ./redisvl ./tests/
# help: check-format - check code format compliance
.PHONY: check-format
check-format:
@black --check ./redisvl
# help: sort-imports - apply import sort ordering
.PHONY: sort-imports
sort-imports:
@isort ./redisvl ./tests/ --profile black
# help: check-sort-imports - check imports are sorted
.PHONY: check-sort-imports
check-sort-imports:
@isort ./redisvl --check-only --profile black
# help: check-lint - run static analysis checks
.PHONY: check-lint
check-lint:
@pylint --rcfile=.pylintrc ./redisvl
# help: mypy - run mypy
.PHONY: mypy
mypy:
@mypy ./redisvl
# help:
# help: Documentation
# help: -------
# help: docs - generate project documentation
.PHONY: docs
docs:
@cd docs; make html
# help: servedocs - Serve project documentation
.PHONY: servedocs
servedocs:
@cd docs/_build/html/; python -m http.server
# help:
# help: Test
# help: -------
# help: test - Run all tests
.PHONY: test
test:
@python -m pytest
# help: test-verbose - Run all tests verbosely
.PHONY: test-verbose
test-verbose:
@python -m pytest -vv -s
# help: test-cov - Run all tests with coverage
.PHONY: test-cov
test-cov:
@python -m pytest -vv --cov=./redisvl
# help: cov - generate html coverage report
.PHONY: cov
cov:
@coverage html
@echo if data was present, coverage report is in ./htmlcov/index.html
# help: test-notebooks - Run all notebooks
.PHONY: test-notebooks
test-notebooks:
@cd docs/ && treon -v