Skip to content

Commit 84571eb

Browse files
authored
Merge pull request #1555 from weaviate/chore/regen-protos-from-ghurl
Change proto regen to use GH rather than local weaviate repo
2 parents 32fe66c + df35487 commit 84571eb

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tools/proto_regen.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
branchOrTag="${1:-main}"
4+
dir="tools"
5+
mkdir -p ${dir}
6+
curl -LkSs https://api.github.com/repos/weaviate/weaviate/tarball/${branchOrTag} -o ${dir}/weaviate.tar.gz
7+
tar --strip-components=3 -C ${dir} -xvf ${dir}/weaviate.tar.gz $(tar -tf ${dir}/weaviate.tar.gz | grep '^weaviate-weaviate-[^/]\+/grpc/proto/v1')
8+
9+
python3 -m grpc_tools.protoc -I ${dir} --python_out=./ --pyi_out=./ --grpc_python_out=./ ${dir}/weaviate/proto/v1/*.proto
10+
11+
rm ${dir}/weaviate.tar.gz
12+
13+
sed -i '' 's/from v1/from weaviate.proto.v1/g' v1/*.py
14+
sed -i '' 's/from v1/from weaviate.proto.v1/g' v1/*.pyi
15+
16+
rm -rf ${dir}/v1
17+
18+
echo "done"

0 commit comments

Comments
 (0)