Sphinx 3.4¶
版本 3.4.3 (发布于 2021 年 1 月 8 日)¶
修复的 Bug¶
#8655: autodoc: 如果目标模块包含在
hasattr()上引发异常的对象,则无法生成文档
版本 3.4.2 (发布于 2021 年 1 月 4 日)¶
修复的 Bug¶
#8164: autodoc: 继承模拟类的类未被记录
#8602: autodoc:
autodoc-process-docstring事件意外地发送给非数据描述符#8616: autodoc: 将非类对象传递给 autoclass 指令时引发 AttributeError
版本 3.4.1 (发布于 2020 年 12 月 25 日)¶
修复的 Bug¶
#8559: autodoc: 使用前向引用类型注解时引发 AttributeError
#8568: autodoc: 检查 slots 属性时引发 TypeError
#8567: autodoc: 实例属性错误地添加到父类
#8566: autodoc:
autodoc-process-docstring事件意外地发送给别名类#8583: autodoc: 通过
__eq__方法进行不必要的对象比较#8565: linkcheck: 修复链接元组不可比较时 PriorityQueue 崩溃的问题
版本 3.4.0 (发布于 2020 年 12 月 20 日)¶
不兼容的变更¶
#8105: autodoc: 对于装饰类将显示类构造函数的签名,而不是装饰器的签名
已弃用¶
sphinx.util.inspect.signature()的follow_wrapped参数sphinx.ext.autodoc.Documenter.add_content()的no_docstring参数sphinx.ext.autodoc.Documenter.get_object_members()sphinx.ext.autodoc.DataDeclarationDocumentersphinx.ext.autodoc.GenericAliasDocumentersphinx.ext.autodoc.InstanceAttributeDocumentersphinx.ext.autodoc.SlotsAttributeDocumentersphinx.ext.autodoc.TypeVarDocumentersphinx.ext.autodoc.importer._getannotations()sphinx.ext.autodoc.importer._getmro()sphinx.pycode.ModuleAnalyzer.parse()sphinx.util.osutil.movefile()sphinx.util.requests.is_ssl_error()
新增功能¶
#8119: autodoc: 允许通过
autodoc-skip-member事件决定模块__all__属性中未包含的成员是否应被记录#8219: autodoc: 当超类是泛型类且给定 show-inheritance 选项时(在 Python 3.7 或更高版本中),不显示泛型类的参数
autodoc: 添加
Documenter.config作为访问配置对象的快捷方式autodoc: 如果默认值设置为
None,则将Optional[t]添加到函数和方法的注解中。#8209: autodoc: 为
autoattribute和autodata指令添加:no-value:选项以抑制变量的默认值#8460: autodoc: 支持 typing.NewType 定义的自定义类型
#8285: napoleon: 添加
napoleon_attr_annotations,以便在 docstring 中指定任何类型时自动合并源代码中的类型提示#8236: napoleon: 支持 numpydoc 的“Receives”部分
#6914: 添加一个新事件
warn-missing-reference,用于在无法解析交叉引用时自定义警告消息#6914: 在无法解析
:ref:引用时发出详细警告#6629: linkcheck: 构建器现在处理速率限制。有关详细信息,请参阅
linkcheck_rate_limit_timeout。
修复的 Bug¶
#7613: autodoc: autodoc 不遵守类的 __signature__
#4606: autodoc: 继承方法的警告位置不正确
#8105: autodoc: 如果类被装饰,则类构造函数的签名不正确
#8434: autodoc:
autodoc_type_aliases不影响变量和属性#8443: autodoc: autodata 指令无法为基于 PEP-526 的类型注解变量创建文档
#8443: autodoc: autoattribute 指令无法为基于 PEP-526 的未初始化变量创建文档
#8480: autodoc: autoattribute 无法为 __slots__ 属性创建文档
#8503: autodoc: autoattribute 无法正确地为作为类属性的 GenericAlias 创建文档
#8534: autodoc: autoattribute 无法为别名类中带注释的属性创建文档
#8452: autodoc: 当 autodoc_typehints 设置为“description”时,autodoc_type_aliases 不起作用
#8541: autodoc: autodoc_type_aliases 对实例属性的类型注解不起作用
#8460: autodoc: autodata 和 autoattribute 指令不显示 TypeVars 的类型信息
#8493: autodoc: 对内置类型的引用在类别名中不起作用
#8522: autodoc:
__bool__方法可能被调用#8067: autodoc: 不显示超类中带有 type_comment 的实例变量的类型提示
#8545: autodoc: 即使有 docstring,__slots__ 属性也未被记录
#741: autodoc: inherited-members 对超类中的实例属性不起作用
#8477: autosummary: 当模板包含多字节字符时,生成非 utf-8 reST 文件
#8501: autosummary: 摘要提取在“el at.”之后意外地拆分文本
#8524: html: 在名为“index”的文档上生成了错误的 url_root
#8419: html search: 在非搜索页面中不加载
language_data.js#8549: i18n:
-D gettext_compact=0不再起作用#8454: graphviz: graph 和 digraph 指令的 layout 选项不起作用
#8131: linkcheck: 当 HEAD 请求导致 Too Many Redirects 时使用 GET,以适应 HEAD 上的无限重定向循环
#8437: Makefile: 使用空的 BUILDDIR 执行
make clean很危险#8365: py domain:
:type:和:rtype:给出错误的模糊类查找警告#8352: std domain: 无法解析以方括号开头的选项
#8519: LaTeX: 防止 seealso 中间出现分页符
#8520: C,修复 AliasNode 的复制。