-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gaiohttpy.py invalid syntax warning (19.0.0) #788
Comments
or we could make asyncio package a requirement for versions other than python 3.4? |
That would work only for Python 3.3 since tulip works on 3.3+. |
yeah like @berkerpeksag said, asyncio requires Python 3.3 or later: https://pypi.python.org/pypi/asyncio/3.4.1 For python2.7 trollius may do the job but it will require some patching. |
Sorry need more coffee... reverted the commit since it's was not needed. The error is a syntax error happening during install. It is harmless. ( |
@hyao if you need its support on python 2.7 with trollius please open a new ticket. Though I strongly suggest you to go on python3 so you won't rely on an hack. |
@benoitc I'm just looking at this from a user's perspective, a syntax error during installation makes the user wonder whether the package is installed correctly or not. As to use python3 for gaiohttp functionality, thanks for the suggestion. I guess it's already been documented somewhere. Thanks, |
|
gaiohttp depends on aiohttp, not asyncio itself. |
This is more like a distutils issue/feature. distutils compiles all Python files to bytecode when installing a package. |
It's actually easy. We can switch on PY2 and use trollius |
It won't do any good unless aiohttp works on PY2 this way, also. |
aiohttp is not compatible with trolius |
Unless someone will propose a patch to aiohttp, i think having the worker running on python 3.4 and sup is enough for me. Like said @asvetlov we should fix the packaging to remove the warning. Any other idea? |
No other idea. I think that's right. I could make a trollius support PR to aiohttp, but until that happens there's nothing but packaging to avoid the warning we can do in gunicorn. |
to support trolius in aiohttp you have to rewrite it |
I don't think that's true. https://trollius.readthedocs.org/#differences-between-trollius-and-tulip |
As an author of aiohttp, I can say that's true, you have to rewrite it. Aiohttp uses yield from internally and it uses yield from not as coroutines. |
I'm certainly not trying to challenge your knowledge of your own library, but I'm skeptical and think "rewrite" might be hyperbole. In case it's useful, here are the places where "yield from" is used outside a coroutine. parsers.pyLinesParser websocket.pyWebSocketParser protocol.pyHttpPrefixParser connector.pyTCPConnector multidict.py_ValuesView But there are also a few places where So it wouldn't be no work. It may be too much mess that you wouldn't want it. But it is probably achievable and I don't think it would be rewriting everything. |
of cause it is possible to make it work with trolius, but does it worth effort? trolius helps you with coroutines but all of of this generators (except connector.py) are not coroutines, so basically you need to remove "yeild from" and replace with something else, what is rewrite to me. i tried to refactor parser in https://github.com/KeepSafe/aiohttp/tree/parsers_refactoring branch, but then abandoned it. to refactor current implementation requires rethinking whole architecture. but PR is welcome! :) |
Cool :) I probably won't give it a try. Just recording notes. Thanks! I'm excited
|
I reopened the issue. We should fix the packaging issue. |
Will do it at weekend |
@asvetlov thanks! |
Please take a look on PR #801 |
I also got some issues with gaiohttp. Here is my log: File "django/core/handlers/base.py", line 104, in get_response Only gaio will give these errors. Python 3.4 imo. The gthread worker, works fine. He is blocking the requests a little bit more than I could accept, so I will stay on 2.7 with gevent. |
@c-schmitt Sorry but I don't see neither exception nor gaiohttp code in logged stack trace. |
@asvetlov it does, maybe it isn't clear but i will explain. And here comes the problem. It only accepts read() not read(size). Edit:
So gunicorn won't be compatible with pep333 if we don't fix that on aiohttp side or just mark gaio as not compatible with pep333. Edit2: |
@c-schmitt Understood. Thank you. |
After conversation in aio-libs/aiohttp#81 I think the objection from @c-schmitt is not an issue of gunicorn. Anyway, if somebody think that problem should be fixed -- please open new issue. @c-schmitt would you attach reasonable simple the code sample which reproduces your problem (in new issue)? |
hrm the wsgi spec says that http://legacy.python.org/dev/peps/pep-3333/#input-and-error-streams @asvetlov reading the issue on aiohttp why read(n) couldn't be implemented? |
i think nobody expect django to work on top of asyncio out of box. |
@asvetlov gunicorn needs to meet the wsgi spec.
Else you could rename it to another thing, but don't call it WSGI. |
@c-schmitt i'm ok with that. |
@asvetlov I'm still seeing this in 19.2.1, but for _gaiohttp.py
|
@koobs which version of gaiohttp did you installed? |
@benoitc The version of aiohttp was 0.9.0, but its unrelated to the issue. I just updated the FreeBSD port to 0.14.4 anyway for the sake of it, just to isolate. The real issue is that on Python 2.7 (when aiohttp isnt even installed), compilation of _gaiohttp.py is attempted during build/build-install and that fails, leaving pyc/pyo files missing, but referenced in --record output. |
@koobs err I mean, are you using the latest version of pip? It should be fixed there. Let me know. |
Perhaps we can add a small note to the documentation? |
@berkerpeksag waiting the split I think It's a good idea :) We should start the split of workers and other plugins asap to release a new version in march. |
Yesterday, I just installed the last version, After that, I have read the error and understood that I can use it because it's just a "warning" for pip. First reaction of a user, uninstall it and use an older version :/ |
Still seeing it in 19.3.0 |
@catskul please update your pip version. The warning is not harmful and recent pip versions don't show it anymore. |
- Update PORTVERSION and distinfo checksum (19.4.1) - Match COMMENT to setup.py:description= - Add LICENSE_FILE - Options: Rename SETPROC option -> Add PROCTITLE to defaults - Options: Add GAIOHTTP async worker - Options: Update all descriptions - Options: Remove TESTS optionjs - Enable "concurrent" Python support - Add NO_ARCH (architecture independent package) - Rename test target to new conventions - Check, limit, and add BROKEN message for Option/Python version combinations that aren't supported. - Patch out non-compulsory dependencies from test requirements file - Delete requirements_dev.txt patch file (no longer necessary) - Add post-patch: target to remove _gaiohttp.py, because compileall() of this file fails on 2.x with a SyntaxError, but is not handled, so .py[co] files references are added to --record output, breaking file list generation. [1][2][3][4][5] Changes: http://docs.gunicorn.org/en/stable/news.html [1] benoitc/gunicorn#788 [2] benoitc/gunicorn#860 [3] benoitc/gunicorn#982 [4] pypa/pip#1873 [5] pypa/pip#1954 git-svn-id: svn+ssh://svn.freebsd.org/ports/head@404558 35697150-7ecd-e111-bb59-0022644237b5
- Update PORTVERSION and distinfo checksum (19.4.1) - Match COMMENT to setup.py:description= - Add LICENSE_FILE - Options: Rename SETPROC option -> Add PROCTITLE to defaults - Options: Add GAIOHTTP async worker - Options: Update all descriptions - Options: Remove TESTS optionjs - Enable "concurrent" Python support - Add NO_ARCH (architecture independent package) - Rename test target to new conventions - Check, limit, and add BROKEN message for Option/Python version combinations that aren't supported. - Patch out non-compulsory dependencies from test requirements file - Delete requirements_dev.txt patch file (no longer necessary) - Add post-patch: target to remove _gaiohttp.py, because compileall() of this file fails on 2.x with a SyntaxError, but is not handled, so .py[co] files references are added to --record output, breaking file list generation. [1][2][3][4][5] Changes: http://docs.gunicorn.org/en/stable/news.html [1] benoitc/gunicorn#788 [2] benoitc/gunicorn#860 [3] benoitc/gunicorn#982 [4] pypa/pip#1873 [5] pypa/pip#1954
Thanks for the new release!
Just pip installed gunicorn 19.0.0, it installs all right, but there's the following warning during installation (Python 2.7.6):
Thanks,
The text was updated successfully, but these errors were encountered: