Skip to content

Commit 4bd479f

Browse files
authored
Upgrade to proto 0.14.3 (#16)
* Upgrade to proto 0.14.3 - Regenerated gRPC client. - Updated README.md to reflect better way to generate gRPC client without manually changing import. - Bumped version to 0.14.0 synchronizing major and minor versions with the compatible driver version. * Update Cottontail DB test container to 0.15.2 * Refactor relative imports to absolute
1 parent ec13ba8 commit 4bd479f

File tree

7 files changed

+386
-407
lines changed

7 files changed

+386
-407
lines changed

.github/workflows/python-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
# Setup Cottontail DB service container
2121
services:
2222
cottontail:
23-
image: vitrivr/cottontaildb:0.15.0
23+
image: vitrivr/cottontaildb:0.15.2
2424
ports:
2525
- 1865:1865
2626
options: -it

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
[![Python package workflow](https://github.com/Spiess/cottontaildb-python-client/actions/workflows/python-package.yml/badge.svg)](https://github.com/Spiess/cottontaildb-python-client/actions/workflows/python-package.yml)
55

66
A Cottontail DB gRPC client for Python. Built with [Cottontail DB Proto](https://github.com/vitrivr/cottontaildb-proto)
7-
version `0.14.0`. Comes with an interactive CLI for remote DB access.
7+
version `0.14.3`. Comes with an interactive CLI for remote DB access.
8+
9+
Versions are numbered such that the first two numbers correspond with those of the compatible Cottontail DB Proto.
810

911
## Installation
1012

@@ -50,15 +52,13 @@ file in the [Cottontail DB Proto](https://github.com/vitrivr/cottontaildb-proto)
5052
The following is an approximate guide on how to do so from a terminal:
5153

5254
```bash
53-
# Get the latest version of the Cottontail DB proto
54-
wget https://github.com/vitrivr/cottontaildb-proto/raw/master/src/main/protobuf/cottontail.proto
55+
# Get the latest version of the Cottontail DB proto (and download to cottontaildb_client directory)
56+
wget https://github.com/vitrivr/cottontaildb-proto/raw/master/src/main/protobuf/cottontail.proto -P ./cottontaildb_client/
5557
# Install necessary python packages
5658
pip install grpcio grpcio-tools
5759
# Generate the gRPC client
58-
python -m grpc_tools.protoc -I. --python_out=. --grpc_python_out=. cottontail.proto
59-
# Update the client files (where PYTHON_CLIENT_PATH is the path to this repository)
60-
mv cottontail_pb2.py cottontail_pb2_grpc.py $PYTHON_CLIENT_PATH/cottontaildb_client/
60+
python -m grpc_tools.protoc -I. --python_out=. --grpc_python_out=. ./cottontaildb_client/cottontail.proto
6161
```
6262

63-
Finally, the line `import cottontail_pb2 as cottontail__pb2` in the file `cottontail_pb2_grpc.py` must be replaced
64-
with `from . import cottontail_pb2 as cottontail__pb2`.
63+
It is important that the path to the `cottontail.proto` file reflects the location of the gRPC Python files, such that
64+
the imports can be generated correctly.

cottontaildb_client/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
from .cottontail_pb2 import IndexType, Type, Literal
2-
from .cottontaildb_client import CottontailDBClient, column_def, float_vector
1+
from cottontaildb_client.cottontail_pb2 import IndexType, Type, Literal
2+
from cottontaildb_client.cottontaildb_client import CottontailDBClient, column_def, float_vector

cottontaildb_client/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from .cottontaildb_cli import cli
1+
from cottontaildb_client.cottontaildb_cli import cli
22

33
if __name__ == '__main__':
44
cli()

cottontaildb_client/cottontail_pb2.py

Lines changed: 246 additions & 267 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cottontaildb_client/cottontail_pb2_grpc.py

Lines changed: 127 additions & 127 deletions
Large diffs are not rendered by default.

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = cottontaildb-client
3-
version = 0.0.7
3+
version = 0.14.0
44
author = Florian Spiess
55
author_email = [email protected]
66
description = A Cottontail DB gRPC client.

0 commit comments

Comments
 (0)