forked from diem/client-sdk-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
76 lines (56 loc) · 1.85 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
# Copyright (c) The Diem Core Contributors
# SPDX-License-Identifier: Apache-2.0
init:
python3 -m venv ./venv
./venv/bin/pip install --upgrade pip wheel setuptools
./venv/bin/pip install -r requirements.txt
check: pylama
./venv/bin/pyre --search-path venv/lib/python3.9/site-packages check
pylama:
./venv/bin/pylama src tests examples
lint: check
./venv/bin/python -m black --check src tests
format:
./venv/bin/python -m black src tests examples
install:
./venv/bin/python setup.py develop
test: format install
./venv/bin/pytest tests/test_* examples/* -k "$(TEST)" -vv
cover: install
./venv/bin/pytest --cov-report html --cov=src tests
build: lint test
diemtypes:
(cd diem && cargo build -p transaction-builder-generator)
"diem/target/debug/generate-transaction-builders" \
--language python3 \
--module-name stdlib \
--with-diem-types "diem/testsuite/generate-format/tests/staged/diem.yaml" \
--serde-package-name diem \
--diem-package-name diem \
--target-source-dir src/diem \
--with-custom-diem-code diem-types-ext/*.py \
-- "diem/language/stdlib/compiled/transaction_scripts/abi"
protobuf:
mkdir -p src/diem/jsonrpc
protoc --plugin=protoc-gen-mypy=venv/bin/protoc-gen-mypy \
-Idiem/json-rpc/types/src/proto --python_out=src/diem/jsonrpc --mypy_out=src/diem/jsonrpc \
jsonrpc.proto
gen: diemtypes protobuf format
dist:
rm -rf build dist
./venv/bin/python setup.py -q sdist bdist_wheel
publish: dist
./venv/bin/pip install --upgrade twine
./venv/bin/python3 -m twine upload dist/*
docs: init install
rm -rf docs
./venv/bin/python3 -m pdoc diem --html -o docs
publishdocs:
git fetch origin gh-pages
git checkout origin/gh-pages
make docs
git add docs
git commit -m 'update docs'
git push origin gh-pages
git checkout master
.PHONY: init check lint format install test cover build diemtypes protobuf gen dist pylama docs