typeshed icon indicating copy to clipboard operation
typeshed copied to clipboard

Add stubgen stubs for docutils.core

Open adamtheturtle opened this issue 1 year ago • 3 comments

I appreciate that https://github.com/python/typeshed/pull/11559/files attempts to add more thorough type hints, but that seems to have stagnated.

I think that:

  • This provides some type safety for using docutils.core.
  • https://github.com/python/typeshed/pull/11559/files can easily be rebased to show just the added type hints
  • We can possibly bring in https://github.com/python/typeshed/pull/11559/files changes piecemeal after this

adamtheturtle avatar Aug 16 '24 05:08 adamtheturtle

Diff from mypy_primer, showing the effect of this PR on open source code:

sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/builders/html/__init__.py: note: In member "render_partial" of class "StandaloneHTMLBuilder":
+ sphinx/builders/html/__init__.py:407:36: error: Argument 1 to "set_source" of "Publisher" has incompatible type "document"; expected "str | None"  [arg-type]

github-actions[bot] avatar Aug 16 '24 05:08 github-actions[bot]

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

github-actions[bot] avatar Aug 16 '24 05:08 github-actions[bot]

I'm not against doing it in two steps, one with automated generation, then one with manual changes. Incorrect default values have to be fixed first though for stubtest to pass. You can use stubdefaulter -t stubs/docutils/ to help you with that.

Avasam avatar Aug 17 '24 17:08 Avasam