libgit2/pygit2

support for pypy

cholin opened this issue · 3 comments

At the moment pygit2 supports python 2.6, 2.7, 3.1, 3.2 and 3.3. Sadly pypy is not supported yet. I would be happy if we could refactor the code of pygit2 a little bit to support pypy as well. If you try the test suite with pypy you get the following error:

src/pygit2.c:30:20: fatal error: osdefs.h: No such file or directory #include <osdefs.h>

I think the issue are

  • missing osdefs.h in pypy (there is a private ll_os.h but not public accessable)
  • we check for key value parameters in several functions but do specify METH_VARARGS in the PyMethodDef struct. It should be redudant and not compatible with pypy.
  • pypy raises TypeError instead of AttributeError (see https://bugs.pypy.org/issue1108)
  • memory bugs in pygit2

Do you think it's worth the time?

It would be nice:

  • if there is someone who takes care of it, because I won't
  • if the changes are not too heavy (from your description it looks okey to me)

Also, it looks like travis does support pypy, that will help a lot.

So go ahead if you like.

Maybe we could reduce the mess by having specific files to support each platform, like _py2.h, _py3.h and ... _pypy.h.

I'll look into that.