-
Notifications
You must be signed in to change notification settings - Fork 344
/
Makefile
96 lines (75 loc) · 1.81 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
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: bench
bench:
poetry run pytest -v test/benchmarks
.PHONY: check-all
check-all: check-format check-types check-style
.PHONY: check-format
check-format:
ruff format --check --diff pyquil
.PHONY: check-types
check-types:
mypy pyquil
.PHONY: check-style
check-style:
ruff check 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: doctest
doctest:
poetry install --extras docs --extras latex
pytest -v --cov=pyquil --doctest-modules pyquil
make -C docs clean doctest
.PHONY: docker
docker: Dockerfile
docker build -t $(DOCKER_TAG) .
.PHONY: format
format:
ruff format $(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 -v --runslow --cov=pyquil --cov-report xml:coverage.xml test/unit
.PHONY: test-fast
test-fast:
poetry install --extras latex
pytest -vx --cov=pyquil test/unit
.PHONY: e2e
e2e:
pytest -n 1 -v --cov=pyquil test/e2e
.PHONY: test-all
test-all: doctest 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