Open clbarnes opened 2 years ago
If I had to guess this is a bug or a change in the CPython API and something that has probably changed in PyPy. To define a python type in C/C++ you need a printfunc
in the object typedef. You can see it in the code here:
https://github.com/pytroll/aggdraw/blob/bd751fc2e27554c06736fa0e2db55a6eb2ee87ac/aggdraw.cxx#L305
It looks like aggdraw is trying to leave this undefined by casting a 0
to type printfunc
. Looks like this field is just there for Python 2 backwards compatibility though:
https://python.readthedocs.io/en/latest/c-api/typeobj.html#c.PyTypeObject.tp_print
You/we will need to find out what the proper way is to leave this field undefined. Maybe it should be set to NULL? But that doesn't really satisfy the Py_ssize_t
that PyPy is looking for. This makes me feel like this is a bug in PyPy, but that is a wild guess.
Thanks for the quick response! I suppose there's no interest in dropping support for a language version declared EOL nearly 2 years ago?
What do you mean? Dropping support for Python 2? I don't think we support it now. But that's not the point, this is the CPython C API. Their PyTypeObject struct includes a field for this. For binary compatibility it can't be removed, but I'm not sure what it should be to make PyPy happy.
To clarify a little more: this binary compatibility is not a aggdraw thing, this is a CPython thing.
Ah, misunderstood - I thought you meant something had been left in aggdraw for py2 compatibility. It does look like your travis config does run against 2.7 and 3.7; appveyor against 3.6 (EOL in a few days).
We haven't had any new commits for quite a while so the CI is pretty out of date. As for the state of the repository, the main
branch has unreleased changes as they switch to a newer version of the agg C++ library, but I found after merging the changes from the contributor who did it that the results are actually pretty different when used in real world cases (the test cases weren't complex enough). If you find a way to resolve the PyPy issue then it should be done from the maint/1.3
branch.
I still think the PyPy issue should be something related to a change in PyPy and not necessarily a bug in aggdraw. I'd be surprised if we are the only project running into this. I would expect the PyPy change to be documented but I'm not really sure where to dive in.
We can successfully install aggdraw on pypy3.7 (v7.3.7) and on CPython 3.8, but not pypy3.8 (v7.3.7). Does this output mean anything to anyone?