Skip to content

Commit

Permalink
💚 Linters are happy
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmytro Parfeniuk committed Aug 30, 2024
1 parent 29e38e4 commit 4b3b4b5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/guidellm/backend/deepsparse/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
),
)

from .backend import DeepsparseBackend
from .backend import DeepsparseBackend # noqa: E402

__all__ = ["DeepsparseBackend"]
6 changes: 3 additions & 3 deletions src/guidellm/utils/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ def check_python_version(
)

if not (min_version_info <= current_version_info <= max_version_info):
if raise_error:
if raise_error is False:
return False
else:
raise RuntimeError(
"This feature requires Python version "
f"to be in range: {min_version}..{max_version}."
Expand All @@ -44,8 +46,6 @@ def check_python_version(
sys.version_info.micro,
)
)
else:
return False
else:
return True

Expand Down
21 changes: 6 additions & 15 deletions tests/unit/backend/test_deepsparse_backend.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import sys
from typing import Any, Dict, Generator, List, Optional, cast
from typing import Any, Dict, Generator, List, Optional

import pytest
from pydantic import BaseModel
Expand Down Expand Up @@ -94,13 +94,10 @@ def test_backend_creation(create_payload: Dict, backend_class):
with defaults and custom input parameters.
"""

backends: List[backend_class] = cast(
List[backend_class],
[
Backend.create("deepsparse", **create_payload),
backend_class(**create_payload),
],
)
backends = [
Backend.create("deepsparse", **create_payload),
backend_class(**create_payload),
]

for backend in backends:
assert backend.pipeline
Expand All @@ -120,13 +117,7 @@ def test_backend_model_from_env(mocker, backend_class):

reload_settings()

backends: List[backend_class] = cast(
List[backend_class],
[
Backend.create("deepsparse"),
backend_class(),
],
)
backends = [Backend.create("deepsparse"), backend_class()]

for backend in backends:
assert backend.model == "test_backend_model_from_env"
Expand Down

0 comments on commit 4b3b4b5

Please sign in to comment.