Sphinx: Render inherited overloads with autodoc
===============================================
This extension works around a small issue in Sphinx where autodoc does not show
inherited `@overload` signatures, by manually resolving overloads during the
[`autodoc-process-signature`] event. Dynamically, the overloads for a function
can only be obtained using the [`typing.get_overloads()`] function, which was
introduced in Python 3.11. The latter is therefore a hard requirement.
Installation
------------
For testing, you can install the `sphinxcontrib.autodoc_inherit_overload`
package from pip:
```
pip install sphinxcontrib.autodoc_inherit_overload
```
When adding the package to your dependencies, make sure you guard against
incorrect Python versions:
```
sphinxcontrib.autodoc_inherit_overload; python_version>='3.11'
```
The same applies to loading the extension in your `conf.py`:
```py
extensions = [
# your extensions
...
]
if sys.version_info >= (3, 11):
extensions += ['sphinxcontrib.autodoc_inherit_overload']
```
[`autodoc-process-signature`]: https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#event-autodoc-process-docstring
[`typing.get_overloads()`]: https://docs.python.org/3/library/typing.html#typing.get_overloads
Raw data
{
"_id": null,
"home_page": "",
"name": "sphinxcontrib.autodoc-inherit-overload",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": "",
"keywords": "sphinx,sphinxcontrib,autodoc,typing,overload",
"author": "",
"author_email": "Nicolas Tessore <n.tessore@ucl.ac.uk>",
"download_url": "https://files.pythonhosted.org/packages/88/5c/7463f42c7249bea1590105f5965b26d5d6a1c06c6bd580b1c0ac41203705/sphinxcontrib.autodoc_inherit_overload-2023.4.tar.gz",
"platform": null,
"description": "Sphinx: Render inherited overloads with autodoc\n===============================================\n\nThis extension works around a small issue in Sphinx where autodoc does not show\ninherited `@overload` signatures, by manually resolving overloads during the\n[`autodoc-process-signature`] event. Dynamically, the overloads for a function\ncan only be obtained using the [`typing.get_overloads()`] function, which was\nintroduced in Python 3.11. The latter is therefore a hard requirement.\n\n\nInstallation\n------------\n\nFor testing, you can install the `sphinxcontrib.autodoc_inherit_overload`\npackage from pip:\n\n```\npip install sphinxcontrib.autodoc_inherit_overload\n```\n\nWhen adding the package to your dependencies, make sure you guard against\nincorrect Python versions:\n\n```\nsphinxcontrib.autodoc_inherit_overload; python_version>='3.11'\n```\n\nThe same applies to loading the extension in your `conf.py`:\n\n```py\nextensions = [\n # your extensions\n ...\n]\nif sys.version_info >= (3, 11):\n extensions += ['sphinxcontrib.autodoc_inherit_overload']\n```\n\n[`autodoc-process-signature`]: https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#event-autodoc-process-docstring\n[`typing.get_overloads()`]: https://docs.python.org/3/library/typing.html#typing.get_overloads\n\n",
"bugtrack_url": null,
"license": "",
"summary": "Sphinx extension to render inherited overloads with autodoc.",
"version": "2023.4",
"split_keywords": [
"sphinx",
"sphinxcontrib",
"autodoc",
"typing",
"overload"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "dc8a639b4889c4d97c81697c9eead56adc51b1d91a4c81238f87c191c0fa7f51",
"md5": "2183c40fede6e0e2b39af2e67b507cae",
"sha256": "5ac164aec1c4df941a279282e5ecebe286d91e0b35637a0faa23e25245efd0df"
},
"downloads": -1,
"filename": "sphinxcontrib.autodoc_inherit_overload-2023.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2183c40fede6e0e2b39af2e67b507cae",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 3327,
"upload_time": "2023-04-21T22:28:05",
"upload_time_iso_8601": "2023-04-21T22:28:05.137243Z",
"url": "https://files.pythonhosted.org/packages/dc/8a/639b4889c4d97c81697c9eead56adc51b1d91a4c81238f87c191c0fa7f51/sphinxcontrib.autodoc_inherit_overload-2023.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "885c7463f42c7249bea1590105f5965b26d5d6a1c06c6bd580b1c0ac41203705",
"md5": "9328d8c25139a8722a84549d824f945c",
"sha256": "fb6a0d7d4380b14f07b6bd7ffdac61b4e0522499d70522f3bfbc670917615d22"
},
"downloads": -1,
"filename": "sphinxcontrib.autodoc_inherit_overload-2023.4.tar.gz",
"has_sig": false,
"md5_digest": "9328d8c25139a8722a84549d824f945c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 2590,
"upload_time": "2023-04-21T22:28:07",
"upload_time_iso_8601": "2023-04-21T22:28:07.158132Z",
"url": "https://files.pythonhosted.org/packages/88/5c/7463f42c7249bea1590105f5965b26d5d6a1c06c6bd580b1c0ac41203705/sphinxcontrib.autodoc_inherit_overload-2023.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-04-21 22:28:07",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "sphinxcontrib.autodoc-inherit-overload"
}