Official PyPy support #2513

Closed
pekkaklarck opened this Issue Dec 31, 2016 · 4 comments

Projects

None yet

2 participants

@pekkaklarck
Member

Robot Framework runs on PyPy fairly well, but some acceptance tests fail on it. At least some of these failures are just bugs in test system that don't take PyPy into account, but there can be some actual bugs too. Need to test PyPy more thoroughly before we can say we officially support it. Once we do, we can add this classifier back to setup.py:

Programming Language :: Python :: Implementation :: PyPy

PyPy is faster than the standard Python in some cases, so there ought to be some concrete benefits in supporting it. One part of this is deciding which PyPy versions we support.

@pekkaklarck pekkaklarck added this to the 3.1 milestone Dec 31, 2016
@pekkaklarck pekkaklarck self-assigned this Jan 4, 2017
@pekkaklarck pekkaklarck modified the milestone: 3.0.1, 3.1 Jan 4, 2017
@pekkaklarck pekkaklarck added the rc 2 label Jan 4, 2017
@pekkaklarck
Member

It turned out that we mostly support both PyPy 2 and PyPy 3. Most of the test failures were due to inconsistency in how __builtins__ is handled (Python itself handles it inconsistently as well) but that only affected our tests and was easy to fix.

The only change needed to the code is a workaround for a bug in PyPy related to handling __init__ inherited from object. This fix is pretty easy and can be done conditionally so that it doesn't affect any other interpreters.

Supporting PyPy is thus so low hanging fruit (and safe to pick) that it makes sense to do it already in 3.0.1 even though we already are in release candidate phase. In addition to the fixes mentioned above, need to update setup.py and see what docs in general say about the PyPy support.

@pekkaklarck pekkaklarck added a commit that referenced this issue Jan 4, 2017
@pekkaklarck pekkaklarck Workaround PyPy bug with __init__ inherited from object.
With PyPy __init__ inherited from object is incorrectly consireded to
be a method/function by `inspect`. See #2513 and this PyPy issue:
https://bitbucket.org/pypy/pypy/issues/2462
b20be9a
@pekkaklarck
Member

Tests updated support PyPy where needed, added workaround for the __init__ bug, added PyPy classifier to setup.py, and updated README and INSTALL to document that PyPy is supported and how to use it. This issue is done.

@pekkaklarck pekkaklarck closed this Jan 4, 2017
@aihuasxy

In which cases performance will be imporved?

@pekkaklarck
Member

It depens on the context, but my understanding is that especially long running processes benefit from being run on PyPy. The only way for you to know does it improve performance in your case is to test it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment