cgrok / clashroyale

Async + Sync wrapper for royaleapi.com and the CR official API
MIT License
47 stars 19 forks source link

Latest version of ClashRoyale on PyPI, aiohttp broken #14

Closed sayeghr closed 6 years ago

sayeghr commented 6 years ago

When I try to import clashroyale, I get the following error:

`(CRActivityBot-LU2alj18) bash-3.2$ python Python 3.6.5 (default, Apr 29 2018, 09:02:36) [GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.1)] on darwin Type "help", "copyright", "credits" or "license" for more information.

import clashroyale Traceback (most recent call last): File "", line 1, in File "/Users/sayeghr/.local/share/virtualenvs/CRActivityBot-LU2alj18/lib/python3.6/site-packages/clashroyale/init.py", line 25, in from .client import Client File "/Users/sayeghr/.local/share/virtualenvs/CRActivityBot-LU2alj18/lib/python3.6/site-packages/clashroyale/client.py", line 31, in import aiohttp File "/Users/sayeghr/.local/share/virtualenvs/CRActivityBot-LU2alj18/lib/python3.6/site-packages/aiohttp/init.py", line 6, in from .client import * # noqa File "/Users/sayeghr/.local/share/virtualenvs/CRActivityBot-LU2alj18/lib/python3.6/site-packages/aiohttp/client.py", line 15, in from . import connector as connector_mod File "/Users/sayeghr/.local/share/virtualenvs/CRActivityBot-LU2alj18/lib/python3.6/site-packages/aiohttp/connector.py", line 17, in from .client_proto import ResponseHandler File "/Users/sayeghr/.local/share/virtualenvs/CRActivityBot-LU2alj18/lib/python3.6/site-packages/aiohttp/client_proto.py", line 6, in from .http import HttpResponseParser, StreamWriter File "/Users/sayeghr/.local/share/virtualenvs/CRActivityBot-LU2alj18/lib/python3.6/site-packages/aiohttp/http.py", line 8, in from .http_parser import (HttpParser, HttpRequestParser, HttpResponseParser, File "/Users/sayeghr/.local/share/virtualenvs/CRActivityBot-LU2alj18/lib/python3.6/site-packages/aiohttp/http_parser.py", line 15, in from .http_writer import HttpVersion, HttpVersion10 File "/Users/sayeghr/.local/share/virtualenvs/CRActivityBot-LU2alj18/lib/python3.6/site-packages/aiohttp/http_writer.py", line 304, in class URL(yarl.URL): File "/Users/sayeghr/.local/share/virtualenvs/CRActivityBot-LU2alj18/lib/python3.6/site-packages/yarl/init.py", line 232, in __init_subclass__ "is forbidden".format(cls)) TypeError: Inheritance a class <class 'aiohttp.http_writer.URL'> from URL is forbidden

`

aiohttp version 2.2.5 clashroyale version 3.4.1

Python 3.6.5

fourjr commented 6 years ago

Getting this error?

TypeError: Inheritance a class <class 'aiohttp.http_writer.URL'> from URL is forbidden

This is due to yarl 1.2 having a breaking change that breaks aiohttp. Downgrade your yarl using pip install -U "yarl<1.2"

sayeghr commented 6 years ago

Shouldn't that dependency requirement be reflected in clashroyales setup.py?

fourjr commented 6 years ago

I haven't had the time to do so, you could do a PR if you want. For now, this is the hotfix

sayeghr commented 6 years ago

Okay, thank you :)