Skip to content

Commit

Permalink
fix: CI formats
Browse files Browse the repository at this point in the history
revert: remove yq actions

Signed-off-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com>
  • Loading branch information
aarnphm committed Dec 14, 2021
1 parent 91791ec commit db6f305
Show file tree
Hide file tree
Showing 50 changed files with 62 additions and 56 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/ci.yml
Expand Up @@ -166,9 +166,6 @@ jobs:
python-version: ${{ matrix.python-version }}
architecture: x64

- name: Set foobar to cool
uses: mikefarah/yq@master

- name: Get pip cache dir
id: cache-dir
run: |
Expand Down Expand Up @@ -240,9 +237,6 @@ jobs:
run: |
echo ::set-output name=dir::$(pip cache dir)
- name: Set foobar to cool
uses: mikefarah/yq@master

- name: Cache pip dependencies
uses: actions/cache@v2
id: cache-pip
Expand Down
3 changes: 2 additions & 1 deletion bentoml/_internal/frameworks/catboost.py
Expand Up @@ -16,9 +16,10 @@
from ..configuration.containers import BentoMLContainer

if TYPE_CHECKING:
import numpy as np
from pandas.core.frame import DataFrame

import numpy as np

from ..models import ModelStore
else:
np = LazyLoader("np", globals(), "numpy")
Expand Down
2 changes: 1 addition & 1 deletion bentoml/_internal/frameworks/detectron.py
Expand Up @@ -2,10 +2,10 @@
import typing as t
from typing import TYPE_CHECKING

import numpy as np
from simple_di import inject
from simple_di import Provide

import numpy as np
from bentoml import Tag
from bentoml import Runner
from bentoml.exceptions import BentoMLException
Expand Down
2 changes: 1 addition & 1 deletion bentoml/_internal/frameworks/easyocr.py
Expand Up @@ -3,10 +3,10 @@
import typing as t
from typing import TYPE_CHECKING

import numpy as np
from simple_di import inject
from simple_di import Provide

import numpy as np
from bentoml import Tag
from bentoml import Runner
from bentoml.exceptions import BentoMLException
Expand Down
2 changes: 1 addition & 1 deletion bentoml/_internal/frameworks/gluon.py
@@ -1,10 +1,10 @@
import typing as t
from typing import TYPE_CHECKING

import numpy as np
from simple_di import inject
from simple_di import Provide

import numpy as np
from bentoml import Tag
from bentoml import Runner

Expand Down
2 changes: 1 addition & 1 deletion bentoml/_internal/frameworks/h2o.py
@@ -1,10 +1,10 @@
import typing as t
from typing import TYPE_CHECKING

import numpy as np
from simple_di import inject
from simple_di import Provide

import numpy as np
from bentoml import Tag
from bentoml import Runner
from bentoml.exceptions import BentoMLException
Expand Down
2 changes: 1 addition & 1 deletion bentoml/_internal/frameworks/keras.py
Expand Up @@ -4,11 +4,11 @@
from typing import TYPE_CHECKING
from pathlib import Path

import numpy as np
import cloudpickle
from simple_di import inject
from simple_di import Provide

import numpy as np
from bentoml import Tag
from bentoml.exceptions import BentoMLException
from bentoml.exceptions import MissingDependencyException
Expand Down
6 changes: 4 additions & 2 deletions bentoml/_internal/frameworks/onnx.py
Expand Up @@ -35,11 +35,12 @@
)

if TYPE_CHECKING:
import numpy as np
import torch
from pandas.core.frame import DataFrame
from tensorflow.python.framework.ops import Tensor as TFTensor

import numpy as np

from ..models import ModelStore

_ProviderType = t.List[t.Union[str, t.Tuple[str, t.Dict[str, t.Any]]]]
Expand Down Expand Up @@ -335,11 +336,12 @@ def _mapping(
]
) -> t.Any:
# TODO: check if imported before actual eval
import numpy as np
import torch
import pandas as pd
import tensorflow as tf

import numpy as np

