Usage

Installation

python3 -m pip install seed_intersphinx_mapping --user

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

extensions = [
    ...
    'seed_intersphinx_mapping',
    ]

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

Configuration

pkg_requirements_source

The requirements source. This may be one of:

  • A list of directories (relative to repository_root) in which to search for requirements.txt files. Any files found will be used to compile the list of requirements.

  • The string 'requirements'. The list of requirements will be determined from the requirements.txt file in the directory given by the repository_root option.

  • The string 'pyproject' (or 'pyproject.toml'). The list will be parsed from the [project.dependencies] table of the pyproject.toml file in the repository_root.

    See also

    PEP 621 – Storing project metadata in pyproject.toml

  • The string 'flit'. The list will be parsed from the [tool.flit.metadata.requires] table of the pyproject.toml file in the repository_root.

repository_root

The path to the repository root, relative to the Sphinx source directory.

E.g., for this repository structure:

.
├── LICENSE
├── README.rst
├── doc-source  # <- this is the Sphinx source directory
│   ├── index.rst
│   └── conf.py
├── requirements.txt  # <- this is the file containing the requirements
├── seed_intersphinx_mapping
│   └── __init__.py
├── setup.py
├── tests
└── tox.ini

the value would be '..', which is the default.

Caching

seed_intersphinx_mapping caches the documentation URLs for PyPI packages. The cache can be cleared as follows:

python3 -m seed_intersphinx_mapping