-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
94 lines (76 loc) · 1.58 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
91
92
93
94
.DEFAULT_GOAL := all
black = black --target-version py39 emerge
isort = isort --profile black emerge
.PHONY: depends
depends:
bash ./bin/depends.sh
.PHONY: init
init: depends
echo "Setting up virtual environment in venv/"
python3 -m venv venv
echo "Virtual environment complete."
.PHONY: format
format:
$(isort)
$(black)
.PHONY: lint
lint:
mypy --show-error-codes --ignore-missing-imports emerge
flake8 --ignore=E203,F841,E501,E722,W503 emerge
$(isort) --check-only --df
$(black) --check --diff
.PHONY: setup
setup:
python3 setup.py install
.PHONY: install
install: depends init
. venv/bin/activate && ( \
pip3 install -r requirements.txt; \
python3 setup.py install; \
python3 setup.py clean; \
)
.PHONY: notebook
notebook: depends init
. venv/bin/activate && ( \
jupyter notebook ipynb/Farms.ipynb \
)
.PHONY: update
update: format lint
pip3 freeze | grep -v emerge > requirements.txt
git add setup.py docs bin emerge requirements.txt Makefile README.md scripts
git commit --allow-empty -m "Updates"
git push origin main
python3 setup.py install
git status
.PHONY: build
build:
docker compose build
.PHONY: up
up: build
docker compose up
.PHONY: daemon
daemon: build
docker compose up -d
.PHONY: down
stop:
docker compose stop
.PHONY: docs
docs:
cd docs
make -C docs html
.PHONY: clean
clean:
rm -rf data/broker/*
rm -rf data/node2/*
python3 setup.py clean
git status
.PHONY: test
test: format lint
pytest emerge/tests
.PHONY: run
run: test daemon
./scripts/test.sh
make stop
.PHONY: all
all: format lint update docs install test clean run
git status