Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Initial setup for py client #2

Merged
merged 8 commits into from
Apr 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.