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

enhance: [2.4]Expand grpcio version to latest #2096

Merged
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
1 change: 1 addition & 0 deletions .github/workflows/check_milvus_proto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@ jobs:
- name: Try generate proto
run: |
git submodule update --init
make gen_proto
make check_proto_product

2 changes: 1 addition & 1 deletion .github/workflows/code_checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
pip install -e .
- name: Install requirements
run: |
pip install -r requirements.txt
pip install -e ".[dev]"
- name: Run pylint
shell: bash
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[test]"
pip install -e ".[dev]"

- name: Test with pytest
run: |
Expand Down
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ unittest:
PYTHONPATH=`pwd` python3 -m pytest tests --cov=pymilvus -v

lint:
PYTHONPATH=`pwd` black pymilvus --check
PYTHONPATH=`pwd` ruff check pymilvus
PYTHONPATH=`pwd` python3 -m black pymilvus --check
PYTHONPATH=`pwd` python3 -m ruff check pymilvus

format:
PYTHONPATH=`pwd` black pymilvus
PYTHONPATH=`pwd` ruff check pymilvus --fix
PYTHONPATH=`pwd` python3 -m black pymilvus
PYTHONPATH=`pwd` python3 -m ruff check pymilvus --fix

codecov:
PYTHONPATH=`pwd` pytest --cov=pymilvus --cov-report=xml tests -x -v -rxXs
Expand All @@ -25,6 +25,7 @@ get_proto:
git submodule update --init

gen_proto:
python3 -m pip install -e ".[dev]"
cd pymilvus/grpc_gen && ./python_gen.sh

check_proto_product: gen_proto
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ You can install PyMilvus via `pip` or `pip3` for Python 3.8+:
```shell
$ pip3 install pymilvus
$ pip3 install pymilvus[model] # for milvus-model
$ pip3 install pymilvus[bulk_writer] # for bulk_writer
```

You can install a specific version of PyMilvus by:
Expand All @@ -62,8 +63,6 @@ $ git submodule update --init

Q2. How to generate python files from milvus-proto?

**Before generating python files, please install requirements in `requirements.txt`**

A2.
```shell
$ make gen_proto
Expand Down Expand Up @@ -94,10 +93,10 @@ Q6. How to run unittests?

A6
```shell
$ pip install ".[test]"
$ pip install ".[dev]"
$ make unittest
```
Q7. `zsh: no matches found: pymilvus[model]` in mac, how do I solve this?
Q7. `zsh: no matches found: pymilvus[model]`, how do I solve this?

A7
```shell
Expand Down
2 changes: 1 addition & 1 deletion pymilvus/grpc_gen/common_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pymilvus/grpc_gen/feder_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pymilvus/grpc_gen/milvus_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pymilvus/grpc_gen/msg_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions pymilvus/grpc_gen/python_gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
OUTDIR=.
PROTO_DIR="milvus-proto/proto"

python -m pip install "grpcio-tools==$(python3 -c 'import grpc; print(grpc.__version__)')"

python -m grpc_tools.protoc -I ${PROTO_DIR} --python_out=${OUTDIR} --pyi_out=${OUTDIR} ${PROTO_DIR}/common.proto
python -m grpc_tools.protoc -I ${PROTO_DIR} --python_out=${OUTDIR} --pyi_out=${OUTDIR} ${PROTO_DIR}/schema.proto
python -m grpc_tools.protoc -I ${PROTO_DIR} --python_out=${OUTDIR} --pyi_out=${OUTDIR} ${PROTO_DIR}/feder.proto
Expand Down
2 changes: 1 addition & 1 deletion pymilvus/grpc_gen/rg_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pymilvus/grpc_gen/schema_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ description = "Python Sdk for Milvus"
readme = "README.md"
dependencies=[
"setuptools >= 67", # python3.12 pkg_resources
"grpcio>=1.49.1,<=1.60.0",
"grpcio>=1.49.1, <=1.63.0",
"protobuf>=3.20.0",
"environs<=9.5.0",
"ujson>=2.0.0",
Expand Down Expand Up @@ -49,11 +49,15 @@ model = [
"milvus-model>=0.1.0",
]

test = [
dev = [
# The generated codes of 1.63.0 is incompatible with versions < 1.63.0,
# so we use fixed grpcio version to develop.
"grpcio==1.62.2",
"grpcio-tools==1.62.2",
"grpcio-testing==1.62.2",
"pytest>=5.3.4",
"pytest-cov>=2.8.1",
"pytest-timeout>=1.3.4",
"grpcio-testing",
"ruff>0.4.0",
"black",
]
Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ build==0.4.0
certifi==2023.7.22
chardet==4.0.0
environs==9.5.0
grpcio==1.60.0
grpcio-testing==1.60.0
grpcio-tools==1.60.0
grpcio==1.62.2
grpcio-testing==1.62.2
grpcio-tools==1.62.2
protobuf==4.25.2
idna==2.10
packaging==20.9
Expand Down