-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTaskfile.yml
87 lines (74 loc) · 3.13 KB
/
Taskfile.yml
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
version: "3"
tasks:
setup:
desc: Install dependencies and dev-dependencies
cmds:
- python3 -m pip install --user poetry
- python3 -m poetry config virtualenvs.in-project true
- python3 -m poetry install --no-root
generate:
desc: Generates code from the protobuf definitions.
cmds:
- python3 -m poetry run python -m grpc.tools.protoc -I./protocol --python_out=. protocol/chia_tea/protobuf/generated/hardware.proto
- python3 -m poetry run python -m grpc.tools.protoc -I./protocol --python_out=. protocol/chia_tea/protobuf/generated/hardware.proto
- python3 -m poetry run python -m grpc.tools.protoc -I./protocol --python_out=. protocol/chia_tea/protobuf/generated/chia.proto
- python3 -m poetry run python -m grpc.tools.protoc -I./protocol --python_out=. protocol/chia_tea/protobuf/generated/computer_info.proto
- python3 -m poetry run python -m grpc.tools.protoc -I./protocol --python_out=. protocol/chia_tea/protobuf/generated/machine_info.proto
- python3 -m poetry run python -m grpc.tools.protoc -I./protocol --python_out=. protocol/chia_tea/protobuf/generated/config.proto
- python3 -m poetry run python -m grpc.tools.protoc -I./protocol --python_out=. --grpc_python_out=. protocol/chia_tea/protobuf/generated/monitoring_service.proto
format:
desc: Formats the source code
cmds:
- python3 -m poetry run black chia_tea
lint:
desc: Lints the code and reports on issues.
cmds:
- python3 -m poetry run black --check chia_tea
- python3 -m poetry run flake8 chia_tea --count --select=E9,F63,F7,F82 --show-source --statistics
- python3 -m poetry run flake8 chia_tea --exclude ./chia_tea/protobuf/generated --count --max-complexity=10 --max-line-length=127
- python3 -m poetry run pylint chia_tea --ignore=chia_tea/protobuf/generated
build:
desc: Builds the puthon package
cmds:
- python3 -m poetry build
test:
desc: Runs the test suite.
cmds:
- |
python3 -m poetry run pytest \
--cov-report html:cov_html \
--cov-report term:skip-covered \
--cov=chia_tea
copy:
desc: Starts the copy cli tool.
cmds:
- python3 -m poetry run chia-tea start copy
discord:
desc: Starts the discord bot.
cmds:
- python3 -m poetry run chia-tea start discord-bot
clean:
desc: Cleans up by deleting generated files including the database.
cmds:
- rm -f chia_tea/protobuf/generated/*_.pb2.py
- rm -f chia_tea/protobuf/generated/*_.pb2_grpc.py
- rm -f ./monitoring.db
- rm -rf ./cov_html
server:
desc: Starts the monitoring main server collecting data from clients.
deps: [generate]
cmds:
- python3 -m poetry run chia-tea start monitoring-server
client:
desc: Starts a monitoring client collecting data and sending it to the server.
deps: [generate]
cmds:
- python3 -m poetry run chia-tea start monitoring-client
build-docs:
desc: Builds the documentation with mkdocs
cmds:
- poetry run mkdocs build
publish-docs:
desc: Builds the documentation with mkdocs
cmds:
- poetry run mkdocs gh-deploy