if isinstance(item, np.ndarray):
item = item.astype(np.float32)
elif isinstance(item, pd.DataFrame):
Expand Down
2 changes: 1 addition & 1 deletion bentoml/_internal/frameworks/onnxmlir.py
Expand Up @@ -3,10 +3,10 @@
import typing as t
from typing import TYPE_CHECKING

import numpy as np
from simple_di import inject
from simple_di import Provide

import numpy as np
from bentoml import Tag
from bentoml import Runner
from bentoml.exceptions import BentoMLException
Expand Down
3 changes: 2 additions & 1 deletion bentoml/_internal/frameworks/paddle.py
Expand Up @@ -35,7 +35,6 @@
""" # noqa: LN001

if TYPE_CHECKING:
import numpy as np
import paddle
import paddle.nn
import paddlehub as hub
Expand All @@ -44,6 +43,8 @@
from paddle.static import InputSpec
from paddle.fluid.dygraph.dygraph_to_static.program_translator import StaticFunction

import numpy as np

from ..models import ModelStore

try:
Expand Down
3 changes: 2 additions & 1 deletion bentoml/_internal/frameworks/pytorch.py
Expand Up @@ -29,9 +29,10 @@
from ..models import ModelStore

try:
import numpy as np
import torch
import torch.nn.parallel as parallel

import numpy as np
except ImportError: # pragma: no cover
raise MissingDependencyException(
"""
Expand Down
3 changes: 2 additions & 1 deletion bentoml/_internal/frameworks/sklearn.py
Expand Up @@ -18,11 +18,12 @@
from ..configuration.containers import BentoMLContainer

if TYPE_CHECKING:
import numpy as np
from sklearn.base import BaseEstimator
from sklearn.pipeline import Pipeline
from pandas.core.frame import DataFrame

import numpy as np

from ..models import ModelStore

try:
Expand Down
2 changes: 1 addition & 1 deletion bentoml/_internal/frameworks/statsmodels.py
@@ -1,10 +1,10 @@
import typing as t
from typing import TYPE_CHECKING

import numpy as np
from simple_di import inject
from simple_di import Provide

import numpy as np
from bentoml import Tag
from bentoml import Runner
from bentoml.exceptions import BentoMLException
Expand Down
3 changes: 2 additions & 1 deletion bentoml/_internal/frameworks/tensorflow.py
Expand Up @@ -28,9 +28,10 @@
from ..configuration.containers import BentoMLContainer

if TYPE_CHECKING:
import numpy as np
import tensorflow.keras as keras

import numpy as np

from ..models import ModelStore

try:
Expand Down
2 changes: 1 addition & 1 deletion bentoml/_internal/frameworks/xgboost.py
@@ -1,10 +1,10 @@
import typing as t
from typing import TYPE_CHECKING

import numpy as np
from simple_di import inject
from simple_di import Provide

import numpy as np
from bentoml import Tag
from bentoml import Runner
from bentoml.exceptions import BentoMLException
Expand Down
3 changes: 2 additions & 1 deletion bentoml/_internal/io_descriptors/base.py
Expand Up @@ -9,11 +9,12 @@
from ..types import FileLike

if TYPE_CHECKING: # pragma: no cover
import numpy as np # noqa: F401
import pandas as pd # noqa: F401
import pydantic # noqa: F401
import PIL.Image # noqa: F401

import numpy as np # noqa: F401


JSONType = t.Union[str, t.Dict[str, t.Any], "pydantic.BaseModel"]

Expand Down
3 changes: 2 additions & 1 deletion bentoml/_internal/io_descriptors/image.py
Expand Up @@ -17,8 +17,9 @@

if TYPE_CHECKING:
import PIL
import numpy as np
import PIL.Image

import numpy as np
else:
np = LazyLoader("np", globals(), "numpy")

Expand Down
3 changes: 2 additions & 1 deletion bentoml/_internal/io_descriptors/json.py
Expand Up @@ -14,11 +14,12 @@
from ..utils.lazy_loader import LazyLoader

if TYPE_CHECKING:
import numpy as np
import pandas as pd
import pydantic
from pydantic import BaseModel
from pandas.core.frame import DataFrame # noqa: F401

