Skip to content

Commit fc4949b

Browse files
committed
Merge remote-tracking branch 'origin/main' into switch-to-responses
2 parents b7d4bbc + 9a74117 commit fc4949b

File tree

6 files changed

+10
-11
lines changed

6 files changed

+10
-11
lines changed

docs/source/docker.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ VWS container
136136

137137
The number of seconds to process each image for.
138138

139-
Default: ``2``
139+
Default: ``2.0``
140140

141141
.. envvar:: DUPLICATES_IMAGE_MATCHER
142142

src/mock_vws/_flask_server/vws.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import uuid
1313
from enum import StrEnum, auto
1414
from http import HTTPMethod, HTTPStatus
15-
from typing import SupportsFloat
1615

1716
import requests
1817
from flask import Flask, Response, request
@@ -67,7 +66,7 @@ class VWSSettings(BaseSettings):
6766
"""Settings for the VWS Flask app."""
6867

6968
target_manager_base_url: str
70-
processing_time_seconds: SupportsFloat = 2
69+
processing_time_seconds: float = 2.0
7170
vws_host: str = ""
7271
duplicates_image_matcher: _ImageMatcherChoice = (
7372
_ImageMatcherChoice.STRUCTURAL_SIMILARITY

src/mock_vws/_requests_mock_server/decorators.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import re
66
from contextlib import ContextDecorator
7-
from typing import Literal, Self, SupportsFloat
7+
from typing import Literal, Self
88
from urllib.parse import urljoin, urlparse
99

1010
import requests
@@ -39,7 +39,7 @@ def __init__(
3939
base_vwq_url: str = "https://cloudreco.vuforia.com",
4040
duplicate_match_checker: ImageMatcher = _STRUCTURAL_SIMILARITY_MATCHER,
4141
query_match_checker: ImageMatcher = _STRUCTURAL_SIMILARITY_MATCHER,
42-
processing_time_seconds: SupportsFloat = 2,
42+
processing_time_seconds: float = 2.0,
4343
target_tracking_rater: TargetTrackingRater = _BRISQUE_TRACKING_RATER,
4444
*,
4545
real_http: bool = False,

src/mock_vws/_requests_mock_server/mock_web_services_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import uuid
1414
from collections.abc import Callable
1515
from http import HTTPMethod, HTTPStatus
16-
from typing import Any, SupportsFloat
16+
from typing import Any
1717
from zoneinfo import ZoneInfo
1818

1919
from requests.models import PreparedRequest
@@ -101,7 +101,7 @@ def __init__(
101101
self,
102102
*,
103103
target_manager: TargetManager,
104-
processing_time_seconds: SupportsFloat,
104+
processing_time_seconds: float,
105105
duplicate_match_checker: ImageMatcher,
106106
target_tracking_rater: TargetTrackingRater,
107107
) -> None:

src/mock_vws/target.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import statistics
99
import uuid
1010
from dataclasses import dataclass, field
11-
from typing import Self, SupportsFloat, TypedDict
11+
from typing import Self, TypedDict
1212
from zoneinfo import ZoneInfo
1313

1414
from PIL import Image, ImageStat
@@ -29,7 +29,7 @@ class TargetDict(TypedDict):
2929
width: float
3030
image_base64: str
3131
active_flag: bool
32-
processing_time_seconds: SupportsFloat
32+
processing_time_seconds: float
3333
application_metadata: str | None
3434
target_id: str
3535
last_modified_date: str
@@ -64,7 +64,7 @@ class Target:
6464
application_metadata: str | None
6565
image_value: bytes
6666
name: str
67-
processing_time_seconds: SupportsFloat
67+
processing_time_seconds: float
6868
width: float
6969
target_tracking_rater: TargetTrackingRater = field(compare=False)
7070
current_month_recos: int = 0

tests/mock_vws/test_flask_app_usage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def test_custom(
9090
"""
9191
It is possible to set a custom processing time.
9292
"""
93-
seconds = 5
93+
seconds = 5.0
9494
monkeypatch.setenv(
9595
name="PROCESSING_TIME_SECONDS",
9696
value=str(seconds),

0 commit comments

Comments
 (0)