
Security News
Next.js Patches Critical Middleware Vulnerability (CVE-2025-29927)
Next.js has patched a critical vulnerability (CVE-2025-29927) that allowed attackers to bypass middleware-based authorization checks in self-hosted apps.
sphinxcontrib-mockautodoc
Advanced tools
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_.
::
pip install sphinxcontrib-mockautodoc
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'],
}
.. _twisted: http://twistedmatrix.com/ .. _autodoc: http://sphinx-doc.org/ext/autodoc.html .. _question: http://stackoverflow.com/questions/15587305/any-ways-build-docs-by-sphinx-with-both-python2-x-and-python3-x-ecosystems
FAQs
Sphinx mocking autodoc extension
We found that sphinxcontrib-mockautodoc demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Next.js has patched a critical vulnerability (CVE-2025-29927) that allowed attackers to bypass middleware-based authorization checks in self-hosted apps.
Security News
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
Product
Socket, the leader in open source security, is now available on Google Cloud Marketplace for simplified procurement and enhanced protection against supply chain attacks.