forked from rigetti/pyquil
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (26 loc) · 1.2 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
# top-level pyquil Makefile
PACKAGENAME = pyquil
FILES = pyquil/*.py pyquil/api/*.py pyquil/latex/*.py pyquil/_parser/*.py
# Kudos: Adapted from Auto-documenting default target
# https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-12s\033[0m %s\n", $$1, $$2}'
test: ## Run unittests with current enviroment
@pytest $(PACKAGENAME)/tests
testall: ## Run full test suite
@tox
coverage: ## Report test coverage
@pytest --cov=$(PACKAGENAME) --cov-report term-missing $(PACKAGENAME)/tests
lint: ## Delint python source
@flake8 $(PACKAGENAME)
typecheck: ## Static typechecking
@mypy $(FILES) --ignore-missing-imports --follow-imports=skip
untyped: ## Report type errors and untyped functions
@mypy $(FILES) --ignore-missing-imports --follow-imports=skip --disallow-untyped-defs
docs: ## Build documentation
$(MAKE) -C docs html
antlr: ## Rebuild antlr parser (Run after modification to antlr grammar ./pyquil/_parser/Quil.g4)
(cd pyquil/_parser && antlr4 -Dlanguage=Python2 -o gen2 Quil.g4)
(cd pyquil/_parser && antlr4 -Dlanguage=Python3 -o gen3 Quil.g4)
.PHONY: help
.PHONY: docs