import numpy as np
else: # pragma: no cover
np = LazyLoader("np", globals(), "numpy")
pd = LazyLoader("pd", globals(), "pandas")
Expand Down
3 changes: 2 additions & 1 deletion bentoml/_internal/runner/container.py
Expand Up @@ -15,9 +15,10 @@
IndexType = t.Union[None, int]

if TYPE_CHECKING:
import numpy as tnp # noqa
import pandas as pd

import numpy as tnp # noqa


class Payload(t.NamedTuple):
data: bytes
Expand Down
2 changes: 1 addition & 1 deletion scripts/tools/formatter.sh
Expand Up @@ -12,7 +12,7 @@ black --config ./pyproject.toml bentoml/ tests/ docker/

INFO "(black) Formatting VCS stubs..."

git ls-files -z -cm typings/** | xargs -0 -I {} black --config ./pyproject.toml --pyi {}
git ls-files -z -cm -- typings ':!:*.md' | xargs -0 -I {} -i sh -c 'echo "Processing "{}"..."; black --config ./pyproject.toml --pyi {}'

INFO "(isort) Reordering imports..."

Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/bento_server_general_features/pickle_model.py
@@ -1,8 +1,8 @@
import typing as t

import numpy as np
import pandas as pd

import numpy as np
from bentoml._internal.types import FileLike
from bentoml._internal.types import JSONSerializable

Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/bento_server_general_features/service.py
@@ -1,11 +1,11 @@
import typing as t

import numpy as np
import pandas as pd
import pydantic
from PIL.Image import Image as PILImage
from PIL.Image import fromarray

import numpy as np
import bentoml
import bentoml.sklearn
from bentoml.io import File
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/bento_server_general_features/tests/conftest.py
Expand Up @@ -3,9 +3,9 @@

import typing as t

import numpy as np
import pytest

import numpy as np
from bentoml.testing.server import run_api_server


Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/bento_server_general_features/tests/test_io.py
Expand Up @@ -3,10 +3,10 @@

import io

import numpy as np
import pytest
import aiohttp

import numpy as np
from bentoml.testing.utils import async_request
from bentoml.testing.utils import parse_multipart_form

Expand Down
@@ -1,8 +1,8 @@
import typing as t

import numpy as np
import pandas as pd

import numpy as np
from bentoml._internal.types import FileLike
from bentoml._internal.types import JSONSerializable

Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/bento_server_general_features_sync/service.py
@@ -1,11 +1,11 @@
import typing as t

import numpy as np
import pandas as pd
import pydantic
from PIL.Image import Image as PILImage
from PIL.Image import fromarray

import numpy as np
import bentoml
import bentoml.sklearn
from bentoml.io import File
Expand Down
Expand Up @@ -3,9 +3,9 @@

import typing as t

import numpy as np
import pytest

import numpy as np
from bentoml.testing.server import run_api_server


Expand Down
Expand Up @@ -3,10 +3,10 @@

import io

import numpy as np
import pytest
import aiohttp

import numpy as np
from bentoml.testing.utils import async_request
from bentoml.testing.utils import parse_multipart_form

Expand Down
@@ -1,10 +1,10 @@
import os
from pathlib import Path

import numpy as np
import psutil
import pytest

import numpy as np
import bentoml
from bentoml.exceptions import BentoMLException
from tests.utils.helpers import assert_have_file_extension
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/frameworks/paddle/conftest.py
@@ -1,11 +1,11 @@
import random

import numpy as np
import paddle
import pandas as pd
import pytest
import paddle.nn as nn

import numpy as np
from tests.utils.frameworks.paddle_utils import LinearModel

BATCH_SIZE = 8
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/frameworks/paddle/test_paddle_impl.py
@@ -1,9 +1,9 @@
import numpy as np
import paddle
import pytest
import paddle.nn as nn
from paddle.static import InputSpec

import numpy as np
import bentoml
from tests.utils.helpers import assert_have_file_extension
from tests.utils.frameworks.paddle_utils import test_df
Expand Down

0 comments on commit db6f305

Please sign in to comment.