GeezerVison is showing github.com — Update C domain docs to Sphinx 3 syntax · Issue #93738 · python/cpython
Update C domain docs to Sphinx 3 syntax #93738DescriptionSphinx would like to remove support for the pre-v3 C domain syntax. We have confirmed that the Linux kernel is no longer using it, so Python is the only project we are blocked on.
I have a branch where I've done the work, but it is a large number of files affected (~50) and the majority of the C-API documentation. The changes are almost all mechanical search-and-replace, but there are a few where I've had to use judgement.
Questions:
- Is this change welcome?
- How should I proceed with PRs? One per data type, per file, etc?
- I would want to backport these changes to 3.10/3.11 (to allow future docs backports without conflicts), does anybody have objections?
- Does anybody have other concerns?
cc: @vstinner @serhiy-storchaka @encukou @erlend-aasland @JelleZijlstra @hugovk (Selection of C-API/documentation people, if I've missed anyone please mention them).
A
Tasks
Reacted by Hugo van Kemenade, Ezio Melotti, Petr Viktorin and Senthil Kumaran Activityserhiy-storchaka commented on Jun 12, 2022 What directives and roles can be used and what are gone?
- Is this change welcome?
We do not have a choice, isn't?
- How should I proceed with PRs? One per data type, per file, etc?
Could manual and automatic changes be separated, so intermediate results are still working? Say, first some preparing manual changes, then automatic changes, then final manual changes?
- I would want to backport these changes to 3.10/3.11 (to allow future docs backports without conflicts), does anybody have objections?
Do not have objections if systems with 3.10 support Sphinx 3. Reacted by Jelle Zijlstra, Adam Turner, Hugo van Kemenade and Laurie O AA-Turner commented on Jun 12, 2022 hugovk commented on Jun 12, 2022 vstinner commented on Jun 13, 2022 If I recall correctly, in 2020, I asked Sphinx to add an option to opt-in for the legacy C syntax. When it was discussed, the problem was that Sphinx supporting the new syntax was not widely available in Linux distributions. I guess that the situation changed and now it's perfectly fine to switch to the new syntax.
Doc/conf.py gives some context and links to bpo-40204:
# bpo-40204: Allow Sphinx 2 syntax in the C domain
c_allow_pre_v3 = True
# bpo-40204: Disable warnings on Sphinx 2 syntax of the C domain since the
# documentation is built with -W (warnings treated as errors).
c_warn_on_allowed_pre_v3 = False
I would want to backport these changes to 3.10/3.11 (to allow future docs backports without conflicts)
I agree to backport for the reason that you give: make future backports simpler. encukou commented on Jun 13, 2022 I've looked at the proposed branch. The commits there would make good individual PRs, IMO.
IMO we've now made it clear that documentation discussions live in the Discuss category. Perhaps mention there, and if no one objects, go ahead with PRs.
Some specific points:
Please keep/turn as many of these as possible as/into links. Many times this would just mean checking that the links are generated (and are correct).
AFAIK, Sphinx will parse :c:expr: expressions and linkify any types it finds, so :c:expr:const PyObject* will link to PyObject. If that's right, IMO the :c:type:PyObject* should be changed to expr, which is much easier to type than the ecaped star.
Or is there some disadvantage to :c:expr:?
References to a family of functions (glob patterns) like :c:func:PyArg_Parse\* functions link to the section (especially for PyArg_Parse where not all of them actually use the prefix); other cases could use wording like PyArg_Parse* functions (such as :c:func:PyArg_VaParse) AA-Turner commented on Jun 13, 2022 encukou commented on Sep 21, 2022 @AA-Turner, do you still want to do this, or would it be better if someone else took over? AA-Turner commented on Oct 3, 2022 Thanks for the nudge Petr, 15 PRs later I've now covered all bases (I hope!) for the removal of the pre-v3 support. Some PRs are very trivial and can likely be merged instantly, some may need a few minutes to read through, but all are mechanical transformations.
A
MetadataMetadataStatusShow more project fields
DevelopmentNo branches or pull requestsIssue actions
|