Skip to content

Commit d46bf2e

Browse files
authored
Remove stamina (#16)
1 parent 11a1afd commit d46bf2e

File tree

3 files changed

+1
-16
lines changed

3 files changed

+1
-16
lines changed

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ dependencies = [
1919
"httpx",
2020
"aioboto3",
2121
"types-aioboto3[s3]",
22-
"stamina",
2322
"pydantic",
2423
"pyvips",
2524
"pyvips-binary",

safe_s3_storage/kaspersky_scan_engine.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11
import base64
22
import dataclasses
33
import enum
4-
import logging
54
import typing
65

76
import httpx
87
import pydantic
9-
import stamina
108

119
from safe_s3_storage.exceptions import KasperskyScanEngineConnectionStatusError, KasperskyScanEngineThreatDetectedError
1210

1311

14-
kaspersky_logger: typing.Final = logging.getLogger(__name__)
15-
kaspersky_logger.setLevel(logging.ERROR)
16-
17-
1812
class KasperskyScanEngineRequest(pydantic.BaseModel):
1913
timeout: str
2014
object: str
@@ -53,9 +47,7 @@ async def scan_memory(self, *, file_name: str, file_content: bytes) -> None:
5347
timeout=str(self.timeout_ms), object=base64.b64encode(file_content).decode(), name=self.client_name
5448
).model_dump(mode="json")
5549
try:
56-
response: typing.Final = await stamina.retry(on=httpx.HTTPError, attempts=self.max_retries)(
57-
self._send_scan_memory_request
58-
)(payload)
50+
response: typing.Final = await self._send_scan_memory_request(payload)
5951
except httpx.HTTPStatusError as exc:
6052
raise KasperskyScanEngineConnectionStatusError from exc
6153
validated_response: typing.Final = KasperskyScanEngineResponse.model_validate_json(response)

tests/conftest.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,13 @@
22

33
import faker
44
import pytest
5-
import stamina
65

76

87
@pytest.fixture(scope="session", autouse=True)
98
def anyio_backend() -> str:
109
return "asyncio"
1110

1211

13-
@pytest.fixture(scope="session", autouse=True)
14-
def deactivate_retries() -> None:
15-
stamina.set_active(False)
16-
17-
1812
MIME_OCTET_STREAM: typing.Final = "application/octet-stream"
1913

2014

0 commit comments

Comments
 (0)