ChatCDN 0.1.0__tar.gz → 0.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. chatcdn-0.1.2/.github/workflows/ci.yml +38 -0
  2. chatcdn-0.1.2/.github/workflows/deploy.yaml +22 -0
  3. chatcdn-0.1.2/.github/workflows/preview.yaml +59 -0
  4. chatcdn-0.1.2/.github/workflows/publish.yml +90 -0
  5. chatcdn-0.1.2/AGENTS.md +8 -0
  6. chatcdn-0.1.2/CHANGELOG.md +36 -0
  7. chatcdn-0.1.2/DEVELOP.md +24 -0
  8. chatcdn-0.1.2/MANIFEST.in +8 -0
  9. {chatcdn-0.1.0/src/ChatCDN.egg-info → chatcdn-0.1.2}/PKG-INFO +7 -6
  10. chatcdn-0.1.2/README.en.md +63 -0
  11. {chatcdn-0.1.0 → chatcdn-0.1.2}/README.md +2 -1
  12. chatcdn-0.1.2/docs/capability-map.en.md +35 -0
  13. chatcdn-0.1.2/docs/capability-map.md +35 -0
  14. chatcdn-0.1.2/docs/cli-tree.en.md +42 -0
  15. chatcdn-0.1.2/docs/cli-tree.md +42 -0
  16. chatcdn-0.1.2/docs/index.en.md +60 -0
  17. chatcdn-0.1.2/docs/index.md +60 -0
  18. chatcdn-0.1.2/docs/interface-tree.md +23 -0
  19. chatcdn-0.1.2/mkdocs.yml +68 -0
  20. {chatcdn-0.1.0 → chatcdn-0.1.2}/pyproject.toml +2 -2
  21. {chatcdn-0.1.0 → chatcdn-0.1.2/src/ChatCDN.egg-info}/PKG-INFO +7 -6
  22. chatcdn-0.1.2/src/ChatCDN.egg-info/SOURCES.txt +33 -0
  23. {chatcdn-0.1.0 → chatcdn-0.1.2}/src/ChatCDN.egg-info/requires.txt +4 -4
  24. {chatcdn-0.1.0 → chatcdn-0.1.2}/src/chatcdn/__init__.py +1 -1
  25. chatcdn-0.1.2/src/chatcdn/cli.py +119 -0
  26. chatcdn-0.1.2/tests/test_cli.py +37 -0
  27. chatcdn-0.1.2/tests/test_docs_contract.py +27 -0
  28. {chatcdn-0.1.0 → chatcdn-0.1.2}/tests/test_version.py +1 -1
  29. chatcdn-0.1.2/tests/test_workflow_contract.py +32 -0
  30. chatcdn-0.1.0/src/ChatCDN.egg-info/SOURCES.txt +0 -14
  31. chatcdn-0.1.0/src/chatcdn/cli.py +0 -17
  32. chatcdn-0.1.0/tests/test_cli.py +0 -11
  33. {chatcdn-0.1.0 → chatcdn-0.1.2}/LICENSE +0 -0
  34. {chatcdn-0.1.0 → chatcdn-0.1.2}/setup.cfg +0 -0
  35. {chatcdn-0.1.0 → chatcdn-0.1.2}/src/ChatCDN.egg-info/dependency_links.txt +0 -0
  36. {chatcdn-0.1.0 → chatcdn-0.1.2}/src/ChatCDN.egg-info/entry_points.txt +0 -0
  37. {chatcdn-0.1.0 → chatcdn-0.1.2}/src/ChatCDN.egg-info/top_level.txt +0 -0
  38. {chatcdn-0.1.0 → chatcdn-0.1.2}/src/chatcdn/config.py +0 -0
