Pycapsule#493
Conversation
…e matplotlib-py3 branch.
…he Python 3.x side.
|
I was able to build and test this on python2.4 on solaris and python 2.6 on linux. Compilation and spot check of several examples looked good. Unfortunately a lot of tests are failing for me on both platforms because of font issues, but this is the same as in master so I don't think your changes are implicated. |
|
I am still hesistant about this one. What are the implications of switching to PyCapsule? There must be a fundamental difference between PyCObject and PyCapsule, right? Are we going to have issues with extension developers (I am thinking along the lines of ABI compatibility and such). Also, will this cause confusion with binary builds of matplotlib? I take it that we will need a Windows installer for py2.5-6 and a separate one for py2.7? Maybe the same for Macs? |
|
We've always done python version dependent builds for windows and os x. |
|
@WeatherGod: You can see a rationale for the PyCapsule API here: http://bugs.python.org/issue5630 The features of the new design are very welcome but not particularly necessary for PyCXX, since PyCXX already handles the type safety and destructor features that PyCapsule addresses. So we really only need to use the very basic functionality of PyCapsule (namely PyCapsule_New and PyCapsule_GetPointer). In some ways it could be said that the new features of PyCapsule are really only helpful for those writing new code that wraps an existing C library -- PyCXX is a different sort of animal that has to manage many of its own details. There are no implications for extension authors. Extension authors are still free to use whatever wrapper mechanism they wish, and matplotlib (unlike Numpy, for example) does not expose a C API. ABI compatibility across different non-bugfix releases of Python has never been guaranteed by Python's design. We will need to produce binaries for multiple versions of Python anyway. As a side note, it should be noted that numpy git master as of now still uses PyCObject on Python 2.7, so unless that is addressed over there (I have no idea what if any plans the numpy folks have in that regard) there will still be PendingDeprecationWarnings emitted from numpy. |
|
Ok, that makes me feel much more comfortable with merging this in. I just wanted to do some sanity checks here. |
This commit avoids PendingDeprecationWarnings on Python 2.7 of the form:
/home/titan/johnh/devlinux/lib64/python2.7/site-packages/matplotlib/textpath.py:246:
It replaces all calls to PyCObject_* with their equivalent PyCapsule_* calls. This same change was made on the py3 branch for Python 3.x compiles only, and has been working there for a while.
These changes are all in an #ifdef, and thus should have no change on Python < 2.7.