forked from XanaduAI/thewalrus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (43 loc) · 1.32 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
PYTHON3 := $(shell which python3 2>/dev/null)
COVERAGE3 := $(shell which coverage3 2>/dev/null)
PYTHON := python3
COVERAGE := --cov=thewalrus --cov-report term-missing --cov-report=html:coverage_html_report --cov-report=xml:coverage.xml
TESTRUNNER := -m pytest --randomly-seed=137 thewalrus
.PHONY: help
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " install to install The Walrus"
@echo " wheel to build the The Walrus wheel"
@echo " dist to package the source distribution"
@echo " clean to delete all temporary, cache, and build files"
@echo " clean-docs to delete all built documentation"
@echo " test to run the Python test suite"
@echo " coverage to generate a coverage report"
.PHONY: install
install:
ifndef PYTHON3
@echo "To install The Walrus you need to have Python 3 installed"
endif
$(PYTHON) setup.py install
.PHONY: wheel
wheel:
$(PYTHON) setup.py bdist_wheel
.PHONY: dist
dist:
$(PYTHON) setup.py sdist
.PHONY : clean
clean:
make -C examples clean
rm -rf thewalrus/__pycache__
rm -rf thewalrus/tests/__pycache__
rm -rf dist
rm -rf build
doc:
make -C docs html
.PHONY : clean-docs
clean-docs:
make -C docs clean
test:
$(PYTHON) $(TESTRUNNER)
coverage:
$(PYTHON) $(TESTRUNNER) $(COVERAGE)