@@ -0,0 +1,38 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ - master
8
+ pull_request:
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ jobs:
14
+ test:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ - name: Configure Git Credentials
19
+ run: |
20
+ git config user.name github-actions[bot]
21
+ git config user.email 41898282+github-actions[bot]@users.noreply.github.com
22
+ - uses: actions/setup-python@v5
23
+ with:
24
+ python-version: "3.10"
25
+ - name: Install package and test dependencies
26
+ run: python -m pip install --upgrade pip && python -m pip install -e ".[dev,docs]"
27
+ - name: Run tests
28
+ run: python -m pytest -q
29
+ - name: Build docs
30
+ run: mkdocs build --strict
31
+ - name: Smoke installed CLI
32
+ run: |
33
+ chatcdn --version
34
+ chatcdn --tree
35
+ - name: Build distributions
36
+ run: python -m build
37
+ - name: Check distributions
38
+ run: python -m twine check dist/*
@@ -0,0 +1,22 @@
1
+ name: Deploy Docs
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ - master
8
+
9
+ permissions:
10
+ contents: write
11
+
12
+ jobs:
13
+ deploy:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - uses: actions/setup-python@v5
18
+ with:
19
+ python-version: "3.10"
20
+ - run: python -m pip install --upgrade pip
21
+ - run: python -m pip install -e ".[docs]"
22
+ - run: mkdocs gh-deploy --force
@@ -0,0 +1,59 @@
1
+ name: Preview Docs
2
+
3
+ on:
4
+ pull_request:
5
+ branches:
6
+ - main
7
+ - master
8
+
9
+ permissions:
10
+ contents: write
11
+ pull-requests: write
12
+
13
+ jobs:
14
+ deploy:
15
+ runs-on: ubuntu-latest
16
+ if: ${{ !github.event.pull_request.head.repo.fork }}
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ - name: Configure Git Credentials
20
+ run: |
21
+ git config user.name github-actions[bot]
22
+ git config user.email 41898282+github-actions[bot]@users.noreply.github.com
23
+ - uses: actions/setup-python@v5
24
+ with:
25
+ python-version: "3.10"
26
+ - name: Install docs dependencies
27
+ run: python -m pip install --upgrade pip && python -m pip install -e ".[docs]"
28
+ - name: Deploy preview docs
29
+ run: |
30
+ git fetch origin gh-pages || true
31
+ mike deploy dev -p --allow-empty
32
+ site_url=$(python - <<'PY'
33
+ from pathlib import Path
34
+ for line in Path("mkdocs.yml").read_text(encoding="utf-8").splitlines():
35
+ if line.startswith("site_url:"):
36
+ print(line.split(":", 1)[1].strip().rstrip("/"))
37
+ break
38
+ else:
39
+ raise SystemExit("mkdocs.yml is missing site_url")
40
+ PY
41
+ )
42
+ preview_url="${site_url}/dev/"
43
+ echo "CHATARCH_PREVIEW_URL=${preview_url}" >> "$GITHUB_ENV"
44
+ echo "Preview URL: ${preview_url}" >> "$GITHUB_STEP_SUMMARY"
45
+ - name: Comment PR with Preview Link
46
+ uses: actions/github-script@v7
47
+ with:
48
+ script: |
49
+ const marker = '<!-- chatcdn-preview-docs -->';
50
+ const previewLink = process.env.CHATARCH_PREVIEW_URL;
51
+ const body = `${marker}\nPreview Docs: ${previewLink}`;
52
+ const { payload, repo } = context;
53
+ const comments = await github.rest.issues.listComments({ owner: repo.owner, repo: repo.repo, issue_number: payload.number });
54
+ const existing = comments.data.find(comment => comment.body.includes(marker));
55
+ if (existing) {
56
+ await github.rest.issues.updateComment({ owner: repo.owner, repo: repo.repo, comment_id: existing.id, body });
57
+ } else {
58
+ await github.rest.issues.createComment({ owner: repo.owner, repo: repo.repo, issue_number: payload.number, body });
59
+ }
@@ -0,0 +1,90 @@
1
+ name: Publish Package
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ publish:
13
+ runs-on: ubuntu-latest
14
+ permissions:
15
+ contents: read
16
+ id-token: write
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ with:
20
+ fetch-depth: 0
21
+ - uses: actions/setup-python@v5
22
+ with:
23
+ python-version: "3.10"
24
+ - name: Resolve package version
25
+ id: meta
26
+ run: |
27
+ python - <<'PY'
28
+ import ast
29
+ import os
30
+ from pathlib import Path
31
+
32
+ module = ast.parse(Path("src/chatcdn/__init__.py").read_text(encoding="utf-8"))
33
+ for stmt in module.body:
34
+ if not isinstance(stmt, ast.Assign):
35
+ continue
36
+ if any(isinstance(target, ast.Name) and target.id == "__version__" for target in stmt.targets):
37
+ version = ast.literal_eval(stmt.value)
38
+ break
39
+ else:
40
+ raise SystemExit("__version__ not found in src/chatcdn/__init__.py")
41
+
42
+ with open(os.environ["GITHUB_OUTPUT"], "a", encoding="utf-8") as output:
43
+ print(f"version={version}", file=output)
44
+ print(f"tag=v{version}", file=output)
45
+ PY
46
+ - name: Check tag matches package version
47
+ env:
48
+ RELEASE_TAG: ${{ steps.meta.outputs.tag }}
49
+ run: |
50
+ if [ "${GITHUB_REF_NAME}" != "${RELEASE_TAG}" ]; then
51
+ echo "Tag ${GITHUB_REF_NAME} does not match package version ${RELEASE_TAG}."
52
+ exit 1
53
+ fi
54
+ - name: Check release commit is on default branch
55
+ run: |
56
+ git fetch --no-tags origin main:refs/remotes/origin/main
57
+ if ! git merge-base --is-ancestor "${GITHUB_SHA}" "origin/main"; then
58
+ echo "Release commit ${GITHUB_SHA} is not reachable from origin/main."
59
+ exit 1
60
+ fi
61
+ - name: Check PyPI version
62
+ env:
63
+ PACKAGE_NAME: "ChatCDN"
64
+ PACKAGE_VERSION: ${{ steps.meta.outputs.version }}
65
+ run: |
66
+ python - <<'PY'
67
+ import os
68
+ import urllib.error
69
+ import urllib.parse
70
+ import urllib.request
71
+
72
+ package = os.environ["PACKAGE_NAME"]
73
+ version = os.environ["PACKAGE_VERSION"]
74
+ url = f"https://pypi.org/pypi/{urllib.parse.quote(package)}/{urllib.parse.quote(version)}/json"
75
+ try:
76
+ urllib.request.urlopen(url, timeout=10)
77
+ except urllib.error.HTTPError as exc:
78
+ if exc.code == 404:
79
+ raise SystemExit(0)
80
+ raise
81
+ raise SystemExit(f"{package} {version} is already on PyPI")
82
+ PY
83
+ - name: Install build tools
84
+ run: python -m pip install --upgrade pip build twine
85
+ - name: Build
86
+ run: python -m build
87
+ - name: Check dist
88
+ run: python -m twine check dist/*
89
+ - name: Publish to PyPI (OIDC)
90
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,8 @@
1
+ # Agent Notes
2
+
3
+ ## Development Expectations
4
+
5
+ - Keep changes minimal and reviewable.
6
+ - Prefer doc-first CLI tests.
7
+ - Sync docs and changelog with user-facing behavior.
8
+ - Use interactive prompts only when arguments are missing and recoverable.
@@ -0,0 +1,36 @@
1
+ # Changelog
2
+
3
+ ## 0.1.2 - 2026-08-12
4
+
5
+ ### Changed
6
+
7
+ - Enable the MkDocs Material emoji renderer (`pymdownx.emoji` with Material `twemoji`/`to_svg`) for bilingual public docs.
8
+ - Relax the docs extra to `mkdocs-material>=9.5,<10.0`.
9
+ - Harden tag-driven PyPI publishing with package-version, default-branch, and PyPI exact-version guards.
10
+ - Add CI smoke checks for installed `chatcdn --version` and `chatcdn --tree`, plus distribution metadata checks.
11
+ - Derive Preview Docs links from `mkdocs.yml` `site_url`.
12
+
13
+ ## 0.1.1 - 2026-08-10
14
+
15
+ ### Added
16
+
17
+ - Add top-level `chatcdn --tree` generated from the registered Click command tree.
18
+
19
+ ### Changed
20
+
21
+ - Update CLI tree docs, README quickstart, and version tests for the `0.1.1` patch release.
22
+ - Tighten ChatArch internal dependency lower bounds to `chatstyle>=0.1.1,<0.2.0` and `chatenv>=0.2.3,<0.3.0`.
23
+
24
+ ## 0.1.0 - 2026-08-03
25
+
26
+ ### Added
27
+
28
+ - Publish the first formal ChatCDN package baseline with the ChatArch CLI, ChatEnv, bilingual MkDocs, and OIDC release scaffold.
29
+
30
+ ## YYYY-MM-DD
31
+
32
+ ### Added
33
+
34
+ ### Changed
35
+
36
+ ### Fixed
@@ -0,0 +1,24 @@
1
+ # Development Guide
2
+
3
+ ## CLI Rules
4
+
5
+ - Use `chatstyle>=0.1.1,<0.2.0` and `chatenv>=0.2.3,<0.3.0` as the canonical CLI interaction runtime.
6
+ - Prefer `CommandSchema`, `CommandField`, `add_interactive_option()`, and `resolve_command_inputs()` for new commands.
7
+ - Missing required args should auto-enter interactive mode when recoverable.
8
+ - `-i` forces interactive mode; `-I` disables prompting and must fail fast.
9
+ - Prompt defaults must match actual execution defaults.
10
+ - Sensitive values must stay masked in prompts and summaries.
11
+ - Prefer lazy imports in CLI wiring and keep implementation imports local when possible.
12
+
13
+ ## Docs and Tests
14
+
15
+ - Use doc-first CLI testing.
16
+ - Put real CLI coverage under `tests/cli-tests/`.
17
+ - Put mock/fake CLI coverage under `tests/mock-cli-tests/`.
18
+ - Keep `README.md`, `docs/`, and `CHANGELOG.md` in sync with user-facing changes.
19
+
20
+ ## Automation
21
+
22
+ - Keep automation small and reviewable.
23
+ - Prefer commands that can run in CI without interactive prompts.
24
+ - Ensure generated defaults are safe for local development.
@@ -0,0 +1,8 @@
1
+ include README.md
2
+ include README.en.md
3
+ include CHANGELOG.md
4
+ include DEVELOP.md
5
+ include mkdocs.yml
6
+ include AGENTS.md
7
+ recursive-include docs *.md
8
+ recursive-include .github/workflows *.yml *.yaml
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ChatCDN
3
- Version: 0.1.0
3
+ Version: 0.1.2
4
4
  Summary: ChatArch CDN tooling package.
5
5
  Author-email: ChatArch <rex@chatarch.org>
6
6
  License-Expression: MIT
@@ -13,16 +13,16 @@ Classifier: Operating System :: OS Independent
13
13
  Requires-Python: >=3.10
14
14
  Description-Content-Type: text/markdown
15
15
  License-File: LICENSE
16
- Requires-Dist: click>=8.0
17
- Requires-Dist: chatstyle<0.2.0,>=0.1.0
18
- Requires-Dist: chatenv<0.3.0,>=0.2.0
16
+ Requires-Dist: click<9.0,>=8.1
17
+ Requires-Dist: chatstyle<0.2.0,>=0.1.1
18
+ Requires-Dist: chatenv<0.3.0,>=0.2.3
19
19
  Provides-Extra: dev
20
20
  Requires-Dist: build; extra == "dev"
21
21
  Requires-Dist: pytest; extra == "dev"
22
22
  Requires-Dist: twine; extra == "dev"
23
23
  Provides-Extra: docs
24
24
  Requires-Dist: mkdocs<2.0,>=1.6; extra == "docs"
25
- Requires-Dist: mkdocs-material<9.7,>=9.5; extra == "docs"
25
+ Requires-Dist: mkdocs-material<10.0,>=9.5; extra == "docs"
26
26
  Requires-Dist: mkdocs-static-i18n<2.0,>=1.2; extra == "docs"
27
27
  Requires-Dist: mike<3.0,>=2.0; extra == "docs"
28
28
  Dynamic: license-file
@@ -65,13 +65,14 @@ ChatArch CDN tooling package.
65
65
  pip install -e ".[dev]"
66
66
  chatcdn --help
67
67
  chatcdn --version
68
+ chatcdn --tree
68
69
  python -m pytest -q
69
70
  python -m build
70
71
  ```
71
72
 
72
73
  ## 命令行规范
73
74
 
74
- 这个模板默认依赖 `chatstyle>=0.1.0,<0.2.0` 和 `chatenv>=0.2.0,<0.3.0`,新增命令应优先使用:
75
+ 这个模板默认依赖 `chatstyle>=0.1.1,<0.2.0` 和 `chatenv>=0.2.3,<0.3.0`,新增命令应优先使用:
75
76
 
76
77
  - `CommandSchema` / `CommandField` 描述输入。
77
78
  - `add_interactive_option()` 提供统一 `-i/-I`。
@@ -0,0 +1,63 @@
1
+ <div align="center">
2
+ <a href="https://pypi.python.org/pypi/ChatCDN">
3
+ <img src="https://img.shields.io/pypi/v/ChatCDN.svg" alt="PyPI version" />
4
+ </a>
5
+ <a href="https://github.com/ChatArch/ChatCDN/actions/workflows/ci.yml">
6
+ <img src="https://github.com/ChatArch/ChatCDN/actions/workflows/ci.yml/badge.svg" alt="Tests" />
7
+ </a>
8
+ <a href="https://arch.gh.wzhecnu.cn/ChatCDN/">
9
+ <img src="https://img.shields.io/badge/docs-mkdocs-blue.svg" alt="Documentation" />
10
+ </a>
11
+ </div>
12
+
13
+ <div align="center">
14
+
15
+ [English](README.en.md) | [简体中文](README.md)
16
+ </div>
17
+
18
+ # ChatCDN
19
+
20
+ ChatArch CDN tooling package.
21
+
22
+
23
+ Documentation entry: <https://arch.gh.wzhecnu.cn/ChatCDN/en/>
24
+
25
+ Choose documentation by scenario:
26
+
27
+ | Scenario | Document |
28
+ | --- | --- |
29
+ | Install the package, run the CLI, and confirm it works | `docs/cli-tree.en.md` |
30
+ | Check first-class capabilities and current boundaries | `docs/capability-map.en.md` |
31
+ | Call package behavior directly from Python | `docs/interface-tree.md` |
32
+
33
+ ## Quick Start
34
+
35
+ ```bash
36
+ pip install -e ".[dev]"
37
+ chatcdn --help
38
+ chatcdn --version
39
+ chatcdn --tree
40
+ python -m pytest -q
41
+ python -m build
42
+ ```
43
+
44
+ ## CLI Contract
45
+
46
+ This template depends on `chatstyle>=0.1.1,<0.2.0` and `chatenv>=0.2.3,<0.3.0`. New commands should prefer:
47
+
48
+ - `CommandSchema` / `CommandField` for inputs.
49
+ - `add_interactive_option()` for the shared `-i/-I` switch.
50
+ - `resolve_command_inputs()` for missing args, defaults, TTY behavior, and validation.
51
+ - Generate `config.py` and a `chatenv.configs` entry point by default so the package is ChatEnv-discoverable; use `--without-chatenv-provider` only when ChatEnv integration is intentionally not needed.
52
+
53
+ ## Layout
54
+
55
+ - `src/`: package source code
56
+ - `tests/code-tests/`: code tests and migrated historical tests
57
+ - `tests/cli-tests/`: real CLI tests, doc-first
58
+ - `tests/mock-cli-tests/`: mock/fake CLI tests, doc-first
59
+ - `docs/`: long-lived project docs built by mkdocs
60
+
61
+ ## Development Notes
62
+
63
+ See `DEVELOP.md` and `AGENTS.md` before expanding the scaffold.
@@ -36,13 +36,14 @@ ChatArch CDN tooling package.
36
36
  pip install -e ".[dev]"
37
37
  chatcdn --help
38
38
  chatcdn --version
39
+ chatcdn --tree
39
40
  python -m pytest -q
40
41
  python -m build
41
42
  ```
42
43
 
43
44
  ## 命令行规范
44
45
 
45
- 这个模板默认依赖 `chatstyle>=0.1.0,<0.2.0` 和 `chatenv>=0.2.0,<0.3.0`,新增命令应优先使用:
46
+ 这个模板默认依赖 `chatstyle>=0.1.1,<0.2.0` 和 `chatenv>=0.2.3,<0.3.0`,新增命令应优先使用:
46
47
 
47
48
  - `CommandSchema` / `CommandField` 描述输入。
48
49
  - `add_interactive_option()` 提供统一 `-i/-I`。
@@ -0,0 +1,35 @@
1
+ # Capability Map
2
+
3
+ Use this page to check which first-class capabilities `ChatCDN` currently owns, which ones are verified, and what remains out of scope for this package.
4
+
5
+ ## Capability Groups
6
+
7
+ <div class="grid cards" markdown>
8
+
9
+ - **CLI Entry**
10
+
11
+ `chatcdn --help`, `chatcdn --version`, and `chatcdn --tree` are the default verification entry points.
12
+
13
+ - **Python API**
14
+
15
+ Substantive behavior should live in importable Python functions, classes, or service layers rather than only in Click callbacks.
16
+
17
+ - **Config and Environment**
18
+
19
+ ChatEnv integration is enabled by default; stable, shared configuration belongs in `config.py`.
20
+
21
+ </div>
22
+
23
+ ## Current Boundary
24
+
25
+ | Capability | Status | Notes |
26
+ | --- | --- | --- |
27
+ | CLI base entry | Implemented | The Click group exposes `--help`, `--version`, `--tree`, and base tests. |
28
+ | ChatEnv provider | Implemented | The template generates `config.py` and a `chatenv.configs` entry point. |
29
+ | Business commands | Not implemented | Add these from the real package domain; do not fake future commands in the template. |
30
+
31
+ ## Out of Scope
32
+
33
+ - No plan placeholder page is generated.
34
+ - No unimplemented capability should be written as a user operation tutorial.
35
+ - No secret, token, cookie, or Authorization header should appear in README, docs, issues, PR comments, or CI logs.
@@ -0,0 +1,35 @@
1
+ # 能力地图
2
+
3
+ 这个页面用于校对 `ChatCDN` 当前有哪些一等能力、哪些能力已经验证,以及哪些事情不属于当前包。
4
+
5
+ ## 能力分组
6
+
7
+ <div class="grid cards" markdown>
8
+
9
+ - **命令行入口**
10
+
11
+ `chatcdn --help`、`chatcdn --version` 和 `chatcdn --tree` 是默认可验证入口。
12
+
13
+ - **Python 接口**
14
+
15
+ 实质能力应放到可 import 的 Python 函数、类或 service 层,而不是只写在 Click 回调里。
16
+
17
+ - **配置与环境**
18
+
19
+ 默认接入 ChatEnv;长期、常用、跨命令共享的配置放入 `config.py`。
20
+
21
+ </div>
22
+
23
+ ## 当前边界
24
+
25
+ | 能力 | 状态 | 说明 |
26
+ | --- | --- | --- |
27
+ | 命令行基础入口 | 已实现 | Click group 提供 `--help`、`--version`、`--tree` 和基础测试。 |
28
+ | ChatEnv 配置提供者 | 已实现 | 默认生成 `config.py` 和 `chatenv.configs` 入口点。 |
29
+ | 业务命令 | 未实现 | 按当前包真实需求补充,不能在模板里伪造未来命令。 |
30
+
31
+ ## 不在当前范围
32
+
33
+ - 不生成计划类占位页。
34
+ - 不把未实现能力写成用户可执行教程。
35
+ - 不在 README、docs、issue、PR 评论或 CI log 中输出 secret、token、cookie 或 Authorization header。
@@ -0,0 +1,42 @@
1
+ # CLI Capability Map
2
+
3
+ This page is the compact capability map for the `ChatCDN` CLI. Keep the documented command tree aligned with the runtime `chatcdn --tree` output; do not present unimplemented commands as available operations.
4
+
5
+ Importable Python functions are mapped in [Interface Tree](interface-tree.md). Current package boundaries are tracked in [Capability Map](capability-map.md).
6
+
7
+ ## Top-Level Commands
8
+
9
+ ```text
10
+ chatcdn # ChatCDN command-line interface.
11
+ ├── --help # Show this help message.
12
+ ├── --version # Show the installed package version.
13
+ └── --tree # Print the registered command tree.
14
+ ```
15
+
16
+ ## Base Entries
17
+
18
+ ```text
19
+ chatcdn --help # Verify the command is installed and inspect help
20
+ chatcdn --version # Verify the installed version
21
+ chatcdn --tree # Print the command tree from the real Click registry
22
+ ```
23
+
24
+ `ChatCDN` currently has no business subcommands. After adding business commands, follow the ChatTea CLI tree pattern: split command groups into their own sections and annotate every command line.
25
+
26
+ ## Business Command Slots
27
+
28
+ This is a structural placeholder, not a promise of future capability. Only document a command as implemented after the command, Python function, and tests exist.
29
+
30
+ ## Status Contract
31
+
32
+ | Status | Meaning |
33
+ | --- | --- |
34
+ | Implemented | Command, function, and tests exist |
35
+ | Verified | Covered by CI, local smoke, or real-service practice |
36
+ | Planned / checkpoint | Keep only boundary notes; do not write operation tutorials before implementation |
37
+
38
+ ## Implementation Contract
39
+
40
+ - Every implemented command must map back to a Python function, class, or service layer.
41
+ - If a command writes remote state, document credentials, permissions, dry-run/checkpoint behavior, or confirmation boundaries.
42
+ - When adding a command, update README, the interface tree, capability map, tests, and related flow pages together.
@@ -0,0 +1,42 @@
1
+ # CLI 能力地图
2
+
3
+ 这篇文档是 `ChatCDN` CLI 的简明能力地图,用来校对哪些命令已经是一等入口、哪些仍然只是边界或规划。文档中的命令树应与 `chatcdn --tree` 的运行结果保持一致;不要把未实现命令写成已可用操作。
4
+
5
+ 可导入 Python 函数映射见 [接口树](interface-tree.md)。当前包能力边界见 [能力地图](capability-map.md)。
6
+
7
+ ## 顶层命令
8
+
9
+ ```text
10
+ chatcdn # ChatCDN command-line interface.
11
+ ├── --help # Show this help message.
12
+ ├── --version # Show the installed package version.
13
+ └── --tree # Print the registered command tree.
14
+ ```
15
+
16
+ ## 基础入口
17
+
18
+ ```text
19
+ chatcdn --help # 验证命令已安装,并查看帮助
20
+ chatcdn --version # 验证当前安装版本
21
+ chatcdn --tree # 从真实 Click 注册树输出命令树
22
+ ```
23
+
24
+ 当前 `ChatCDN` 还没有业务子命令。新增业务命令后,应像 ChatTea 的 CLI 树一样,把命令组单独展开,并给每个命令写一行注释。
25
+
26
+ ## 业务命令槽位
27
+
28
+ 这里是占位槽位,不是未来能力承诺。只有当命令、Python 函数和测试都存在时,才把它写成已实现入口。
29
+
30
+ ## 状态约定
31
+
32
+ | 状态 | 含义 |
33
+ | --- | --- |
34
+ | 已实现 | 命令、函数和测试已经存在 |
35
+ | 已验证 | 已通过 CI、本地 smoke 或真实服务实践 |
36
+ | 规划 / checkpoint | 只保留边界说明;实现前不要写操作教程 |
37
+
38
+ ## 实现合约
39
+
40
+ - 每个已实现命令都要能追到 Python 函数、类或 service 层。
41
+ - 如果命令会写远端状态,文档必须说明凭据、权限、dry-run/checkpoint 或确认边界。
42
+ - 新增命令时,同步更新 README、接口树、能力地图、测试和相关 Flow 页面。
@@ -0,0 +1,60 @@
1
+ # ChatCDN Docs
2
+
3
+ ChatCDN is a ChatArch Python package. This documentation site should hold long-lived usage notes, a command map, a capability map, and Python interface entry points. After scaffolding, replace placeholders with behavior that is actually implemented, explored, or planned for this package.
4
+
5
+ Site entry: <https://arch.gh.wzhecnu.cn/ChatCDN/en/>
6
+
7
+ ## Choose Documentation by Scenario
8
+
9
+ | Scenario | Document |
10
+ | --- | --- |
11
+ | Install the package, run the CLI, and confirm it works | [CLI Tree](cli-tree.md) |
12
+ | Check first-class capabilities and current boundaries | [Capability Map](capability-map.md) |
13
+ | Call package behavior directly from Python | [Python Interface Tree](interface-tree.md) |
14
+
15
+ ## Documentation Organization
16
+
17
+ This template keeps only durable documentation entry points; it does not generate a plan placeholder:
18
+
19
+ - **CLI tree**: the most direct command entry point, including the real command tree, status, and update checklist.
20
+ - **Capability map**: first-class capabilities, boundaries, and out-of-scope areas.
21
+ - **Interface tree**: importable Python APIs behind the CLI.
22
+
23
+ ## Primary Entry Points
24
+
25
+ <div class="grid cards" markdown>
26
+
27
+ - **CLI Tree**
28
+
29
+ Start from the CLI entry point and record implemented commands, command status, and interactive conventions.
30
+
31
+ [Open CLI Tree](cli-tree.md)
32
+
33
+ - **Capability Map**
34
+
35
+ Review current package boundaries and avoid presenting planned work as implemented behavior.
36
+
37
+ [Open Capability Map](capability-map.md)
38
+
39
+ - **Python Interface Tree**
40
+
41
+ Keep the CLI thin and put substantive behavior in importable Python APIs.
42
+
43
+ [Open Interface Tree](interface-tree.md)
44
+
45
+ </div>
46
+
47
+ ## Documentation Status
48
+
49
+ - **Implemented**: code, tests, or CLI routes exist.
50
+ - **Verified**: covered by local smoke, CI, or real-service practice.
51
+ - **Not implemented**: keep as boundary and planning notes only; turn into operation docs after implementation and validation.
52
+
53
+ ## Local Preview
54
+
55
+ ```bash
56
+ python -m pip install -e ".[docs]"
57
+ mkdocs serve
58
+ ```
59
+
60
+ The Chinese home page is available at <https://arch.gh.wzhecnu.cn/ChatCDN/>. Topic pages without English translations fall back to the default Chinese content through the i18n plugin.
@@ -0,0 +1,60 @@
1
+ # ChatCDN 文档
2
+
3
+ ChatCDN 是 ChatArch 系列 Python 包。这个文档站提供长期维护的使用说明、CLI 树、能力地图和 Python 接口入口。生成模板后,请把占位说明替换为当前包已经实现、探索过或计划中的真实内容。
4
+
5
+ 站点入口:<https://arch.gh.wzhecnu.cn/ChatCDN/>
6
+
7
+ ## 按场景选择文档
8
+
9
+ | 场景 | 文档 |
10
+ | --- | --- |
11
+ | 第一次安装、运行命令行、确认包可用 | [CLI 树](cli-tree.md) |
12
+ | 校对当前包有哪些一等能力和边界 | [能力地图](capability-map.md) |
13
+ | 从 Python 代码调用包能力 | [Python 接口树](interface-tree.md) |
14
+
15
+ ## 文档栏目组织
16
+
17
+ 当前模板只保留长期有用的文档入口,不生成计划类占位页:
18
+
19
+ - **CLI 树**:最直观的命令展示入口,包含真实命令树、状态和更新清单。
20
+ - **能力地图**:当前一等能力、边界和不负责的范围。
21
+ - **接口树**:命令行背后的可 import Python 接口。
22
+
23
+ ## 核心入口
24
+
25
+ <div class="grid cards" markdown>
26
+
27
+ - **CLI 树**
28
+
29
+ 从命令行入口开始,记录已实现命令、命令状态和交互约定。
30
+
31
+ [查看 CLI 树](cli-tree.md)
32
+
33
+ - **能力地图**
34
+
35
+ 用于 review 当前包的能力边界,避免把规划写成已实现功能。
36
+
37
+ [查看能力地图](capability-map.md)
38
+
39
+ - **Python 接口树**
40
+
41
+ 保持命令行是薄入口,实质能力放在可 import 的 Python 接口中。
42
+
43
+ [查看接口树](interface-tree.md)
44
+
45
+ </div>
46
+
47
+ ## 文档状态约定
48
+
49
+ - **已实现**:代码、测试或 CLI 路径已经存在。
50
+ - **已验证**:已经通过本地 smoke、CI 或真实服务实践验证。
51
+ - **未实现**:只写边界和计划,不写成可执行教程;实现并验证后再升级为操作文档。
52
+
53
+ ## 本地预览
54
+
55
+ ```bash
56
+ python -m pip install -e ".[docs]"
57
+ mkdocs serve
58
+ ```
59
+
60
+ 英文首页见站点语言入口:<https://arch.gh.wzhecnu.cn/ChatCDN/en/>。缺少英文翻译的专题页会按 i18n fallback 回退到中文页面。
@@ -0,0 +1,23 @@
1
+ # Python 接口树
2
+
3
+ `ChatCDN` 的 CLI 应保持薄入口;实质能力应放在可 import 的 Python 函数、类或 service 层里。
4
+
5
+ ## 包入口
6
+
7
+ ```python
8
+ from chatcdn import __version__
9
+ ```
10
+
11
+ ## 待补接口
12
+
13
+ ```text
14
+ chatcdn
15
+ ├── cli.py # Click 入口和真实注册树渲染,只做参数解析和输出
16
+ └── <service>.py # 放包的核心可调用能力
17
+ ```
18
+
19
+ ## 更新清单
20
+
21
+ - 每个实质 CLI 命令都要能映射到 importable API。
22
+ - 文档里的函数签名应和代码一致。
23
+ - 对外输出默认不要泄漏 token、cookie、内部 URL 或人员信息。
@@ -0,0 +1,68 @@
1
+ site_name: ChatCDN 文档
2
+ site_url: https://arch.gh.wzhecnu.cn/ChatCDN/
3
+ repo_url: https://github.com/ChatArch/ChatCDN
4
+ repo_name: ChatArch/ChatCDN
5
+ edit_uri: edit/main/docs/
6
+ docs_dir: docs/
7
+ theme:
8
+ name: material
9
+ language: zh
10
+ features:
11
+ - navigation.tabs
12
+ - navigation.sections
13
+ - navigation.expand
14
+ - navigation.top
15
+ - search.highlight
16
+ - search.share
17
+ - content.code.copy
18
+ - content.action.edit
19
+ plugins:
20
+ - search
21
+ - i18n:
22
+ docs_structure: suffix
23
+ fallback_to_default: true
24
+ reconfigure_material: true
25
+ reconfigure_search: true
26
+ languages:
27
+ - locale: zh
28
+ default: true
29
+ name: 中文
30
+ build: true
31
+ site_name: ChatCDN 文档
32
+ - locale: en
33
+ name: English
34
+ build: true
35
+ site_name: ChatCDN Documentation
36
+ nav_translations:
37
+ 首页: Home
38
+ 命令与接口: Commands and APIs
39
+ CLI 树: CLI Tree
40
+ 能力地图: Capability Map
41
+ Python 接口树: Python Interface Tree
42
+ markdown_extensions:
43
+ - admonition
44
+ - attr_list
45
+ - md_in_html
46
+ - toc:
47
+ permalink: true
48
+ - pymdownx.superfences
49
+ - pymdownx.inlinehilite
50
+ - pymdownx.highlight:
51
+ anchor_linenums: true
52
+ - pymdownx.emoji:
53
+ emoji_index: !!python/name:material.extensions.emoji.twemoji
54
+ emoji_generator: !!python/name:material.extensions.emoji.to_svg
55
+ extra:
56
+ alternate:
57
+ - name: 中文
58
+ link: /ChatCDN/
59
+ lang: zh
60
+ - name: English
61
+ link: /ChatCDN/en/
62
+ lang: en
63
+ nav:
64
+ - 首页: index.md
65
+ - 命令与接口:
66
+ - CLI 树: cli-tree.md
67
+ - 能力地图: capability-map.md
68
+ - Python 接口树: interface-tree.md
@@ -9,7 +9,7 @@ description = "ChatArch CDN tooling package."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
11
11
  license = "MIT"
12
- dependencies = ["click>=8.0", "chatstyle>=0.1.0,<0.2.0", "chatenv>=0.2.0,<0.3.0"]
12
+ dependencies = ["click>=8.1,<9.0", "chatstyle>=0.1.1,<0.2.0", "chatenv>=0.2.3,<0.3.0"]
13
13
  authors = [{name = "ChatArch", email = "rex@chatarch.org"}]
14
14
  keywords = ["chatcdn", "chatarch", "cli"]
15
15
  classifiers = [
@@ -30,7 +30,7 @@ chatcdn = "chatcdn.config"
30
30
 
31
31
  [project.optional-dependencies]
32
32
  dev = ["build", "pytest", "twine"]
33
- docs = ["mkdocs>=1.6,<2.0", "mkdocs-material>=9.5,<9.7", "mkdocs-static-i18n>=1.2,<2.0", "mike>=2.0,<3.0"]
33
+ docs = ["mkdocs>=1.6,<2.0", "mkdocs-material>=9.5,<10.0", "mkdocs-static-i18n>=1.2,<2.0", "mike>=2.0,<3.0"]
34
34
 
35
35
  [tool.setuptools.dynamic]
36
36
  version = {attr = "chatcdn.__version__"}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ChatCDN
3
- Version: 0.1.0
3
+ Version: 0.1.2
4
4
  Summary: ChatArch CDN tooling package.
5
5
  Author-email: ChatArch <rex@chatarch.org>
6
6
  License-Expression: MIT
@@ -13,16 +13,16 @@ Classifier: Operating System :: OS Independent
13
13
  Requires-Python: >=3.10
14
14
  Description-Content-Type: text/markdown
15
15
  License-File: LICENSE
16
- Requires-Dist: click>=8.0
17
- Requires-Dist: chatstyle<0.2.0,>=0.1.0
18
- Requires-Dist: chatenv<0.3.0,>=0.2.0
16
+ Requires-Dist: click<9.0,>=8.1
17
+ Requires-Dist: chatstyle<0.2.0,>=0.1.1
18
+ Requires-Dist: chatenv<0.3.0,>=0.2.3
19
19
  Provides-Extra: dev
20
20
  Requires-Dist: build; extra == "dev"
21
21
  Requires-Dist: pytest; extra == "dev"
22
22
  Requires-Dist: twine; extra == "dev"
23
23
  Provides-Extra: docs
24
24
  Requires-Dist: mkdocs<2.0,>=1.6; extra == "docs"
25
- Requires-Dist: mkdocs-material<9.7,>=9.5; extra == "docs"
25
+ Requires-Dist: mkdocs-material<10.0,>=9.5; extra == "docs"
26
26
  Requires-Dist: mkdocs-static-i18n<2.0,>=1.2; extra == "docs"
27
27
  Requires-Dist: mike<3.0,>=2.0; extra == "docs"
28
28
  Dynamic: license-file
@@ -65,13 +65,14 @@ ChatArch CDN tooling package.
65
65
  pip install -e ".[dev]"
66
66
  chatcdn --help
67
67
  chatcdn --version
68
+ chatcdn --tree
68
69
  python -m pytest -q
69
70
  python -m build
70
71
  ```
71
72
 
72
73
  ## 命令行规范
73
74
 
74
- 这个模板默认依赖 `chatstyle>=0.1.0,<0.2.0` 和 `chatenv>=0.2.0,<0.3.0`,新增命令应优先使用:
75
+ 这个模板默认依赖 `chatstyle>=0.1.1,<0.2.0` 和 `chatenv>=0.2.3,<0.3.0`,新增命令应优先使用:
75
76
 
76
77
  - `CommandSchema` / `CommandField` 描述输入。
77
78
  - `add_interactive_option()` 提供统一 `-i/-I`。
@@ -0,0 +1,33 @@
1
+ AGENTS.md
2
+ CHANGELOG.md
3
+ DEVELOP.md
4
+ LICENSE
5
+ MANIFEST.in
6
+ README.en.md
7
+ README.md
8
+ mkdocs.yml
9
+ pyproject.toml
10
+ .github/workflows/ci.yml
11
+ .github/workflows/deploy.yaml
12
+ .github/workflows/preview.yaml
13
+ .github/workflows/publish.yml
14
+ docs/capability-map.en.md
15
+ docs/capability-map.md
16
+ docs/cli-tree.en.md
17
+ docs/cli-tree.md
18
+ docs/index.en.md
19
+ docs/index.md
20
+ docs/interface-tree.md
21
+ src/ChatCDN.egg-info/PKG-INFO
22
+ src/ChatCDN.egg-info/SOURCES.txt
23
+ src/ChatCDN.egg-info/dependency_links.txt
24
+ src/ChatCDN.egg-info/entry_points.txt
25
+ src/ChatCDN.egg-info/requires.txt
26
+ src/ChatCDN.egg-info/top_level.txt
27
+ src/chatcdn/__init__.py
28
+ src/chatcdn/cli.py
29
+ src/chatcdn/config.py
30
+ tests/test_cli.py
31
+ tests/test_docs_contract.py
32
+ tests/test_version.py
33
+ tests/test_workflow_contract.py
@@ -1,6 +1,6 @@
1
- click>=8.0
2
- chatstyle<0.2.0,>=0.1.0
3
- chatenv<0.3.0,>=0.2.0
1
+ click<9.0,>=8.1
2
+ chatstyle<0.2.0,>=0.1.1
3
+ chatenv<0.3.0,>=0.2.3
4
4
 
5
5
  [dev]
6
6
  build
@@ -9,6 +9,6 @@ twine
9
9
 
10
10
  [docs]
11
11
  mkdocs<2.0,>=1.6
12
- mkdocs-material<9.7,>=9.5
12
+ mkdocs-material<10.0,>=9.5
13
13
  mkdocs-static-i18n<2.0,>=1.2
14
14
  mike<3.0,>=2.0
@@ -2,4 +2,4 @@
2
2
 
3
3
  __all__ = ["__version__"]
4
4
 
5
- __version__ = "0.1.0"
5
+ __version__ = "0.1.2"
@@ -0,0 +1,119 @@
1
+ """CLI entrypoint for chatcdn."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from collections.abc import Iterable
6
+
7
+ import click
8
+
9
+ from chatcdn import __version__
10
+
11
+
12
+ def _purpose(command: click.Command) -> str:
13
+ """Return a compact one-line purpose for a Click command."""
14
+ help_text = command.help or command.short_help or ""
15
+ line = " ".join(help_text.strip().split())
16
+ if not line:
17
+ return "No description."
18
+ return line if line.endswith(".") else f"{line}."
19
+
20
+
21
+ def _format_param(param: click.Parameter) -> str | None:
22
+ """Render a compact command-tree signature fragment for one parameter."""
23
+ if isinstance(param, click.Option):
24
+ if param.hidden:
25
+ return None
26
+ names = [name for name in param.opts if name.startswith("--")]
27
+ if not names:
28
+ names = list(param.opts)
29
+ if not names:
30
+ return None
31
+ name = names[0]
32
+ if param.is_bool_flag:
33
+ return f"[{name}]"
34
+ metavar = param.metavar or param.name.upper().replace("_", "-")
35
+ return f"[{name} <{metavar}>]"
36
+ if isinstance(param, click.Argument):
37
+ metavar = param.metavar or param.name.upper().replace("_", "-")
38
+ token = f"<{metavar}>"
39
+ if not param.required:
40
+ return f"[{token}]"
41
+ return token
42
+ return None
43
+
44
+
45
+ def _signature(command: click.Command) -> str:
46
+ parts = [part for part in (_format_param(param) for param in command.params) if part]
47
+ return " ".join(parts)
48
+
49
+
50
+ def _iter_visible_commands(command: click.Command) -> Iterable[tuple[str, click.Command]]:
51
+ if not isinstance(command, click.Group):
52
+ return []
53
+ ctx = click.Context(command)
54
+ commands: list[tuple[str, click.Command]] = []
55
+ for name in command.list_commands(ctx):
56
+ child = command.get_command(ctx, name)
57
+ if child is not None and not child.hidden:
58
+ commands.append((name, child))
59
+ return commands
60
+
61
+
62
+ def render_cli_tree(command: click.Command, *, root_name: str = "chatcdn") -> str:
63
+ """Render the registered Click command tree with compact purpose comments."""
64
+ lines = [f"{root_name} # {_purpose(command)}"]
65
+ pseudo_leaves = [
66
+ ("--help", "Show this help message."),
67
+ ("--version", "Show the installed package version."),
68
+ ("--tree", "Print the registered command tree."),
69
+ ]
70
+ children = list(_iter_visible_commands(command))
71
+ entries: list[tuple[str, str, click.Command | None]] = []
72
+ entries.extend((name, purpose, None) for name, purpose in pseudo_leaves)
73
+ entries.extend((name, _purpose(child), child) for name, child in children)
74
+
75
+ def visit(entries: list[tuple[str, str, click.Command | None]], prefix: str = "") -> None:
76
+ for index, (name, purpose, child) in enumerate(entries):
77
+ is_last = index == len(entries) - 1
78
+ branch = "└──" if is_last else "├──"
79
+ if child is None:
80
+ lines.append(f"{prefix}{branch} {name} # {purpose}")
81
+ continue
82
+ signature = _signature(child)
83
+ label = f"{name} {signature}" if signature else name
84
+ lines.append(f"{prefix}{branch} {label} # {purpose}")
85
+ grand_children: list[tuple[str, str, click.Command | None]] = [
86
+ (child_name, _purpose(grand_child), grand_child)
87
+ for child_name, grand_child in _iter_visible_commands(child)
88
+ ]
89
+ if grand_children:
90
+ child_prefix = prefix + (" " if is_last else "│ ")
91
+ visit(grand_children, child_prefix)
92
+
93
+ visit(entries)
94
+ return "\n".join(lines)
95
+
96
+
97
+ @click.group(
98
+ context_settings={"help_option_names": ["-h", "--help"]},
99
+ invoke_without_command=True,
100
+ no_args_is_help=True,
101
+ )
102
+ @click.version_option(__version__, prog_name="chatcdn")
103
+ @click.option(
104
+ "--tree",
105
+ is_flag=True,
106
+ is_eager=True,
107
+ expose_value=True,
108
+ help="Print the registered command tree and exit.",
109
+ )
110
+ @click.pass_context
111
+ def main(ctx: click.Context, tree: bool) -> None:
112
+ """ChatCDN command-line interface."""
113
+ if tree:
114
+ click.echo(render_cli_tree(ctx.command, root_name="chatcdn"))
115
+ ctx.exit()
116
+
117
+
118
+ if __name__ == "__main__":
119
+ main()
@@ -0,0 +1,37 @@
1
+ from click.testing import CliRunner
2
+
3
+ from chatcdn import __version__
4
+ from chatcdn.cli import main
5
+
6
+
7
+ def test_version_option_reports_package_version():
8
+ result = CliRunner().invoke(main, ["--version"])
9
+
10
+ assert result.exit_code == 0
11
+ assert f"chatcdn, version {__version__}" in result.output
12
+
13
+
14
+ def test_help_mentions_tree_option():
15
+ result = CliRunner().invoke(main, ["--help"])
16
+
17
+ assert result.exit_code == 0, result.output
18
+ assert "--tree" in result.output
19
+ assert "Print the registered command tree" in result.output
20
+
21
+
22
+ def test_tree_shows_registered_top_level_surface_with_purposes():
23
+ result = CliRunner().invoke(main, ["--tree"])
24
+
25
+ assert result.exit_code == 0, result.output
26
+ assert "chatcdn # ChatCDN command-line interface." in result.output
27
+ assert "├── --help # Show this help message." in result.output
28
+ assert "├── --version # Show the installed package version." in result.output
29
+ assert "└── --tree # Print the registered command tree." in result.output
30
+ assert "#" in result.output
31
+
32
+
33
+ def test_template_hello_command_is_not_registered():
34
+ result = CliRunner().invoke(main, ["hello"])
35
+
36
+ assert result.exit_code != 0
37
+ assert "No such command" in result.output
@@ -0,0 +1,27 @@
1
+ from pathlib import Path
2
+
3
+
4
+ def test_mkdocs_material_i18n_public_domain_and_icon_renderer():
5
+ mkdocs = Path("mkdocs.yml").read_text(encoding="utf-8")
6
+ pyproject = Path("pyproject.toml").read_text(encoding="utf-8")
7
+
8
+ assert "site_url: https://arch.gh.wzhecnu.cn/ChatCDN/" in mkdocs
9
+ assert "repo_url: https://github.com/ChatArch/ChatCDN" in mkdocs
10
+ assert "name: material" in mkdocs
11
+ assert "- i18n:" in mkdocs
12
+ assert "docs_structure: suffix" in mkdocs
13
+ assert "mkdocs-static-i18n" in pyproject
14
+ assert "mkdocs-material>=9.5,<10.0" in pyproject
15
+ assert "pymdownx.emoji" in mkdocs
16
+ assert "material.extensions.emoji.twemoji" in mkdocs
17
+ assert "material.extensions.emoji.to_svg" in mkdocs
18
+
19
+
20
+ def test_cli_tree_docs_are_bilingual_and_use_public_command():
21
+ zh = Path("docs/cli-tree.md").read_text(encoding="utf-8")
22
+ en = Path("docs/cli-tree.en.md").read_text(encoding="utf-8")
23
+
24
+ assert "chatcdn --tree" in zh
25
+ assert "chatcdn --tree" in en
26
+ assert "python -m chatcdn.cli" not in zh
27
+ assert "python -m chatcdn.cli" not in en
@@ -2,4 +2,4 @@ from chatcdn import __version__
2
2
 
3
3
 
4
4
  def test_version_present():
5
- assert __version__ == "0.1.0"
5
+ assert __version__ == "0.1.2"
@@ -0,0 +1,32 @@
1
+ from pathlib import Path
2
+
3
+
4
+ def test_publish_workflow_uses_oidc_with_release_guards():
5
+ workflow = Path(".github/workflows/publish.yml").read_text(encoding="utf-8")
6
+
7
+ assert "id-token: write" in workflow
8
+ assert "pypa/gh-action-pypi-publish@release/v1" in workflow
9
+ assert "Check tag matches package version" in workflow
10
+ assert "Check release commit is on default branch" in workflow
11
+ assert "git fetch --no-tags origin main:refs/remotes/origin/main" in workflow
12
+ assert "Check PyPI version" in workflow
13
+ assert "is already on PyPI" in workflow
14
+ assert "environment: pypi" not in workflow
15
+
16
+
17
+ def test_ci_smokes_installed_cli_and_checks_distributions():
18
+ workflow = Path(".github/workflows/ci.yml").read_text(encoding="utf-8")
19
+
20
+ assert "chatcdn --version" in workflow
21
+ assert "chatcdn --tree" in workflow
22
+ assert "python -m twine check dist/*" in workflow
23
+
24
+
25
+ def test_preview_workflow_derives_public_url_from_site_url():
26
+ workflow = Path(".github/workflows/preview.yaml").read_text(encoding="utf-8")
27
+
28
+ assert "site_url" in workflow
29
+ assert "CHATARCH_PREVIEW_URL" in workflow
30
+ assert "${site_url}/dev/" in workflow
31
+ assert "github.io" not in workflow
32
+ assert "Preview" in workflow
@@ -1,14 +0,0 @@
1
- LICENSE
2
- README.md
3
- pyproject.toml
4
- src/ChatCDN.egg-info/PKG-INFO
5
- src/ChatCDN.egg-info/SOURCES.txt
6
- src/ChatCDN.egg-info/dependency_links.txt
7
- src/ChatCDN.egg-info/entry_points.txt
8
- src/ChatCDN.egg-info/requires.txt
9
- src/ChatCDN.egg-info/top_level.txt
10
- src/chatcdn/__init__.py
11
- src/chatcdn/cli.py
12
- src/chatcdn/config.py
13
- tests/test_cli.py
14
- tests/test_version.py
@@ -1,17 +0,0 @@
1
- """CLI entrypoint for chatcdn."""
2
-
3
- import click
4
-
5
- from chatcdn import __version__
6
-
7
-
8
- @click.group()
9
- @click.version_option(__version__, prog_name="chatcdn")
10
- def main() -> None:
11
- """chatcdn command line interface."""
12
- # Add package-specific commands here. Prefer ChatStyle helpers for
13
- # interactive input when a command needs recoverable user input.
14
-
15
-
16
- if __name__ == "__main__":
17
- main()
@@ -1,11 +0,0 @@
1
- from click.testing import CliRunner
2
-
3
- from chatcdn import __version__
4
- from chatcdn.cli import main
5
-
6
-
7
- def test_version_option_reports_package_version():
8
- result = CliRunner().invoke(main, ["--version"])
9
-
10
- assert result.exit_code == 0
11
- assert f"chatcdn, version {__version__}" in result.output
File without changes
File without changes
File without changes