forked from rigetti/pyquil
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
90 lines (70 loc) · 1.7 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
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)
TWINE_REPOSITORY_URL=https://test.pypi.org/legacy/
.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: dist
dist:
python setup.py sdist
.PHONY: docs
docs: CHANGELOG.md
pandoc --from=markdown --to=rst --output=docs/source/changes.rst CHANGELOG.md
make -C docs html
.PHONY: docker
docker: Dockerfile
docker build -t $(DOCKER_TAG) .
.PHONY: format
format:
black pyquil
.PHONY: info
info:
python -V
pip freeze
.PHONY: install
install:
pip install -e .
.PHONY: requirements
requirements: requirements.txt
pip install -r requirements.txt
.PHONY: test
test:
pytest -n auto -v --runslow --cov=pyquil
.PHONY: upload
upload:
twine upload --repository-url "${TWINE_REPOSITORY_URL}" dist/*
.PHONY: version
version:
@git describe --tags | sed 's/v//' | sed 's/\(.*\)-.*/\1/'| sed 's/-/./'
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