Fix types @ galaxy.collection.galaxy_api_proxy

This includes enforcing `strict_optional` for the
`ansible.galaxy.collection.galaxy_api_proxy` module in MyPy.
This commit is contained in:
Sviatoslav Sydorenko 2025-11-28 23:39:35 +01:00 committed by 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко)
parent be8152a2b1
commit e05b6e7475
2 changed files with 5 additions and 2 deletions

View file

@ -34,7 +34,7 @@ class MultiGalaxyAPIProxy:
self._offline = offline # Prevent all GalaxyAPI calls
@property
def is_offline_mode_requested(self):
def is_offline_mode_requested(self) -> bool:
return self._offline
def _assert_that_offline_mode_is_not_requested(self) -> None:
@ -117,7 +117,7 @@ class MultiGalaxyAPIProxy:
else self._apis
)
last_err: t.Optional[Exception]
last_err: Exception
for api in api_lookup_order:
try:

View file

@ -23,6 +23,9 @@ ignore_missing_imports = True
[mypy-ansible_test.*]
ignore_missing_imports = True
[mypy-ansible.galaxy.collection.galaxy_api_proxy]
strict_optional = True
[mypy-ansible.galaxy.collection.gpg]
strict_optional = True