Skip to content

Commit

Permalink
style: fix overload and cli autocomplete
Browse files Browse the repository at this point in the history
  • Loading branch information
jina-bot authored and JoanFM committed Dec 18, 2024
1 parent 777240a commit ef8751f
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 34 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.8]
python-version: ["3.10"]
protobuf-version: ['==3.19.6', '']
steps:
- uses: actions/[email protected]
Expand All @@ -127,7 +127,7 @@ jobs:
- name: Build wheels with setuptools-golang-build-manylinux-wheel
run: |
setuptools-golang-build-manylinux-wheels --pythons cp38-cp38
setuptools-golang-build-manylinux-wheels --pythons cp310-cp310
- name: Prepare environment
run: |
docker build -f Dockerfiles/test-pip.Dockerfile -t jinaai/jina:test-pip .
Expand Down Expand Up @@ -180,7 +180,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.8]
python-version: ["3.10"]
protobuf-version: ['==3.19.6', '']
steps:
- uses: actions/[email protected]
Expand All @@ -202,7 +202,7 @@ jobs:
- name: Build wheels with setuptools-golang-build-manylinux-wheel
run: |
setuptools-golang-build-manylinux-wheels --pythons cp38-cp38
setuptools-golang-build-manylinux-wheels --pythons cp310-cp310
- name: Prepare environment
run: |
docker build -f Dockerfiles/test-pip.Dockerfile -t jinaai/jina:test-pip .
Expand Down Expand Up @@ -448,7 +448,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.10]
python-version: ["3.10"]
test-path: ${{fromJson(needs.prep-testbed.outputs.matrix)}}
steps:
- uses: actions/[email protected]
Expand All @@ -470,7 +470,7 @@ jobs:
- name: Build wheels with setuptools-golang-build-manylinux-wheel
run: |
setuptools-golang-build-manylinux-wheels --pythons cp38-cp38
setuptools-golang-build-manylinux-wheels --pythons cp310-cp310
- name: Prepare environment
run: |
docker build --build-arg DOCARRAY_VERSION="0.21.0" -f Dockerfiles/test-pip.Dockerfile -t jinaai/jina:test-pip .
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.10]
python-version: ["3.10"]
protobuf-version: ['==3.19.6', '']
steps:
- uses: actions/[email protected]
Expand All @@ -461,7 +461,7 @@ jobs:
- name: Build wheels with setuptools-golang-build-manylinux-wheel
run: |
setuptools-golang-build-manylinux-wheels --pythons cp38-cp38
setuptools-golang-build-manylinux-wheels --pythons cp310-cp310
- name: Prepare environment
run: |
docker build -f Dockerfiles/test-pip.Dockerfile -t jinaai/jina:test-pip .
Expand Down Expand Up @@ -515,7 +515,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.10]
python-version: ["3.10"]
protobuf-version: ['==3.19.6', '']
steps:
- uses: actions/[email protected]
Expand All @@ -537,7 +537,7 @@ jobs:
- name: Build wheels with setuptools-golang-build-manylinux-wheel
run: |
setuptools-golang-build-manylinux-wheels --pythons cp38-cp38
setuptools-golang-build-manylinux-wheels --pythons cp310-cp310
- name: Prepare environment
run: |
docker build -f Dockerfiles/test-pip.Dockerfile -t jinaai/jina:test-pip .
Expand Down Expand Up @@ -700,7 +700,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.10]
python-version: ["3.10"]
test-path: ${{fromJson(needs.prep-testbed.outputs.matrix)}}
steps:
- uses: actions/[email protected]
Expand All @@ -722,7 +722,7 @@ jobs:
- name: Build wheels with setuptools-golang-build-manylinux-wheel
run: |
setuptools-golang-build-manylinux-wheels --pythons cp38-cp38
setuptools-golang-build-manylinux-wheels --pythons cp310-cp310
- name: Prepare environment
run: |
docker build --build-arg DOCARRAY_VERSION="0.21.0" -f Dockerfiles/test-pip.Dockerfile -t jinaai/jina:test-pip .
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/force-docs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ jobs:
run: |
touch /tmp/gen-html/.nojekyll
cp ./docs/_versions.json /tmp/gen-html/_versions.json
cp ./docs/CNAME /tmp/gen-html/CNAME
cp /tmp/gen-html/404/index.html /tmp/gen-html/404.html
sed -i 's/href="\.\./href="/' /tmp/gen-html/404.html # fix asset urls that needs to be updated in 404.html
- name: Moving old doc versions
Expand Down
2 changes: 1 addition & 1 deletion Dockerfiles/debianx.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# !!! An ARG declared before a FROM is outside of a build stage, so it can’t be used in any instruction after a FROM
ARG PY_VERSION=3.7
ARG PY_VERSION=3.10

