Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
4a0e617
feat: bump protobuf
May 26, 2022
e625741
fix: fix flake8
May 26, 2022
9698e75
fix(protobuf): set python parsing for tf and paddle
hanxiao May 26, 2022
72f4a05
test: do not use special flag
Jul 5, 2022
37b7f55
Merge branch 'main' into bump-protobuf
hanxiao Aug 21, 2022
3496cf4
feat: flexible build proto script
alaeddine-13 Aug 23, 2022
4de9687
feat: flexible import of proto modules
alaeddine-13 Aug 23, 2022
d8a17ca
chore: update proto compiling instructions
alaeddine-13 Aug 23, 2022
420acb5
chore: update usages of proto
alaeddine-13 Aug 23, 2022
386342c
chore: remove print
alaeddine-13 Aug 23, 2022
850d6e0
chore: free protobuf version
alaeddine-13 Aug 23, 2022
1e19724
fix: merge conflict
alaeddine-13 Aug 23, 2022
a73b507
Merge branch 'bump-protobuf' of github.com:jina-ai/docarray into bump…
alaeddine-13 Aug 23, 2022
f36312e
chore: update config files
alaeddine-13 Aug 23, 2022
2bc9e75
ci: install test tag before full
alaeddine-13 Aug 23, 2022
1a9569f
fix: change proto usage
alaeddine-13 Aug 23, 2022
26c3e07
Merge branch 'main' into bump-protobuf
alaeddine-13 Aug 23, 2022
979488f
Merge branch 'main' into bump-protobuf
alaeddine-13 Aug 23, 2022
963b6b0
chore: expose all pb2 module for dependents
alaeddine-13 Aug 23, 2022
4a376d7
chore: add comment to explain
alaeddine-13 Aug 24, 2022
1a1e65a
chore: increase version
alaeddine-13 Aug 24, 2022
ac66a5d
ci: install modified jina in CI
alaeddine-13 Aug 24, 2022
7aa0241
Merge branch 'main' into bump-protobuf
alaeddine-13 Aug 24, 2022
27c4b1b
fix: preserver file structure for compatibility
alaeddine-13 Aug 24, 2022
70e3e2f
Revert "chore: update usages of proto"
alaeddine-13 Aug 25, 2022
9b115b7
Revert "fix: change proto usage"
alaeddine-13 Aug 25, 2022
f1208ba
Merge branch 'main' into bump-protobuf
alaeddine-13 Aug 25, 2022
1f0f517
Merge branch 'main' into bump-protobuf
hanxiao Aug 26, 2022
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
4 changes: 3 additions & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install wheel
pip install --no-cache-dir ".[full,test]"
# pip does not properly resolve dependency versions with syntax pip install --no-cache-dir ".[test,full]"
pip install --no-cache-dir ".[test]"
pip install --no-cache-dir ".[full]"
sudo apt-get install libsndfile1
- name: Test
id: test
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ jobs:
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude .git,__pycache__,docs/source/conf.py,old,build,dist,tests/,jina/resources/
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude .git,__pycache__,docs/source/conf.py,old,build,dist,tests/,docarray/proto/pb/docarray_pb2.py,docarray/proto/pb2/docarray_pb2.py
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude .git,__pycache__,docs/source/conf.py,old,build,dist,tests/,jina/resources/
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude .git,__pycache__,docs/source/conf.py,old,build,dist,tests/,docarray/proto/pb/docarray_pb2.py,docarray/proto/pb2/docarray_pb2.py

check-black:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -129,7 +129,11 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install wheel
pip install --no-cache-dir ".[full,test]"
# test install jina with new proto version
pip install git+https://github.com/jina-ai/jina.git@feat-bump-protobuf
# pip does not properly resolve dependency versions with syntax pip install --no-cache-dir ".[test,full]"
pip install --no-cache-dir ".[test]"
pip install --no-cache-dir ".[full]"
sudo apt-get install libsndfile1
- name: Test
id: test
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ repos:
hooks:
- id: black
types: [python]
exclude: ^(docarray/proto/docarray_pb2.py|docs/|docarray/resources/)
exclude: ^(docarray/proto/pb/docarray_pb2.py|docarray/proto/pb2/docarray_pb2.py|docs/|docarray/resources/)
args:
- -S
- repo: https://github.com/asottile/blacken-docs
Expand Down
2 changes: 1 addition & 1 deletion docarray/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '0.15.5'
__version__ = '0.16.0'

import os

Expand Down
2 changes: 1 addition & 1 deletion docarray/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def get_full_version() -> Dict:
return {
'docarray': __version__,
'protobuf': google.protobuf.__version__,
'proto-backend': api_implementation._default_implementation_type,
'proto-backend': api_implementation.Type(),
'python': platform.python_version(),
'platform': platform.system(),
'platform-release': platform.release(),
Expand Down
17 changes: 13 additions & 4 deletions docarray/proto/build-proto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,25 @@
set -ex

# Do NOT use this directly, use jinaai/protogen image
# use jinaai/protogen:3.21 in order to use compiler version == 21 (creates pb/docarray_pb2.py)
# and use jinaai/protogen:latest to use compiler version <= 20 (creates pb2/docarray_pb2.py)
# make sure to use jinaai/protogen:3.21 to avoid overriting the module
#
# current dir: docarray root (the one with README.md)
# current dir: docarray/docarray
# run the following in bash:
# docker run -v $(pwd)/proto:/jina/proto jinaai/protogen
# finally, set back owner of the generated files using: sudo chown -R $(id -u ${USER}):$(id -g ${USER}) .

SRC_DIR=./
SRC_NAME=docarray.proto
MODULE=docarray
SRC_NAME="${MODULE}.proto"
COMP_OUT_NAME="${MODULE}_pb2.py"

OUT_FOLDER="${2:-pb2}/"

VER_FILE=../__init__.py

if [ "$#" -ne 1 ]; then
if [ "$#" -ne 1 ] && [ "$#" -ne 2 ]; then
echo "Error: Please specify the [PATH_TO_GRPC_PYTHON_PLUGIN], refer more details at " \
"https://docarray.jina.ai/"
printf "\n"
Expand All @@ -25,4 +34,4 @@ PLUGIN_PATH=${1} # /Volumes/TOSHIBA-4T/Documents/grpc/bins/opt/grpc_python_plug

printf "\e[1;33mgenerating protobuf and grpc python interface\e[0m\n"

protoc -I ${SRC_DIR} --python_out=${SRC_DIR} ${SRC_DIR}${SRC_NAME}
protoc -I ${SRC_DIR} --python_out="${SRC_DIR}${OUT_FOLDER}" ${SRC_DIR}${SRC_NAME}
Loading