use limited API for "simple" FFI().compile() builds and on PyPy
Created originally on Bitbucket by mattip
CFFI already uses the py_limited_api
flag on full builds via setup.py
. It should do so as well for FFI().compile()
builds. This would not impact python2, since it cannot use that flag. The actual c-extension modules produced by CFFI use so little of the C-API that they should JustWork across all versions of a python implementation. On PyPy, CFFI could use a CFFI-specific limited API tag (api-pypy? api-cffi?) to allow build-once, use-anywhere packages.
When implementing this feature, please do not assume setuptools can be imported at runtime, it should be imported on an as-needed basis only when compiling.