forked from InjectiveLabs/sdk-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (35 loc) · 1.22 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
all:
gen: gen-client
gen-client: clone-all copy-proto
mkdir -p ./pyinjective/proto
buf generate --template buf.gen.yaml
rm -rf proto
$(call clean_repos)
$(MAKE) fix-generated-proto-imports
PROTO_MODULES := cosmwasm exchange gogoproto cosmos_proto cosmos testpb ibc amino tendermint injective
fix-generated-proto-imports:
@touch pyinjective/proto/__init__.py
@for module in $(PROTO_MODULES); do \
find ./pyinjective/proto -type f -name "*.py" -exec sed -i "" -e "s/from $${module}/from pyinjective.proto.$${module}/g" {} \; ; \
done
@find ./pyinjective/proto -type f -name "*.py" -exec sed -i "" -e "s/from google.api/from pyinjective.proto.google.api/g" {} \;
define clean_repos
rm -Rf cosmos-sdk
rm -Rf ibc-go
rm -Rf cometbft
rm -Rf wasmd
rm -Rf injective-core
rm -Rf injective-indexer
endef
clean-all:
$(call clean_repos)
clone-injective-indexer:
git clone https://github.com/InjectiveLabs/injective-indexer.git -b v1.13.4 --depth 1 --single-branch
clone-all: clone-injective-indexer
copy-proto:
rm -rf pyinjective/proto
mkdir -p proto/exchange
find ./injective-indexer/api/gen/grpc -type f -name "*.proto" -exec cp {} ./proto/exchange/ \;
tests:
poetry run pytest -v
.PHONY: all gen gen-client copy-proto tests