Skip to content

Provide normalize_doctree_xml via sphinx_design.testing #260

Description

@amotl

Thank you for swiftly resolving compatibility with docutils 0.22 (GH-249, GH-255). We could also use the normalize_doctree_xml helper function in downstream projects instead of using custom crafted workarounds. Maybe relocate it to the sphinx_design_elements.testing module, to ship it with the package, so package consumers can use it right away?

Activity

  1. changed the title [-]Provide `normalize_doctree_xml` via `sphinx_design_elements.testing`[/-] [+]Provide `normalize_doctree_xml` via `sphinx_design.testing`[/+] on Jul 12, 2026
  2. chrisjsewell commented on Jul 14, 2026

    @chrisjsewell
    Member

    This has landed in #277 and will be in the next release: from sphinx_design.testing import normalize_doctree_xml (plus the SphinxBuilder wrapper), importable with only sphinx_design installed — no test extras needed. There's a short "Testing utilities" docs page with the stability policy: helper signatures are covered by the deprecation policy, but the exact normalized output across docutils versions is not.

    This should let sphinx-design-elements drop its own copy. One heads-up for the same migration: its test conftest currently imports the private sphinx_design._compat.findall, which was removed in #276 — switching those call sites to node.findall(...) (docutils ≥0.18 is guaranteed by the Sphinx floor) plus adopting the public helper should cover it.


    Generated by Claude Code

  3. amotl commented on Jul 14, 2026

    @amotl
    Author

    Hi Chris,

    thank you very much, I already created a note about it:

    Thank you also for your other suggestions about a smooth migration path.

    With kind regards,
    Andreas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions