-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
147 lines (121 loc) · 5.17 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
include .env
export
EXTERN_DIR := "./extern"
all: pull_deps build_deps
ui: pull_deps_ui build_deps_ui
networks: pull_deps_networks build_deps_networks
capsule: pull_deps_capsule build_deps_capsule
clean_ui:
@echo "Deleting $(EXTERN_DIR)/console and ./vega_sim/bin/console"
@rm -rf "$(EXTERN_DIR)/console"
@rm -rf "./vega_sim/bin/console"
pull_deps:
@if [ ! -d ./extern/ ]; then mkdir ./extern/; fi
@echo "Downloading Git dependencies into " ${EXTERN_DIR}
@echo "Downloading Vega"
@if [ ! -d ./extern/vega ]; then mkdir ./extern/vega; git clone https://github.com/vegaprotocol/vega ${EXTERN_DIR}/vega; fi
ifneq (${VEGA_SIM_VEGA_TAG},develop)
@git -C ${EXTERN_DIR}/vega pull; git -C ${EXTERN_DIR}/vega checkout ${VEGA_SIM_VEGA_TAG}
else
@git -C ${EXTERN_DIR}/vega checkout develop; git -C ${EXTERN_DIR}/vega pull
endif
build_deps:
@mkdir -p ./vega_sim/bin
cd ${EXTERN_DIR}/vega && go build -o ../../vega_sim/bin/ ./...
pull_deps_ui:
@if [ ! -d ./extern/ ]; then mkdir ./extern/; fi
@echo "Downloading Git dependencies into " ${EXTERN_DIR}
@echo "Downloading Vega console"
@if [ ! -d ./extern/console ]; then mkdir ./extern/console; git clone https://github.com/vegaprotocol/frontend-monorepo.git ${EXTERN_DIR}/console; fi
ifneq (${VEGA_SIM_CONSOLE_TAG},master)
@git -C ${EXTERN_DIR}/console pull; git -C ${EXTERN_DIR}/console checkout ${VEGA_SIM_CONSOLE_TAG}
else
@git -C ${EXTERN_DIR}/console checkout master; git -C ${EXTERN_DIR}/console pull
endif
build_deps_ui:
@mkdir -p ./vega_sim/bin/console
@rsync -av ${EXTERN_DIR}/console vega_sim/bin/ --exclude ${EXTERN_DIR}/console/.git
@yarn --cwd vega_sim/bin/console install
pull_deps_networks:
@if [ ! -d ./extern/ ]; then mkdir ./extern/; fi
@echo "Downloading Git dependencies into " ${EXTERN_DIR}
@echo "Downloading Vega networks-internal"
@if [ ! -d ./extern/networks-internal ]; then mkdir ./extern/networks-internal; git clone https://github.com/vegaprotocol/networks-internal ${EXTERN_DIR}/networks-internal; fi
ifneq (${VEGA_SIM_NETWORKS_INTERNAL_TAG},develop)
@git -C ${EXTERN_DIR}/networks-internal pull; git -C ${EXTERN_DIR}/networks-internal checkout ${VEGA_SIM_NETWORKS_INTERNAL_TAG}
else
@git -C ${EXTERN_DIR}/networks-internal checkout develop; git -C ${EXTERN_DIR}/networks-internal pull
endif
@if [ ! -d ./extern/networks ]; then mkdir ./extern/networks; git clone https://github.com/vegaprotocol/networks ${EXTERN_DIR}/networks; fi
ifneq (${VEGA_SIM_NETWORKS_TAG},develop)
@git -C ${EXTERN_DIR}/networks pull; git -C ${EXTERN_DIR}/networks checkout ${VEGA_SIM_NETWORKS_TAG}
else
@git -C ${EXTERN_DIR}/networks checkout develop; git -C ${EXTERN_DIR}/networks pull
endif
build_deps_networks:
@mkdir -p ./vega_sim/bin/networks-internal
@rsync -av ${EXTERN_DIR}/networks-internal vega_sim/bin/ --exclude ${EXTERN_DIR}/networks-internal/.git
@mkdir -p ./vega_sim/bin/networks
@rsync -av ${EXTERN_DIR}/networks vega_sim/bin/ --exclude ${EXTERN_DIR}/networks/.git
pull_deps_capsule:
@if [ ! -d ./extern/ ]; then mkdir ./extern/; fi
@echo "Downloading Git dependencies into " ${EXTERN_DIR}
@echo "Downloading Vega vegacapsule"
@if [ ! -d ./extern/vegacapsule ]; then mkdir ./extern/vegacapsule; git clone https://github.com/vegaprotocol/vegacapsule ${EXTERN_DIR}/vegacapsule; fi
ifneq (${VEGA_SIM_CAPSULE_TAG},main)
@git -C ${EXTERN_DIR}/vegacapsule pull; git -C ${EXTERN_DIR}/vegacapsule checkout ${VEGA_SIM_CAPSULE_TAG}
else
@git -C ${EXTERN_DIR}/vegacapsule checkout main; git -C ${EXTERN_DIR}/vegacapsule pull
endif
build_deps_capsule:
@mkdir -p ./vega_sim/bin
cd ${EXTERN_DIR}/vegacapsule && go build -o ../../vega_sim/bin/ ./...
protos:
@if [ ! -d ./extern/ ]; then mkdir ./extern/; fi
@echo "Downloading Git dependencies into " ${EXTERN_DIR}
@echo "Downloading Vega"
@if [ ! -d ./extern/vega ]; then mkdir ./extern/vega; git clone https://github.com/vegaprotocol/vega ${EXTERN_DIR}/vega; fi
ifneq (${VEGA_TAG},develop)
@git -C ${EXTERN_DIR}/vega pull; git -C ${EXTERN_DIR}/vega checkout ${VEGA_TAG}
else
@git -C ${EXTERN_DIR}/vega checkout develop; git -C ${EXTERN_DIR}/vega pull
endif
@rm -rf ./vega_protos/protos
@mkdir ./vega_protos/protos
@buf generate extern/vega/protos/sources --template ./vega_protos/buf.gen.yaml
@GENERATED_DIR=./vega_protos/protos vega_protos/post-generate.sh
@black .
.PHONY: black
black:
@black .
.PHONY: blackcheck
blackcheck:
@black --check .
.PHONY: clean
clean:
@rm -rf "$(GENERATED_DIR)"
.PHONY: flake8
flake8:
@flake8
.PHONY: test
test:
@env PYTHONPATH=. pytest -m "not (integration or api or vega_query or vega_protos)" tests/
.PHONY: test_api
test_api:
@env PYTHONPATH=. pytest -m api tests/
.PHONY: test_protos
test_protos:
@env PYTHONPATH=. pytest tests/vega_protos
.PHONY: test_query
test_query:
@env PYTHONPATH=. pytest tests/vega_query
.PHONY: test_integration
test_integration:
@env PYTHONPATH=. pytest -m integration tests/
.PHONY: test_examples
test_examples:
@env PYTHONPATH=. pytest --nbmake examples/notebooks/
export_reqs:
@poetry export --without-hashes -f requirements.txt -o requirements.txt
@poetry export --without-hashes -f requirements.txt --with dev -o requirements-dev.txt
@poetry export --without-hashes -f requirements.txt --with dev -E learning -o requirements-learning.txt