Depend on another extension

あなたの拡張が他のSphinxの拡張機能に依存していることが、時としてあります。ほとんどのSphinx拡張機能は各プロジェクトの conf.py ファイル内でアクティベートされますが,一拡張開発者としてあなたが都度そこまで設定することはできません。

To ensure that another extension is activated as a part of your own extension, use the sphinx.application.Sphinx.setup_extension() method. This will activate another extension at run-time, ensuring that you have access to its functionality.

For example, the following code activates the sphinx.ext.autodoc extension:

def setup(app):
    app.setup_extension('sphinx.ext.autodoc')

注釈

あなたの拡張機能が他のものに依存するとき、拡張のインストール条件の一環としてそれを必ずインクルードするようにしてください。