Refactor type casting in Cython files for improved clarity and consistency

- Updated various Cython files to explicitly cast types, enhancing type safety and readability.
- Adjusted the `engine_name` property in `InferenceEngine` and its subclasses to be set directly in the constructor.
- Modified the `request` method in `_SessionWithBase` to accept `*args` for better flexibility.
- Ensured proper type casting for return values in methods across multiple classes, including `Inference`, `CoreMLEngine`, and `TensorRTEngine`.

These changes aim to streamline the codebase and improve maintainability by enforcing consistent type usage.
This commit is contained in:
Oleksandr Bezdieniezhnykh
2026-03-30 06:17:16 +03:00
parent 3b30a17e11
commit fc57d677b4
16 changed files with 676 additions and 63 deletions
+2 -2
View File
@@ -35,14 +35,14 @@ class _SessionWithBase(requests.Session):
self._base = base.rstrip("/")
self._default_timeout = default_timeout
def request(self, method, url, **kwargs):
def request(self, method, url, *args, **kwargs):
if url.startswith("http://") or url.startswith("https://"):
full = url
else:
path = url if url.startswith("/") else f"/{url}"
full = f"{self._base}{path}"
kwargs.setdefault("timeout", self._default_timeout)
return super().request(method, full, **kwargs)
return super().request(method, full, *args, **kwargs)
@pytest.fixture(scope="session")