Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There were some tricky places where I had two choices: a major refactoring or a "best effort" attempt to fix the type annotations.
A simplified example to explain a challenge I had to solve in the "test/" folder:
I was thinking about how to get IDE autocompletion and fix Mypy/Pyright warnings and come up with as small refactorings as possible, but better ideas are welcome.
The workaround was to define that if we pass
type[SQLiteCache]
then we getSQLiteCache
, etc.Another tricky task was the fact that you return
-> CachedResponse | ClientResponse
but in the tests you always check attributes ofCachedResponse
(e.g.from_cache
). The simplest workaround was usingcast()
to tell IDE and a type checker that we work in the test with theCachedResponse
.CI for 3.11 and 3.12 failed with
✔️ Locally I successfully executed all tests for
3.8
and3.12
.