Skip to content

Commit

Permalink
feat: Initial setup for py client (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
adilansari committed Apr 24, 2023
1 parent 25babb3 commit d087dfd
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,9 @@ dmypy.json

# Pyre type checker
.pyre/

# editor
.idea/

# generated
generated-src/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "api/proto"]
path = api/proto
url = git@github.com:tigrisdata/tigris-api.git
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
PROTO_PATH=./api/proto
PROTO_FILE_PATH=${PROTO_PATH}/server/v1
GENERATED_DIR=./generated-src/

clean:
rm -rf ${GENERATED_DIR}

generate:
mkdir -p ${GENERATED_DIR}
for pf in 'api.proto' 'search.proto' ; do \
python -m grpc_tools.protoc -I ${PROTO_PATH} --python_out=${GENERATED_DIR} --grpc_python_out=${GENERATED_DIR} ${PROTO_FILE_PATH}/$${pf} ; \
done
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
# tigris-client-python
Python client for Tigris

# Development
1. Requires **python 3.7+**, **pip 23.x**
2. Clone the repo and cd into the directory
3. Update submodule - `git submodule --init`
4. Install virtualenv - `pip install virtualenv`
5. Create virtualenv in the project directory - `virtualenv venv`
6. Activate virtualenv - `. venv/bin/activate`
7. Install dependencies - `pip install -r requirements.txt`
8. Compile proto and generate api client helpers - `make generate`
1 change: 1 addition & 0 deletions api/proto
Submodule proto added at f346cf
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
grpcio-tools==1.54.0
protobuf==4.22.3
Empty file added tigris/__init__.py
Empty file.
Empty file added tigris/client.py
Empty file.

0 comments on commit d087dfd

Please sign in to comment.