Closed hugoprudente closed 2 years ago
There are a lot more errors than this one, after fixing the list
to List
you have issues with
Traceback (most recent call last):
File "bug.py", line 4, in <module>
import malclient
File "/home/hugo/MAL-API-Client-Upgraded/malclient/__init__.py", line 1, in <module>
from .client import Client, generate_token
File "/home/hugo/MAL-API-Client-Upgraded/malclient/client.py", line 4, in <module>
from .anime import Anime
File "/home/hugo/MAL-API-Client-Upgraded/malclient/anime.py", line 44, in <module>
class Anime():
File "/home/hugo/MAL-API-Client-Upgraded/malclient/anime.py", line 64, in Anime
def search_anime(self, keyword: str, *, limit: int = 20, nsfw: Optional[bool] = None, anime_fields=None) -> PagedResult[Node]:
File "/usr/lib/python3.8/typing.py", line 261, in inner
return func(*args, **kwds)
File "/usr/lib/python3.8/typing.py", line 897, in __class_getitem__
_check_generic(cls, params)
File "/home/hugo/.local/lib/python3.8/site-packages/typing_extensions.py", line 94, in _check_generic
raise TypeError(f"{cls} is not a generic class")
TypeError: <class 'malclient.models.PagedResult'> is not a generic class
From there there are more errors depending on how you solve the PagedResult.
I'm afraid that your code at the moment is not ready to usage.
Hi! Thanks for your input
Regarding first issue library is developed on python 3.9 - version that deprecated typing.List
type hinting method and instead introduced type hinting using generic list
therefore there is no backward compatibility in library for python 3.8 and earlier. I thought that it was mentioned in Readme and docs but I will look into it.
Regarding your second issue, possibly it is compatibility issue as well, but paging is still being developed and I pushed only bare minimum so I can't say for sure, PyPi version should be more stable though. Currently I am away but I will look further into it when I am home.
One more thing Currently library might be hard to use due to one more issue Recently working on some side project I found out that MAL has very poor documentation and some fields might take different values than the ones in documentation, so current version of library might have some conflicts I am currently working to resolve.
Hi @ModerNews thanks for the input, I'll try work with new version of python and see if everything goes fine.
If you open the issues that you know that exists I may be able to help you fix as I'm migrating my app to use your library. I mainly opened the issue as the amount of errors were not normal, and something was really going on, and now I know that is my python version!.
Confirmed the fix by using python 3.9.5.
Found some other issues and created a PR for you.
Glad to hear that with newer version it actually works fine.
I'm migrating my app to use your library.
I'm glad to here that there are actually people using it (especially given that the API itself isn't top notch, but we can pray it will improve in future)
If you open the issues that you know that exists I may be able to help you fix
In a week, when I'm back at home I will review the code I have in local repo branch and push what is usable in a current state to have github branches synced also I will create some issues. Haven't really felt any urge to till now as there weren't any contributors other than myself
I will change the Readme installation paragraph and close the issue in few minutes.
Hi.
I used to use the archived MAL-API-Client, that this project is based. I have upgraded to use this project and it's failing with the
TypeError
It fails installing it from PIP and using cloned from the directory.