forked from algorand/pyteal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
88 lines (59 loc) · 1.94 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
# ---- Setup ---- #
setup-development:
pip install -e .[development]
setup-docs: setup-development
pip install -r docs/requirements.txt
pip install doc2dash
setup-wheel:
pip install wheel
generate-init:
python -m scripts.generate_init
# ---- Docs and Distribution ---- #
bdist-wheel:
python setup.py sdist bdist_wheel
bundle-docs-clean:
rm -rf docs/pyteal.docset
bundle-docs: bundle-docs-clean
cd docs && \
make html && \
doc2dash --name pyteal --index-page index.html --online-redirect-url https://pyteal.readthedocs.io/en/ _build/html && \
tar -czvf pyteal.docset.tar.gz pyteal.docset
# ---- Code Quality ---- #
check-generate-init:
python -m scripts.generate_init --check
ALLPY = docs examples pyteal scripts tests *.py
black:
black --check $(ALLPY)
flake8:
flake8 $(ALLPY)
# TODO: add `tests` to $MYPY when graviton respects mypy (version 🐗)
MYPY = pyteal scripts
mypy:
mypy $(MYPY)
lint: black flake8 mypy
# ---- Unit Tests (no algod) ---- #
# TODO: add blackbox_test.py to multithreaded tests when following issue has been fixed https://github.com/algorand/pyteal/issues/199
NUM_PROCS = auto
test-unit:
pytest -n $(NUM_PROCS) --durations=10 -sv pyteal tests/unit --ignore tests/unit/blackbox_test.py --ignore tests/unit/user_guide_test.py
pytest -n 1 -sv tests/unit/blackbox_test.py tests/unit/user_guide_test.py
build-and-test: check-generate-init lint test-unit
# ---- Integration Test (algod required) ---- #
sandbox-dev-up:
docker-compose up -d algod
sandbox-dev-stop:
docker-compose stop algod
integration-run:
pytest -n $(NUM_PROCS) --durations=10 -sv tests/integration
test-integration: integration-run
all-tests: build-and-test test-integration
# ---- Local Github Actions Simulation via `act` ---- #
# assumes act is installed, e.g. via `brew install act`
ACT_JOB = run-integration-tests
local-gh-job:
act -j $(ACT_JOB)
local-gh-simulate:
act
# ---- Extras ---- #
coverage:
pytest --cov-report html --cov=pyteal