FROM python:${PY_VERSION}-slim AS jina_dep

Expand Down
2 changes: 1 addition & 1 deletion Dockerfiles/pip-perf.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG PY_VERSION=3.7
ARG PY_VERSION=3.10
ARG PIP_TAG

FROM python:${PY_VERSION}-slim
Expand Down
2 changes: 1 addition & 1 deletion Dockerfiles/pip.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG PY_VERSION=3.8
ARG PY_VERSION=3.10
ARG PIP_TAG

FROM python:${PY_VERSION}-slim
Expand Down
2 changes: 1 addition & 1 deletion Dockerfiles/test-pip.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG PY_VERSION=3.8
ARG PY_VERSION=3.10

FROM python:${PY_VERSION}-slim

Expand Down
8 changes: 4 additions & 4 deletions jina/orchestrate/deployments/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,15 +262,15 @@ def __init__(
docker_kwargs: Optional[dict] = None,
entrypoint: Optional[str] = None,
env: Optional[dict] = None,
exit_on_exceptions: Optional[List[str]] = [],
exit_on_exceptions: Optional[List] = [],
external: Optional[bool] = False,
floating: Optional[bool] = False,
force_update: Optional[bool] = False,
gpus: Optional[str] = None,
grpc_channel_options: Optional[dict] = None,
grpc_metadata: Optional[dict] = None,
grpc_server_options: Optional[dict] = None,
host: Optional[List[str]] = ['0.0.0.0'],
host: Optional[List] = ['0.0.0.0'],
install_requirements: Optional[bool] = False,
log_config: Optional[str] = None,
metrics: Optional[bool] = False,
Expand All @@ -288,7 +288,7 @@ def __init__(
protocol: Optional[Union[str, List[str]]] = ['GRPC'],
provider: Optional[str] = ['NONE'],
provider_endpoint: Optional[str] = None,
py_modules: Optional[List[str]] = None,
py_modules: Optional[List] = None,
quiet: Optional[bool] = False,
quiet_error: Optional[bool] = False,
raft_configuration: Optional[dict] = None,
Expand Down Expand Up @@ -318,7 +318,7 @@ def __init__(
uses_requests: Optional[dict] = None,
uses_with: Optional[dict] = None,
uvicorn_kwargs: Optional[dict] = None,
volumes: Optional[List[str]] = None,
volumes: Optional[List] = None,
when: Optional[dict] = None,
workspace: Optional[str] = None,
**kwargs,
Expand Down
12 changes: 6 additions & 6 deletions jina/orchestrate/flow/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def __init__(
provider: Optional[str] = ['NONE'],
provider_endpoint: Optional[str] = None,
proxy: Optional[bool] = False,
py_modules: Optional[List[str]] = None,
py_modules: Optional[List] = None,
quiet: Optional[bool] = False,
quiet_error: Optional[bool] = False,
reload: Optional[bool] = False,
Expand Down Expand Up @@ -848,15 +848,15 @@ def add(
docker_kwargs: Optional[dict] = None,
entrypoint: Optional[str] = None,
env: Optional[dict] = None,
exit_on_exceptions: Optional[List[str]] = [],
exit_on_exceptions: Optional[List] = [],
external: Optional[bool] = False,
floating: Optional[bool] = False,
force_update: Optional[bool] = False,
gpus: Optional[str] = None,
grpc_channel_options: Optional[dict] = None,
grpc_metadata: Optional[dict] = None,
grpc_server_options: Optional[dict] = None,
host: Optional[List[str]] = ['0.0.0.0'],
host: Optional[List] = ['0.0.0.0'],
install_requirements: Optional[bool] = False,
log_config: Optional[str] = None,
metrics: Optional[bool] = False,
Expand All @@ -874,7 +874,7 @@ def add(
protocol: Optional[Union[str, List[str]]] = ['GRPC'],
provider: Optional[str] = ['NONE'],
provider_endpoint: Optional[str] = None,
py_modules: Optional[List[str]] = None,
py_modules: Optional[List] = None,
quiet: Optional[bool] = False,
quiet_error: Optional[bool] = False,
raft_configuration: Optional[dict] = None,
Expand Down Expand Up @@ -904,7 +904,7 @@ def add(
uses_requests: Optional[dict] = None,
uses_with: Optional[dict] = None,
uvicorn_kwargs: Optional[dict] = None,
volumes: Optional[List[str]] = None,
volumes: Optional[List] = None,
when: Optional[dict] = None,
workspace: Optional[str] = None,
**kwargs,
Expand Down Expand Up @@ -1336,7 +1336,7 @@ def config_gateway(
provider: Optional[str] = ['NONE'],
provider_endpoint: Optional[str] = None,
proxy: Optional[bool] = False,
py_modules: Optional[List[str]] = None,
py_modules: Optional[List] = None,
quiet: Optional[bool] = False,
quiet_error: Optional[bool] = False,
reload: Optional[bool] = False,
Expand Down
8 changes: 4 additions & 4 deletions jina/serve/executors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1002,15 +1002,15 @@ def serve(
docker_kwargs: Optional[dict] = None,
entrypoint: Optional[str] = None,
env: Optional[dict] = None,
exit_on_exceptions: Optional[List[str]] = [],
exit_on_exceptions: Optional[List] = [],
external: Optional[bool] = False,
floating: Optional[bool] = False,
force_update: Optional[bool] = False,
gpus: Optional[str] = None,
grpc_channel_options: Optional[dict] = None,
grpc_metadata: Optional[dict] = None,
grpc_server_options: Optional[dict] = None,
host: Optional[List[str]] = ['0.0.0.0'],
host: Optional[List] = ['0.0.0.0'],
install_requirements: Optional[bool] = False,
log_config: Optional[str] = None,
metrics: Optional[bool] = False,
Expand All @@ -1028,7 +1028,7 @@ def serve(
protocol: Optional[Union[str, List[str]]] = ['GRPC'],
provider: Optional[str] = ['NONE'],
provider_endpoint: Optional[str] = None,
py_modules: Optional[List[str]] = None,
py_modules: Optional[List] = None,
quiet: Optional[bool] = False,
quiet_error: Optional[bool] = False,
raft_configuration: Optional[dict] = None,
Expand Down Expand Up @@ -1058,7 +1058,7 @@ def serve(
uses_requests: Optional[dict] = None,
uses_with: Optional[dict] = None,
uvicorn_kwargs: Optional[dict] = None,
volumes: Optional[List[str]] = None,
volumes: Optional[List] = None,
when: Optional[dict] = None,
workspace: Optional[str] = None,
**kwargs,
Expand Down
6 changes: 3 additions & 3 deletions tests/integration/docarray_v2/test_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def search(
@pytest.mark.parametrize('replicas', [1, 3])
def test_different_document_schema(protocols, replicas):
class Image(BaseDoc):
tensor: Optional[AnyTensor]
#tensor: Optional[AnyTensor]
url: ImageUrl
lll: List[List[str]] = [[]]
texts: DocList[TextDoc]
Expand All @@ -182,7 +182,7 @@ class MyExecDifSchema(Executor):
@requests(on='/foo')
def foo(self, docs: DocList[Image], **kwargs) -> DocList[Image]:
for doc in docs:
doc.tensor = np.zeros((10, 10, 10))
#doc.tensor = np.zeros((10, 10, 10))
doc.lll = [['aa'], ['bb']]
doc.texts.append(TextDoc('ha'))
return docs
Expand All @@ -205,7 +205,7 @@ def foo(self, docs: DocList[Image], **kwargs) -> DocList[Image]:
return_type=DocList[Image],
)
docs = docs.to_doc_vec()
assert docs.tensor.ndim == 4
#assert docs.tensor.ndim == 4
assert docs[0].lll == [['aa'], ['bb']]
assert len(docs[0].texts) == 2
assert docs[0].texts[0].text == 'hey'
Expand Down

0 comments on commit ef8751f

Please sign in to comment.