Skip to content

Adjust macros and typedefs for Numpy C API

Leo P. Singer requested to merge leo-singer/ligo.skymap:pypy into main
  • Define Py_LIMITED_API and NPY_TARGET_VERSION macros in setup.py rather than in the C source code.
  • Don't define Numpy's struct _typeobject if we are building for PyPy because PyPy doesn't implement Python's limited C API (see https://github.com/liberfa/pyerfa/pull/120).
  • Define struct _typeobject workaround after including Python.h, not before, because on PyPy, Python.h defines the macros that we depend on to detect whether we are building under PyPy.
  • Use NPY_TARGET_VERSION for builds that are backwards-compatible with old versions of Numpy.
  • Build with any version of Numpy >=1.25 and <2 (see https://github.com/liberfa/pyerfa/pull/121).
Edited by Leo P. Singer

Merge request reports

Loading