From 6fa9768545c69b2c17035b7a1282f243ac22532f Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 8 Feb 2018 18:54:20 -0200 Subject: [PATCH] Use sphinxcontrib-trio extension This adds some more capabilities to sphinx, like marking functions as decorators or with contexts --- doc/en/builtin.rst | 2 ++ doc/en/conf.py | 11 ++++++----- doc/en/requirements.txt | 1 + tox.ini | 1 + 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/doc/en/builtin.rst b/doc/en/builtin.rst index a380b9abd18..5a4ea4b43ac 100644 --- a/doc/en/builtin.rst +++ b/doc/en/builtin.rst @@ -59,6 +59,8 @@ Fixtures and requests To mark a fixture function: .. autofunction:: _pytest.fixtures.fixture + :noindex: + :decorator: Tutorial at :ref:`fixtures`. diff --git a/doc/en/conf.py b/doc/en/conf.py index 40f1e4165e4..f5c17404b4e 100644 --- a/doc/en/conf.py +++ b/doc/en/conf.py @@ -18,8 +18,11 @@ # The full version, including alpha/beta/rc tags. # The short X.Y version. -import os, sys +import os +import sys + from _pytest import __version__ as version + release = ".".join(version.split(".")[:2]) # If extensions (or modules to document with autodoc) are in another directory, @@ -38,7 +41,7 @@ # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['sphinx.ext.autodoc', 'sphinx.ext.todo', 'sphinx.ext.autosummary', - 'sphinx.ext.intersphinx', 'sphinx.ext.viewcode'] + 'sphinx.ext.intersphinx', 'sphinx.ext.viewcode', 'sphinxcontrib_trio'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -310,9 +313,7 @@ # Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = {'python': ('http://docs.python.org/', None), -# 'lib': ("http://docs.python.org/2.7library/", None), - } +intersphinx_mapping = {'python': ('http://docs.python.org/3', None)} def setup(app): diff --git a/doc/en/requirements.txt b/doc/en/requirements.txt index 72bb60a811f..e3cc47ed5a5 100644 --- a/doc/en/requirements.txt +++ b/doc/en/requirements.txt @@ -1,3 +1,4 @@ # pinning sphinx to 1.4.* due to search issues with rtd: # https://github.com/rtfd/readthedocs-sphinx-ext/issues/25 sphinx ==1.4.* +sphinxcontrib-trio diff --git a/tox.ini b/tox.ini index 12e7a57fb5e..ecbe20af933 100644 --- a/tox.ini +++ b/tox.ini @@ -129,6 +129,7 @@ basepython = python changedir = doc/en deps = sphinx + sphinxcontrib-trio attrs PyYAML