This release is a pre-release and may not be stable for production use.
mockautodoc
Mock imports for build docs without install packages in environment.
This extension add :mockimport: and :mocktype: for standard automodule derictive from autodoc.
Main goal of extension is to solve task defined on question.
Install
pip install sphinxcontrib-mockautodoc
Usage
Add mockautodoc to extensions list:
extenstion = ['sphinx.ext.autodoc', 'sphinxcontrib.mockautodoc', ]
The extension add two options to standard automodule:
:mockimport: list of name spaces to mock separated by ‘,’.
- :mocktype: list of objects which must be mock as type object
for right way subclass them in sources, separated by ‘,’.
If you have module for documenting:
from twisted.internet import protocol, defer
@defer.inlineCallbacks
def my_func():
"""my function"""
pass
class MyProtocol(protocol.Protocol):
"""my protocol"""
pass
And twisted not installed you can document module like that:
.. automodule:: package
:mockimport: twisted
:mocktype: protocol.Protocol
Where on :mockimport: will be mocked all twisted.* imports in automodule building context. And :mocktype: means which instances must be object types to successful subclass them without loss target documentation.
mockatudoc settings may be defined on conf.py and all automodule directives with present :mockimport: will be mocked. Where data on mockatodoc settings will be summed with :mockimport: and :mocktype: options:
mockautodoc = {
'mockimport': ['twisted',],
'mocktype': ['protocol.Protocol'],
}
Metadata
Release files for sphinxcontrib-mockautodoc 0.0.1dev-20130518
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sphinxcontrib-mockautodoc-0.0.1dev-20130518.tar.gz | 7.5 kB | Without provenance | Details for sphinxcontrib-mockautodoc-0.0.1dev-20130518.tar.gz |
Release files / sphinxcontrib-mockautodoc-0.0.1dev-20130518.tar.gz
| Download URL | sphinxcontrib-mockautodoc-0.0.1dev-20130518.tar.gz |
|---|---|
| Size | 7.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1822573183d1c70f3b2e846094586d8c195f6fc7d52e6286bc55f5c8694b2b98
|
|
BLAKE2b-256 checksum How to use checksums |
56a359c4e10ab2b73b5127b8032fe65ca614bb82bdd16ffb2db94a01674a250d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for sphinxcontrib-mockautodoc 0.0.1dev-20130518
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.