Installation

python3 -m pip install extras_require --user

Enable extras_require by adding the following to the extensions variable in your conf.py:

extensions = [
    ...
    'sphinx-prompt',
    'sphinxcontrib.extras_require',
    ]

For more information see https://www.sphinx-doc.org/en/master/usage/extensions#third-party-extensions .