Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate automatic typehinting #12

Closed
kaitj opened this issue Aug 3, 2023 · 4 comments · Fixed by #14
Closed

Integrate automatic typehinting #12

kaitj opened this issue Aug 3, 2023 · 4 comments · Fixed by #14
Labels
maintenance Updates or improvements that do not change functionality of the code

Comments

@kaitj
Copy link
Contributor

kaitj commented Aug 3, 2023

Describe the feature you'd like to see
Make use of the sphinx extension autodoc_docstring_signature (or whichever extension is relevant) to automatically pick up type hints and drop the repeated type hint that is manually written in the docstrings.

@kaitj kaitj added the maintenance Updates or improvements that do not change functionality of the code label Aug 3, 2023
@kaitj kaitj self-assigned this Aug 11, 2023
@kaitj kaitj changed the title Integrate autodoc_docstring_signature Integrate automatic typehinting Aug 15, 2023
@kaitj
Copy link
Contributor Author

kaitj commented Aug 15, 2023

I am at a bit of a loss for this one - open to any ideas here.

  1. Type hinting is automatic for the inputs, but, it doesn't seem to like to link to the correct documentation when using something like PathLike. It only links if os.PathLike is used, though I would like to avoid importing all of os if only PathLike is used. Something similar is happening with numpy, but that is a bit more difficult to debug.
  2. Return types (afaik) have to be explicitly stated in the docstring.

@kaitj kaitj removed their assignment Aug 15, 2023
@tkkuehn
Copy link
Contributor

tkkuehn commented Aug 21, 2023

Just so I'm totally clear on the issue here, is sphinx-autodoc-typing the extension you tried here?

@kaitj
Copy link
Contributor Author

kaitj commented Aug 22, 2023

This is still using ``sphinx.ext.autodoc` - was trying to replicate the working mapping from snakebids

@kaitj
Copy link
Contributor Author

kaitj commented Aug 24, 2023

This ended up getting fixed by updates to the doc requirements to get it working again in #14.

@kaitj kaitj linked a pull request Aug 24, 2023 that will close this issue
9 tasks
@kaitj kaitj closed this as completed in #14 Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Updates or improvements that do not change functionality of the code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants