chore: add mypy coverage to inspect.py and library_client.py in /distribution (#2707)

# What does this PR do?
Adds type guards in /distribution/inspect.py and ignores a valid-type
mypy error in library_client.py. This PR is part of issue #2647 . I'm
rather unsure whether ignoring the valid-type error is correct in this
case. It appears that args[0] is interpreted as [any] but I didn't find
any way to specify the type.

<!-- If resolving an issue, uncomment and update the line below -->
<!-- Closes #[issue-number] -->


<!-- Describe the tests you ran to verify your changes with result
summaries. *Provide clear instructions so the plan can be easily
re-executed.* -->
This commit is contained in:
Stefan Thaler 2025-07-24 17:51:46 +01:00 committed by GitHub
parent d4f0b430e2
commit 537dc693ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View file

@ -54,6 +54,7 @@ class DistributionInspectImpl(Inspect):
provider_types=[], # These APIs don't have "real" providers - they're internal to the stack
)
for e in endpoints
if e.methods is not None
]
)
else:
@ -67,6 +68,7 @@ class DistributionInspectImpl(Inspect):
provider_types=[p.provider_type for p in providers],
)
for e in endpoints
if e.methods is not None
]
)