PyPy support - #205
PyPy support#205
Conversation
* This is to fix a disagreement in between CPython and PyPy. * https://gist.github.com/4220533
|
Nice patch! Could we add a quick test to Scrapy test suite? (maybe just the one referred in the test suite) |
|
Just wanted to let you know I haven't forgotten this pull request. I found some segfaults when running tests in PyPy, and I want to explore those more since it's a more serious issue than the one I originally found. You can follow the thread here: http://mail.python.org/pipermail/pypy-dev/2012-December/010741.html |
|
Thanks for the update @joehillen, I hereby pronounce you the official Scrapy PyPy ambassador! :) |
|
We need test cases to merge this pull request, nobody wants to break your hard work without notice in later changes. |
|
I have been waiting on a fix for the segfaulting issue. Here is the PyPy ticket, though I think I can/should make a test case anyway. I'll be able to get to it later this week. |
|
thanks for the update. I will leave it open :) |
|
I don't think this PR needs tests because most of scrapy test suite already fails under PyPy 2.0.2 without this patch and passes with it (I'm checking this using 'tox -e pypy' after applying #341). The test suite runs super-slow under PyPy though (about 1 test/minute, with idle CPU). |
|
fair point about tests, and great to have an easy way to run tests with pypy |
|
Checked current status of PyPy support:
Modulo these two issues, most tests pass (15 failures out of 1200+ tests, most look easy to fix), and |
|
pypy would be so great. i wouldn't have guessed a 2x speed up given lxml does most of the work. scrapy crawl currently fails silently after printing the enabled middlewares list; scrapy shell print this error: but starts up and i can confirm lxml works, i.e. i used the following lxml branch https://github.com/lxml/lxml/tree/pypy4 |
|
@jschilling1 To fix the first issue, you need to first install pydispatcher with PyPy support (sorry, I don't know a simple way to do it offhand). |
|
Btw, lxml-cffi is on pypi now (and on github too: https://github.com/lxml-cffi/lxml-cffi), although you need a very recent setuptools, and the package name is changed to lxml-cffi, so some lxml-cffi-compat module (like this https://github.com/dstufft/psycopg2cffi-compat) is required so that scrapy dependencies that depend on lxml will not try to install lxml alongside lxml-cffi. |
|
very good, the older cffi branch wouldn’t even compile for me in the past; wow pydispatcher hasn't seen a commit in almost a decade (( |
|
pydispatcher was updated just a year ago: https://pypi.python.org/pypi/PyDispatcher. But still I think the short-term plan is to put pydispatcher with pypy support to pypi, and the long-term plan is to refactor signals and get rid of it (see #8) |
|
From http://morepypy.blogspot.ru/2016/02/c-api-support-update.html:
|
added tests for message_bus_backend
This is a fix for Issue #188.
It is caused by a disagreement about methods'
__call__attribute beingim_funcin CPython vs PyPy.Here is the test case