forked from neuralmagic/deepsparse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (43 loc) · 1.5 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
.PHONY: build docs test
BUILDDIR := $(PWD)
CHECKDIRS := examples tests src utils notebooks setup.py
PYCHECKGLOBS := 'examples/**/*.py' 'scripts/**/*.py' 'src/**/*.py' 'tests/**/*.py' 'utils/**/*.py' setup.py
DOCDIR := docs
MDCHECKGLOBS := 'docs/**/*.md' 'docs/**/*.rst' 'examples/**/*.md' 'notebooks/**/*.md' 'scripts/**/*.md'
MDCHECKFILES := CODE_OF_CONDUCT.md CONTRIBUTING.md DEVELOPING.md README.md
# run checks on all files for the repo
quality:
@echo "Running copyright checks";
python utils/copyright.py quality $(PYCHECKGLOBS) $(MDCHECKGLOBS) $(MDCHECKFILES)
@echo "Running python quality checks";
black --check $(CHECKDIRS);
isort --check-only $(CHECKDIRS);
flake8 $(CHECKDIRS);
# style the code according to accepted standards for the repo
style:
@echo "Running copyrighting";
python utils/copyright.py style $(PYCHECKGLOBS) $(JSCHECKGLOBS) $(MDCHECKGLOBS) $(MDCHECKFILES)
@echo "Running python styling";
black $(CHECKDIRS);
isort $(CHECKDIRS);
# run tests for the repo
test:
@echo "Running python tests";
@pytest ./tests/;
# run example tests for the repo
test-examples:
@echo "Running python example tests";
@pytest ./examples/;
# create docs
docs:
sphinx-apidoc -o "$(DOCDIR)/source/api" src/deepsparse;
cd $(DOCDIR) && $(MAKE) html;
# creates wheel file
build:
python3 setup.py sdist bdist_wheel
# clean package
clean:
rm -fr .pytest_cache;
rm -fr docs/_build docs/build;
find $(CHECKDIRS) | grep -E "(__pycache__|\.pyc|\.pyo)" | xargs rm -fr;
find $(DOCDIR) | grep .rst | xargs rm -fr;