Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,9 @@ ignore = [
# We have an existing interface to support and so we do not want to change
# exception names.
"N818",
# Ignore this as there is a bug in ruff:
# See https://github.com/astral-sh/ruff/issues/6454.
"PLE1205",
# Ignore "too-many-*" errors as they seem to get in the way more than
# helping.
"PLR0913",
Expand Down Expand Up @@ -307,7 +310,7 @@ dev = [
"pytest-cov==4.1.0",
"pytest==7.4.0",
"requests-mock-flask==2023.5.14",
"ruff==0.0.282",
"ruff==0.0.283",
"sphinx-autodoc-typehints==1.24.0",
"sphinx-prompt==1.5.0",
"sphinx_paramlinks==0.5.4",
Expand Down
8 changes: 4 additions & 4 deletions src/mock_vws/_requests_mock_server/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import re
from contextlib import ContextDecorator
from typing import TYPE_CHECKING, Literal
from typing import TYPE_CHECKING, Literal, Self
from urllib.parse import urljoin, urlparse

import requests
Expand Down Expand Up @@ -42,7 +42,7 @@ def __init__(
base_vwq_url: str = "https://cloudreco.vuforia.com",
duplicate_match_checker: ImageMatcher = _AVERAGE_HASH_MATCHER,
query_match_checker: ImageMatcher = _AVERAGE_HASH_MATCHER,
processing_time_seconds: int | float = 2,
processing_time_seconds: float = 2,
target_tracking_rater: TargetTrackingRater = _BRISQUE_TRACKING_RATER,
*,
real_http: bool = False,
Expand Down Expand Up @@ -112,7 +112,7 @@ def add_database(self, database: VuforiaDatabase) -> None:
"""
self._target_manager.add_database(database=database)

def __enter__(self) -> MockVWS:
def __enter__(self) -> Self:
"""
Start an instance of a Vuforia mock.

Expand Down Expand Up @@ -151,7 +151,7 @@ def __enter__(self) -> MockVWS:

return self

def __exit__(self, *exc: tuple[None, None, None]) -> Literal[False]:
def __exit__(self, *exc: object) -> Literal[False]:
"""
Stop the Vuforia mock.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class MockVuforiaWebServicesAPI:
def __init__(
self,
target_manager: TargetManager,
processing_time_seconds: int | float,
processing_time_seconds: float,
duplicate_match_checker: ImageMatcher,
target_tracking_rater: TargetTrackingRater,
) -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/mock_vws/_services_validators/name_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,5 +226,5 @@ def validate_name_does_not_exist_existing_target(
if matching_name_target.target_id == target_id:
return

_LOGGER.warning(msg="Name already exists for another target.")
_LOGGER.warning("Name already exists for another target.")
raise TargetNameExist
2 changes: 1 addition & 1 deletion tests/mock_vws/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def __init__(

def make_image_file(
file_format: str,
color_space: Literal["L"] | Literal["RGB"] | Literal["CMYK"],
color_space: Literal["L", "RGB", "CMYK"],
width: int,
height: int,
) -> io.BytesIO:
Expand Down