Closed fangerer closed 1 year ago
Hmm. This conflates things that might be easier to review in separate PRs:
Some CI is failing.
The PR mainly contains doc changes. The debug mode changes are just there because #320 asks for both, tuple/list builder docs and debug mode features. I tried to make useful commits and so it should be possible to review commit-by-commit. For example, the tuple/list builder changes are:
Also, the autogen changes are nicely encapsulated in commits:
Anyway, if you still like to have the PR split, then I can do that as well. In that case, I already have a question regarding your suggestion:
- documentation improvements
- lots more API and code documentation in comments in the code
- rst improvements
- additional porting help
Does that mean that you want to have three PRs?
I can do commit-by-commit, no need for a new PR.
Can you make the commit history reflect the division you mention in your comment (no need to split all the doc ones) - I see 32 commits.
Also CI is failing
Also CI is failing
Yes, looking into the CI problems right now.
I went to the summary page to download the docs artifact. There are some weird failures there: it seems the python3.10 job died?
@mattip I fixed the CI issues (except of cppcheck
but that failed before and is a separate story).
I went to the summary page to download the docs artifact. There are some weird failures there: it seems the python3.10 job died?
Yes, I've seen that and re-ran the job. Now it passes. Also re-running jobs that were cancelled because of that.
Anyway, I changed the commit history for nicer commit-by-commit review. Here is an overview:
initial_size
to size
(functions HPyListBuilder_New
and HPyTupleBuilder_New
). This change is trivial but noisy because of the auto-generated sources.struct _HPyContext_s
is generated using sphinx-c-autodoc
.api.md
.Thanks! This is soooo much better, let's put this in as-is and iterate where needed.
@mattip Thank you for reviewing and merging. I plan to do more improvements and API docs anyway. I will address the open issues in follow-up PRs.
resolves #323 resolves #320 resolves #149 addresses #342
There is, ofc, still more to document (in particular, we should add documentation to all API functions) but I think I'll make a cut here. I'll plan to spend a certain amount per week to write API doc but any help is, of course, welcome.
Major changes in this PR:
DHQueue
. I did not (yet) implement tracking of open builders because it is possible to find them by their elements since they would also leak. Tracking leaks of empty builders didn't seem very useful to me but could still be nice.API Reference
in a way that it gives a good overview of all API elements. IMO, the HPy API consists of three parts:public_api.h
. I called this the Core API.helpers.h
,argparse.h
,buildvalue.h
)inline_helpers.h
).pycparser
but I'll do that in a separate PR.HPyContext
usinghpy/cpython/autogen_ctx.h
. The CPython ABI context just contains handles, the name, and the ABI version and I think these are the only user-facing things.HPy API introduction
(=api.rst
). This is not an API reference doc but describes why and how to use shapes, legacy types, etc. Also includes examples.api.md
. I didn't even realize that it was there but it contained some out-dated doc and someone on GitHub found it and complained about that. There was one section about HPy protocols that I moved tomisc/protocols.rst
.Porting Guide
; in particular, I've written another autogen generator that generates a C API - HPy API function mapping.