From 1c7f0ea0b98da8e0fee010bfd4f041c30a28cfbd Mon Sep 17 00:00:00 2001 From: Thomas Chopitea Date: Wed, 2 Sep 2026 16:44:09 +0000 Subject: [PATCH] Suppress the false type error on assigning a CA bundle to verify requests documents verify as either a bool or a path to a CA bundle, and passing a path is what tls_cert is for. But requests ships no annotations, so a checker reading its source infers the attribute as bool from `self.verify = True` in Session.__init__, and reports the assignment as a type error: ERROR `str` is not assignable to attribute `verify` with type `bool` Both assignment sites carry the ignore; only the second had been reported. The ignore is bare rather than naming a rule because the name differs between checkers -- assignment for mypy, bad-assignment for ty -- and a code that does not match the checker in use is itself reported as an unused suppression. --- yeti/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yeti/api.py b/yeti/api.py index 6b0a737..3dc3c43 100644 --- a/yeti/api.py +++ b/yeti/api.py @@ -78,7 +78,7 @@ def __init__(self, url_root: str, tls_cert: str | None = None): self.client = requests.Session() self._tls_cert = tls_cert if tls_cert: - self.client.verify = self._tls_cert + self.client.verify = self._tls_cert # type: ignore self._headers = { "Content-Type": "application/json", } @@ -175,7 +175,7 @@ def auth_api_key(self, apikey: str | None = None) -> None: ) authd_session = requests.Session() if self._tls_cert: - authd_session.verify = self._tls_cert + authd_session.verify = self._tls_cert # type: ignore authd_session.headers.update({"authorization": f"Bearer {access_token}"}) self.client = authd_session