Conversation
|
Thanks for the PR. Could you resolve the merge conflicts? |
|
Done! If you're amenable, I would also like to start some work on tests and then some file sorting improvements. I don't know if you remember, but I started similar work a couple years ago. The codebase changed enough that I closed that PR request but I think it would be a big improvement for the import process. |
|
|
||
|
|
||
| def make_request(url: str) -> bytes: | ||
| def make_request(url: str) -> AnyStr | None: |
There was a problem hiding this comment.
The usage of AnyStr looks problematic - it doesn't do anything if it is only used once in the function definition, and is also not recommended for use. See https://docs.python.org/3/library/typing.html#typing.AnyStr
There was a problem hiding this comment.
It's there because that's the return for the generic of that function. In practice though, it's probably fine to pin it to bytes instead since it shouldn't return a string, or else I can make it the replacement for AnyStr recommended in the docs.
What would you prefer?
There was a problem hiding this comment.
Lets go with bytes for now? We could always adjust it later, but bytes won't be deprecated in the upcoming Python releases.
|
Having more tests would be really useful. I tried adding tests but the current plugin isn't really set up well for that. Ideally, it should be possible to have lists of results from Audible, metadata from a book to be imported and we can check that the plugin assigns the correct Audible result. |
A few small fixes to the typings for some functions, mainly adding some but also fixing a couple incorrect typings.