Contributing¶
Getting Started¶
TBD
Adding New API¶
Add the function to
hpy/tools/autogen/public_api.h
. If the CPython equivalent function name is not the same (after removing the leadingH
, add an appropriate CPython function mapping inhpy/tools/autogen/conf.py
. If the signature is complicated or there is no clear equivalent function, the mapping should beNone
, and follow the directions in the next step. Otherwise all the needed functions will be autogenerated.If the function cannot be autogenerated (i.e. the mapping does not exist), you must write the wrapper by hand. Add the function to
NO_WRAPPER
inhpy/tools/autogen/debug.py
, and add actx_fname
function tohyp/devel/src/runtime/*.c
(possibly adding the new file tosetup.py
), add a debug wrapper tohpy/debug/src/debug_ctx.c
, add a implementation that uses thectx
variant tohpy/devel/include/hpy/cpython/misc.h
and add the declaration tohpy/devel/include/hpy/runtime/ctx_funcs.h
.Run
make autogen
which will turn the mapping into autogenerated functionsAdd a test for the functionality
Build with
python setup.py build_ext
. After that works, build withpython -m pip install -e .
, then run the test withpython -m pytest ...
.