Skip to content

Conversation

@DavidAGInnovation
Copy link

Closes #13180. Implements section reordering in NumpyDocstring._parse to ensure 'Attributes' and 'Methods' appear after 'Parameters', matching numpydoc standard logic.

@AA-Turner
Copy link
Member

The ty failures can be ignored (reported at astral-sh/ty#1970), but please fix the other lint failures.

@DavidAGInnovation DavidAGInnovation force-pushed the fix/napoleon-section-ordering branch 5 times, most recently from 8fc1fb2 to 1d2b57d Compare December 17, 2025 05:31
@DavidAGInnovation
Copy link
Author

Fixed the CI / Python 3.12 (Docutils 0.21) failure: it was Git’s working-tree-encoding conversion choking on working-tree-encoding=iso-8859.

  • Updated sphinx/.gitattributes to use working-tree-encoding=ISO-8859-1

  • Renormalized the fixtures so the repo stores UTF‑8 while the working tree stays Latin‑1:

    • sphinx/tests/roots/test-root/wrongenc.inc
    • sphinx/tests/roots/test-warnings/wrongenc.inc

Copy link
Member

@AA-Turner AA-Turner left a comment

Choose a reason for hiding this comment

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

please revert all unrelated changes

…x-doc#13180)

Implements section reordering in NumpyDocstring._parse to ensure 'Attributes'
and 'Methods' sections appear after 'Parameters', matching numpydoc standard
logic.

This is achieved by collecting sections during parsing then reordering them
before generating the final parsed lines.
@DavidAGInnovation DavidAGInnovation force-pushed the fix/napoleon-section-ordering branch from d07e1c8 to f97e19f Compare December 18, 2025 00:16
@DavidAGInnovation
Copy link
Author

DavidAGInnovation commented Dec 18, 2025

Done, the tests are running again.

@DavidAGInnovation
Copy link
Author

Will this be merged then? @AA-Turner

@AA-Turner
Copy link
Member

There's been no review yet which is the major blocker to merging. It'd be helpful to reviewers to have tests and a CHANGES entry in this PR, though.

A

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.

bug: napoleon: numpydoc: incorrect section ordering for classes

2 participants