seed_intersphinx_mapping
¶
Populate the Sphinx ‘intersphinx_mapping’ dictionary from the project’s requirements.
Changed in version 0.5.0: The functions formerly in seed_intersphinx_mapping.core
can now be found here.
Functions:
Returns the fallback mapping for projects that do not provide a link to their documentation on PyPI. |
|
|
Returns the URL to the given project’s Sphinx documentation. |
|
Returns an intersphinx mapping dictionary for the project’s requirements. |
-
fallback_mapping
()[source]¶ Returns the fallback mapping for projects that do not provide a link to their documentation on PyPI.
The mapping is loaded from JSON data on demand, and consists of
project_name: url
pairs.
-
get_sphinx_doc_url
(pypi_name)[source]¶ Returns the URL to the given project’s Sphinx documentation.
Not all projects include this URL in their distributions, and therefore it may not be possible to determine it from PyPI.
Responses are cached to prevent overloading the PyPI server. The cache can be cleared as follows:
python3 -m seed_intersphinx_mapping
- Parameters
pypi_name (
str
) – The name of the project on PyPI- Return type
- Returns
The URL of the project’s Sphinx documentation.
- Raises
ValueError
if the url could not be determined.packaging.requirements.InvalidRequirement
if the project could not be found on PyPI.
Changed in version 0.4.0: Now raises
InvalidRequirement
rather thanapeye.slumber_url.exceptions.HttpNotFoundError
if the project could not be found on PyPI.
-
seed_intersphinx_mapping
(*requirements)[source]¶ Returns an intersphinx mapping dictionary for the project’s requirements.
- Parameters
*requirements (
Union
[Requirement
,str
]) – The requirements to find the documentation for.
Changed in version 0.4.0: Now takes the requirements as arguments rather than a directory to read the
requirements.txt
file from.