forked from rigetti/pyquil
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
86 lines (67 loc) · 1.57 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
COMMIT_HASH=$(shell git rev-parse --short HEAD)
DEFAULT_QUILC_URL=tcp://localhost:5555
DEFAULT_QVM_URL=http://localhost:5000
DOCKER_TAG=rigetti/forest:$(COMMIT_HASH)
.PHONY: all
all: dist
.PHONY: check-all
check-all: check-format check-types check-style
.PHONY: check-format
check-format:
black --check --diff pyquil
.PHONY: check-types
check-types:
mypy pyquil
.PHONY: check-style
check-style:
flake8 pyquil
.PHONY: clean
clean:
rm -rf dist
rm -rf pyquil.egg-info
rm -rf .pytest_cache/
.PHONY: config
config:
echo "[Rigetti Forest]" > ~/.forest_config
echo "qvm_address = ${DEFAULT_QVM_URL}" >> ~/.forest_config
echo "quilc_address = ${DEFAULT_QUILC_URL}" >> ~/.forest_config
cat ~/.forest_config
.PHONY: coverage
coverage:
coveralls
.PHONY: docs
docs:
poetry install --extras docs --extras latex
make -C docs clean html
.PHONY: docker
docker: Dockerfile
docker build -t $(DOCKER_TAG) .
.PHONY: format
format:
black $(if $(format_file), $(format_file), pyquil)
.PHONY: info
info:
python -V
pip freeze
.PHONY: install
install:
poetry install
.PHONY: test
test:
poetry install --extras latex
pytest -n auto -v --runslow --cov=pyquil test/unit
.PHONY: test-fast
test-fast:
poetry install --extras latex
pytest -n auto -v --cov=pyquil test/unit
.PHONY: e2e
e2e:
pytest -n 1 -v --cov=pyquil test/e2e
.PHONY: test-all
test-all: test e2e
docs/quil/grammars/Quil.g4:
git submodule init
git submodule update
.PHONY: generate-parser
generate-parser: docs/quil/grammars/Quil.g4
cd docs/quil/grammars && antlr -Dlanguage=Python3 -o ../../../pyquil/_parser/gen3 Quil.g4