Skip to content

Commit cb4a9d4

Browse files
SilverRainZcodexDeepSeek
authored
chore: update project template (#47)
* chore: Update project template to sphinx-notes/cookiecutter@233a8daa Co-authored-by: OpenAI <noreply@openai.com> * chore: Update project template to sphinx-notes/cookiecutter@463b120a Co-authored-by: DeepSeek <service@deepseek.com> --------- Co-authored-by: OpenAI <noreply@openai.com> Co-authored-by: DeepSeek <service@deepseek.com>
1 parent 33b64bb commit cb4a9d4

24 files changed

Lines changed: 134 additions & 75 deletions

.cruft.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"template": "https://github.com/sphinx-notes/template",
3-
"commit": "4c6b17aec1a4b8ddca95c4882c6bed2bc230d595",
3+
"commit": "463b120aec3391878cf9453ca26280bf5258c08d",
44
"checkout": null,
55
"context": {
66
"cookiecutter": {
@@ -12,6 +12,8 @@
1212
"version": "1.2",
1313
"github_owner": "sphinx-notes",
1414
"github_repo": "snippet",
15+
"generated_file_header": "This file is generated from sphinx-notes/cookiecutter.",
16+
"dont_edit_header": "DO NOT EDIT.",
1517
"pypi_name": "sphinxnotes-picker",
1618
"pypi_owner": "SilverRainZ",
1719
"is_python_project": true,
@@ -20,7 +22,7 @@
2022
"sphinx_version": "7.0",
2123
"development_status": "3 - Alpha",
2224
"_template": "https://github.com/sphinx-notes/template",
23-
"_commit": "4c6b17aec1a4b8ddca95c4882c6bed2bc230d595"
25+
"_commit": "233a8daa4e276a9559975a51178f29e7079dcafd"
2426
}
2527
},
2628
"directory": null

.github/workflows/lint.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
# This file is generated from sphinx-notes/cookiecutter.
2+
13
name: Ruff
24
on: [ push, pull_request ]
35

46
jobs:
57
ruff:
68
runs-on: ubuntu-latest
79
steps:
8-
- uses: actions/checkout@v4
10+
- uses: actions/checkout@v6
911
- uses: chartboost/ruff-action@v1

.github/workflows/pages.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# This file is generated from sphinx-notes/cookiecutter.
2+
13
name: Deploy Sphinx documentation to Pages
24

35
# Runs on pushes targeting the default branch

.github/workflows/pypi.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# This file is generated from sphinx-notes/cookiecutter.
2+
13
name: Publish package distributions to PyPI
24

35
on:
@@ -14,8 +16,8 @@ jobs:
1416
permissions:
1517
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
1618
steps:
17-
- uses: actions/checkout@v4
18-
- uses: actions/setup-python@v5
19+
- uses: actions/checkout@v6
20+
- uses: actions/setup-python@v6
1921
- run: pip install build twine && make dist
2022
- uses: pypa/gh-action-pypi-publish@release/v1
2123
with:

.github/workflows/release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# This file is generated from sphinx-notes/cookiecutter.
2+
13
name: Publish Github Release
24

35
on:
@@ -11,7 +13,7 @@ jobs:
1113
permissions:
1214
contents: write
1315
steps:
14-
- uses: actions/checkout@v4
16+
- uses: actions/checkout@v6
1517
- uses: ncipollo/release-action@v1
1618
with:
1719
body: |

.github/workflows/test.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# This file is generated from sphinx-notes/cookiecutter.
2+
13
name: Test
24
on:
35
push:
@@ -8,18 +10,19 @@ jobs:
810
test:
911
runs-on: ubuntu-latest
1012
steps:
11-
- uses: actions/checkout@v2
12-
- uses: actions/setup-python@v5
13+
- uses: actions/checkout@v6
14+
- uses: actions/setup-python@v6
1315
with:
1416
python-version-file: 'pyproject.toml'
1517
- run: python3 -m pip install .[test]
1618
- run: make test
1719
doctest:
1820
runs-on: ubuntu-latest
1921
steps:
20-
- uses: actions/checkout@v2
21-
- uses: actions/setup-python@v5
22+
- uses: actions/checkout@v6
23+
- uses: actions/setup-python@v6
2224
with:
2325
python-version-file: 'pyproject.toml'
24-
- run: python3 -m pip install .[docs]
26+
- run: python3 -m pip install .[test]
27+
- run: python3 -m pip install -r docs/requirements.txt
2528
- run: make doctest

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# This file is generated from sphinx-notes/cookiecutter.
2+
13
# Byte-compiled / optimized / DLL files
24
__pycache__/
35
*.py[cod]

.pre-commit-config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# This file is generated from sphinx-notes/cookiecutter.
2+
13
repos:
24
- repo: https://github.com/astral-sh/ruff-pre-commit
35
rev: v0.14.11

AGENTS.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<!-- This file is generated from sphinx-notes/cookiecutter. -->
2+
3+
## 基本说明
4+
5+
这是一个由 SphinxNotes 开发的 Sphinx Extension,由 `sphinxnotes/cookiecutter` 生成,很多基础文件来自模板。
6+
7+
## 首先阅读
8+
9+
- 开始了解项目时,优先阅读 `docs/index.rst`
10+
- 如果任务和文档、Sphinx 配置或示例有关,继续阅读 `docs/` 下的其他文件
11+
12+
## 通用知识
13+
14+
- 使用 `make` 会构建 `docs/` 下的文档,文档自依赖当前项目,因此文档构建成功也意味着项目基本能正常构建
15+
- `docs/_build` 存放构建好的文档,`make clean` 清除所有构建结果
16+
- `make test` 运行测试,测试位于 `tests/`,可能的 e2e 测试位于 `tests/test_e2e.py`
17+
- `make doctest` 运行 Sphinx 文档测试
18+
- `make install` 使用 `pip install --user` 将项目安装到本地,跨项目测试时常用
19+
- `make tmpl-*` 用于模板同步,参看 "模板同步" 小节
20+
21+
## 关于 SphinxNotes 项目
22+
23+
- 同为 `sphinxnotes` 项目的其他仓库通常位于当前项目的上一级目录
24+
- 如果你在阅读代码时遇到本地依赖、模板来源或跨仓库复用关系,可以直接读取这些本地仓库文件,不必先猜测实现,也不必优先去远程搜索。
25+
- 当我提到 "所有项目" 的时候,请从当前项目的上一级目录的 `cookiecutter/project-list.txt` 获取项目列表
26+
- `docs/conf.py` 往往会直接从源码树导入当前项目,因此排查文档构建问题时,要同时检查运行时依赖和文档依赖。
27+
28+
## 模板同步
29+
30+
- 先确认任务是当前项目问题,还是模板问题;如果是模板问题,优先在 `sphinxnotes/cookiecutter` 中修复。
31+
- 模板变更完成后,优先使用 `make tmpl-update` 把改动同步回项目,而不是手工重复修改生成文件。
32+
- 如果 `make tmpl-update` 产生 `.rej`、冲突或三方合并失败,优先尝试 `make tmpl-apply-rej`,再手工解决冲突。
33+
- 手工解决冲突时,重点检查 `README.rst``pyproject.toml``.github/workflows/``docs/conf.py``docs/requirements.txt` 这些常见受影响文件。
34+
- 当模板同步结果确认无误后,优先使用 `make tmpl-update-done` 完成后续收尾步骤。
35+
36+
### 修改约定
37+
38+
- 修改模板生成文件时,保留原有注释,除非模板本身已经统一移除了这些注释。
39+
- 遇到 `CUSTOM ... START` / `END` 这类用户自定义区块时,必须保留这些锚点,并尽量保留区块中的用户内容。
40+
- 如果模板更新和项目内手工修改发生冲突,优先保护用户自定义内容,再整理模板变更。

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# This file is generated from sphinx-notes/cookiecutter.
2-
# You need to consider modifying the TEMPLATE or modifying THIS FILE.
32

43
include LICENSE
54
include README.rst

0 commit comments

Comments
 (0)