32ca8c1208
CI / Lint, Typecheck & Test (push) Successful in 1m57s
1. 新建 docs/ Sphinx 文档结构 (conf.py + 8 个 rst 章节), napoleon 支持 Google/NumPy docstring, rtd 主题, 自动生成 API 参考与错误家族文档 2. 新建 .readthedocs.yaml 配置, pyproject.toml 加 docs 依赖 3. 删除 runner.py 的 _apply_verbose_to_graph 死代码及对应测试 (功能已移入 executors.run 统一处理) 4. 更新 README: CLI 示例改为 pf 统一入口, 模块结构表补全 cli/pf.py/cli/configs/cli/_ops 等模块 5. 修复版本不一致 (pyproject.toml 0.3.5 → 0.4.5) 6. 加文档徽章链接到 ReadTheDocs
66 lines
1.8 KiB
Python
66 lines
1.8 KiB
Python
"""Sphinx 配置.
|
|
|
|
ReadTheDocs 构建 PyFlowX 文档站。
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
# 确保 src/ 在 sys.path 中, autodoc 能导入 pyflowx
|
|
sys.path.insert(0, str(Path(__file__).resolve().parent.parent / "src"))
|
|
|
|
from pyflowx import __version__
|
|
|
|
# -- 项目信息 --------------------------------------------------------------
|
|
project = "PyFlowX"
|
|
author = "pyflowx"
|
|
copyright = "2024, pyflowx"
|
|
release = __version__
|
|
version = __version__
|
|
|
|
# -- Sphinx 配置 -----------------------------------------------------------
|
|
extensions = [
|
|
"sphinx.ext.autodoc",
|
|
"sphinx.ext.napoleon",
|
|
"sphinx.ext.viewcode",
|
|
"sphinx.ext.intersphinx",
|
|
"myst_parser",
|
|
]
|
|
|
|
# -- 主题 ------------------------------------------------------------------
|
|
html_theme = "sphinx_rtd_theme"
|
|
html_static_path = ["_static"]
|
|
|
|
# -- autodoc 配置 ----------------------------------------------------------
|
|
autodoc_default_options = {
|
|
"members": True,
|
|
"undoc-members": True,
|
|
"show-inheritance": True,
|
|
"member-order": "bysource",
|
|
}
|
|
autodoc_type_hints = "description"
|
|
autodoc_typehints_format = "short"
|
|
|
|
# -- napoleon 配置 (Google/NumPy docstring 兼容) --------------------------
|
|
napoleon_google_docstring = True
|
|
napoleon_numpy_docstring = True
|
|
napoleon_include_init_with_doc = False
|
|
napoleon_include_private_with_doc = False
|
|
napoleon_include_special_with_doc = True
|
|
|
|
# -- intersphinx -----------------------------------------------------------
|
|
intersphinx_mapping = {
|
|
"python": ("https://docs.python.org/3", None),
|
|
}
|
|
|
|
# -- 全局选项 ---------------------------------------------------------------
|
|
language = "zh_CN"
|
|
master_doc = "index"
|
|
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
|
|
source_suffix = {
|
|
".rst": "restructuredtext",
|
|
".md": "markdown",
|
|
}
|