Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: add HPyContextVar* interfaces and document how it is done #407

Merged
merged 5 commits into from
Feb 27, 2023

Conversation

mattip
Copy link
Contributor

@mattip mattip commented Feb 23, 2023

I added the missing HPyContextVars_* API functions.

  • I documented what I did in docs/api-reference/index.rst
  • I changed the following files then ran `make autogen, which failed:
    • hpy/tools/autogen/public_api.h
    • hpy/tools/autogen/conf.py
  • I added HPyContextVar_Get to NO_WRAPPER in hpy/tools/autogen/debug.py, and then needed to modify/add these files:
    • hyp/devel/src/runtime/ctx_contextvars.c (and added that to setup.py)
    • hpy/debug/src/debug_ctx.c
    • hpy/devel/include/hpy/runtime/ctx_funcs.h
    • (edit) hpy/devel/include/hpy/cpython/misc.h
  • I added a test. It passes. universal and debug mode, but fails to compile on cpython mode: it is missing the declaration for HPyContextVar_Get. Where do I need to add it?

Copy link
Contributor

@fangerer fangerer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @mattip, for this PR. I added some comments.
Most of my comments are not strict except of the once where we need to write to the output var even in case of errors.

docs/api-reference/index.rst Outdated Show resolved Hide resolved
hpy/debug/src/debug_ctx.c Outdated Show resolved Hide resolved
hpy/tools/autogen/conf.py Outdated Show resolved Hide resolved
hpy/devel/src/runtime/ctx_contextvar.c Outdated Show resolved Hide resolved
docs/api-reference/index.rst Outdated Show resolved Hide resolved
docs/api-reference/index.rst Outdated Show resolved Hide resolved
@fangerer fangerer merged commit 2d61264 into hpyproject:master Feb 27, 2023
mattip added a commit to mattip/hpy that referenced this pull request Feb 27, 2023
fangerer added a commit that referenced this pull request Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants