Skip to content

Commit

Permalink
fix: use native autodoc typehints and add intersphinx
Browse files Browse the repository at this point in the history
  • Loading branch information
vberlier committed Feb 19, 2022
1 parent 9e8daa8 commit ed51b54
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 33 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ Mudkip enables the following Sphinx extensions:

- [`sphinx.ext.autodoc`](http://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html) for generating documentation from docstrings
- [`sphinx.ext.napoleon`](https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html) for Google-style and NumPy-style docstring support
- [`sphinx_autodoc_typehints`](https://github.com/agronholm/sphinx-autodoc-typehints) for pulling type information from Python 3 annotations
- [`sphinx.ext.doctest`](https://www.sphinx-doc.org/en/master/usage/extensions/doctest.html) for doctest support
- [`sphinx.ext.autosectionlabel`](https://www.sphinx-doc.org/en/master/usage/extensions/autosectionlabel.html) for referencing sections with their title
- [`sphinx.ext.intersphinx`](https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html) for linking to other projects’ documentation
- [`sphinx.ext.githubpages`](https://www.sphinx-doc.org/en/master/usage/extensions/githubpages.html) when deploying to GitHub Pages
- [`myst_parser`](https://myst-parser.readthedocs.io/en/latest/) for markdown support
- [`myst_nb`](https://myst-nb.readthedocs.io/en/latest/) for Jupyter notebook support
Expand Down
7 changes: 6 additions & 1 deletion mudkip/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ def create_sphinx_application(self):

extensions.append("sphinx.ext.autodoc")
conf.setdefault("autodoc_member_order", "bysource")
conf.setdefault("autodoc_typehints", "description")
conf.setdefault("autodoc_typehints_description_target", "documented")

extensions.append("sphinx.ext.napoleon")
extensions.append("sphinx.ext.doctest")
Expand All @@ -156,7 +158,10 @@ def create_sphinx_application(self):
"autosectionlabel_maxdepth", self.config.section_label_depth
)

extensions.append("sphinx_autodoc_typehints")
extensions.append("sphinx.ext.intersphinx")
conf.setdefault(
"intersphinx_mapping", {"python": ("https://docs.python.org/3", None)}
)

extensions.append("mudkip.extension")

Expand Down
27 changes: 4 additions & 23 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 6 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,17 @@ keywords = [

[tool.poetry.dependencies]
python = "^3.8"
Sphinx = "^4.2.0"
click = "^8.0.1"
watchdog = "^2.1.5"
sphinx-autodoc-typehints = "^1.12.0"
Sphinx = "^4.4.0"
click = "^8.0.4"
watchdog = "^2.1.6"
sphinx-rtd-theme = "^1.0.0"
livereload = "^2.6.3"
tomlkit = "^0.7.0"
notebook = "^6.4.4"
notebook = "^6.4.8"
jupyter_nbextensions_configurator = "^0.4.1"
colorama = {version = "*", markers = 'sys_platform == "win32"'}
myst-parser = "^0.15.2"
myst-nb = "^0.13.0"
furo = ">=2021.9.22,<2023.0.0"
myst-nb = "^0.13.2"
furo = "^2022.2.14"

[tool.poetry.dev-dependencies]
black = "^22.1"
Expand Down

0 comments on commit ed51b54

Please sign in to comment.