forked from XanaduAI/MrMustard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
68 lines (57 loc) · 1.73 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
PYTHON := $(shell which python3 2>/dev/null)
TESTRUNNER := -m pytest tests -p no:warnings
COVERAGE := --cov=mrmustard --cov-report=html:coverage_html_report --cov-append
.PHONY: help
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " install to install Mr Mustard"
@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 " format to run black formatting"
@echo " test to run the test suite for entire codebase"
@echo " coverage to generate a coverage report for entire codebase"
.PHONY: install
install:
ifndef PYTHON3
@echo "To install Mr Mustard you need to have Python 3 installed"
endif
$(PYTHON) setup.py install
.PHONY: dist
dist:
$(PYTHON) setup.py sdist
.PHONY : clean
clean:
rm -rf mrmustard/__pycache__
rm -rf mrmustard/lab/__pycache__
rm -rf mrmustard/lab/abstract/__pycache__
rm -rf mrmustard/math/__pycache__
rm -rf mrmustard/physics/__pycache__
rm -rf mrmustard/utils/__pycache__
rm -rf mrmustard/backends/gaussianbackend/__pycache__
rm -rf tests/__pycache__
rm -rf tests/test_lab/__pycache__
rm -rf tests/test_physics/__pycache__
rm -rf tests/test_utils/__pycache__
rm -rf dist
rm -rf build
docs:
make -C doc html
.PHONY : clean-docs
clean-docs:
make -C doc clean
rm -rf doc/code/api
.PHONY : format
format:
black -l 100 mrmustard/ tests/
.PHONY : lint
lint:
pylint mrmustard
test:
@echo "Testing Mr Mustard..."
$(PYTHON) $(TESTRUNNER)
coverage:
@echo "Generating coverage report for Mr Mustard..."
$(PYTHON) $(TESTRUNNER) $(COVERAGE)
clean-coverage:
rm -rf coverage_html_report