Skip to content

Additional missing sections for Google-style docstrings - #108

Closed
BrianPugh wants to merge 2 commits into
rr-:mainfrom
BrianPugh:additional-google-sections
Closed

BrianPugh wants to merge 2 commits into
rr-:mainfrom
BrianPugh:additional-google-sections

Conversation

@BrianPugh

Copy link
Copy Markdown

Adds missing section types for Google docstrings; genereally speaking, both Google/Numpy docstring types should support all the same section types. Sphinx lists the valid section types here. Originally discovered by domdomegg here.

Additionally, i added a small tweak to pyproject.toml; pydoctor >= 25.4.0 is incompatible with python3.8, so I just added that limitation rather than dropping python3.8 support since it's only used for document building. Functionally nothing changes, dependency solving (e.g. with uv) was simply broken before.

Comment on lines +1100 to +1101
assert docstring.deprecation.version == "Use new_function instead."
assert docstring.deprecation.description is None

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Description being None and version some text. This doesn't look like a correct behavior.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Add a parametrize case to the test_compose() test to make sure that a See Also: gets composed correctly.

@mauvilsa mauvilsa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Overall looks fine. But the handling of version in deprecated is very weird. I don't think this behavior should be codified in the tests. How should the behavior be, I haven't thought about. Please think about it and make a proposal.

@rr-

rr- commented Oct 27, 2026

Copy link
Copy Markdown
Owner

@BrianPugh thanks for this, and sorry it sat so long. We'll take it over from here and finish it on your branch. You stay the author.

What I'm planning:

  • Drop the pydoctor commit. Master already handles that.
  • Deprecated: only treat the first line as the version if it looks like one (1.6.0, v2.0, …). Otherwise everything goes to the description and version is None.
  • Fix compose for See Also. Right now it comes out as Seealso:. I'll add the compose test @mauvilsa asked for.
  • Rebase on master and add a changelog entry.

@mauvilsa does that work for the deprecated part?

@rr-

rr- commented Nov 6, 2026

Copy link
Copy Markdown
Owner

Thanks for this, and sorry it took so long. These sections are in main now for both Google and Numpydoc (#180), so I'm closing this one. The 3.8 pydoctor trouble is gone too, since the docs build doesn't go through the project lock anymore (#181). Thanks for pushing on it.

@rr- rr- closed this Nov 6, 2026
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.

3 participants