zhs 0.1.1__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.
- zhs-0.1.1/.github/workflows/ci.yml +56 -0
- zhs-0.1.1/.github/workflows/release.yml +86 -0
- zhs-0.1.1/.gitignore +45 -0
- zhs-0.1.1/CHANGELOG.md +12 -0
- zhs-0.1.1/LICENSE +674 -0
- zhs-0.1.1/PKG-INFO +301 -0
- zhs-0.1.1/README.md +280 -0
- zhs-0.1.1/cliff.toml +49 -0
- zhs-0.1.1/config.toml.example +148 -0
- zhs-0.1.1/docs/design.md +2246 -0
- zhs-0.1.1/docs/linter.md +793 -0
- zhs-0.1.1/docs/spec.md +775 -0
- zhs-0.1.1/docs/test.md +1696 -0
- zhs-0.1.1/docs/tutorial.md +570 -0
- zhs-0.1.1/pyproject.toml +93 -0
- zhs-0.1.1/scripts/check_init_video.py +21 -0
- zhs-0.1.1/scripts/check_progress.py +50 -0
- zhs-0.1.1/scripts/check_video_data.py +82 -0
- zhs-0.1.1/scripts/diagnose_api.py +73 -0
- zhs-0.1.1/scripts/migrate_cache.py +237 -0
- zhs-0.1.1/scripts/test_complete_video.py +93 -0
- zhs-0.1.1/scripts/test_course2.py +96 -0
- zhs-0.1.1/scripts/test_exam_api.py +220 -0
- zhs-0.1.1/scripts/test_fresh_video.py +96 -0
- zhs-0.1.1/scripts/test_full_video.py +77 -0
- zhs-0.1.1/scripts/test_login_qr.py +90 -0
- zhs-0.1.1/scripts/test_play_course.py +103 -0
- zhs-0.1.1/scripts/test_quick.py +85 -0
- zhs-0.1.1/src/zhs/__init__.py +3 -0
- zhs-0.1.1/src/zhs/__main__.py +309 -0
- zhs-0.1.1/src/zhs/ai/__init__.py +0 -0
- zhs-0.1.1/src/zhs/ai/course.py +425 -0
- zhs-0.1.1/src/zhs/ai/exam.py +303 -0
- zhs-0.1.1/src/zhs/ai/exam_base.py +426 -0
- zhs-0.1.1/src/zhs/ai/homework.py +207 -0
- zhs-0.1.1/src/zhs/ai/models.py +145 -0
- zhs-0.1.1/src/zhs/ai/ppt.py +87 -0
- zhs-0.1.1/src/zhs/ai/video.py +130 -0
- zhs-0.1.1/src/zhs/api/__init__.py +25 -0
- zhs-0.1.1/src/zhs/api/ai_analysis_api.py +123 -0
- zhs-0.1.1/src/zhs/api/encrypted_query.py +208 -0
- zhs-0.1.1/src/zhs/api/http_client.py +216 -0
- zhs-0.1.1/src/zhs/api/sso.py +49 -0
- zhs-0.1.1/src/zhs/api/zhidao_homework_api.py +161 -0
- zhs-0.1.1/src/zhs/cache/__init__.py +8 -0
- zhs-0.1.1/src/zhs/cache/ai_cache.py +69 -0
- zhs-0.1.1/src/zhs/cache/base.py +100 -0
- zhs-0.1.1/src/zhs/cache/zhidao_cache.py +174 -0
- zhs-0.1.1/src/zhs/cli/__init__.py +9 -0
- zhs-0.1.1/src/zhs/cli/bootstrap.py +183 -0
- zhs-0.1.1/src/zhs/cli/course_type.py +99 -0
- zhs-0.1.1/src/zhs/cli/services/__init__.py +8 -0
- zhs-0.1.1/src/zhs/cli/services/exam_service.py +104 -0
- zhs-0.1.1/src/zhs/cli/services/fetch_service.py +60 -0
- zhs-0.1.1/src/zhs/cli/services/homework_service.py +255 -0
- zhs-0.1.1/src/zhs/cli/services/play_service.py +191 -0
- zhs-0.1.1/src/zhs/config.py +351 -0
- zhs-0.1.1/src/zhs/crypto.py +134 -0
- zhs-0.1.1/src/zhs/exceptions.py +38 -0
- zhs-0.1.1/src/zhs/hike/__init__.py +0 -0
- zhs-0.1.1/src/zhs/hike/course.py +53 -0
- zhs-0.1.1/src/zhs/hike/models.py +34 -0
- zhs-0.1.1/src/zhs/hike/video.py +222 -0
- zhs-0.1.1/src/zhs/llm/__init__.py +0 -0
- zhs-0.1.1/src/zhs/llm/base.py +83 -0
- zhs-0.1.1/src/zhs/llm/factory.py +57 -0
- zhs-0.1.1/src/zhs/llm/openai.py +94 -0
- zhs-0.1.1/src/zhs/llm/prompts.py +186 -0
- zhs-0.1.1/src/zhs/llm/zhidao.py +287 -0
- zhs-0.1.1/src/zhs/logger.py +118 -0
- zhs-0.1.1/src/zhs/login.py +182 -0
- zhs-0.1.1/src/zhs/reporter.py +76 -0
- zhs-0.1.1/src/zhs/session.py +312 -0
- zhs-0.1.1/src/zhs/utils/__init__.py +0 -0
- zhs-0.1.1/src/zhs/utils/cookie.py +33 -0
- zhs-0.1.1/src/zhs/utils/display.py +188 -0
- zhs-0.1.1/src/zhs/utils/path.py +15 -0
- zhs-0.1.1/src/zhs/zhidao/__init__.py +1 -0
- zhs-0.1.1/src/zhs/zhidao/course.py +170 -0
- zhs-0.1.1/src/zhs/zhidao/homework/__init__.py +31 -0
- zhs-0.1.1/src/zhs/zhidao/homework/analyzer.py +259 -0
- zhs-0.1.1/src/zhs/zhidao/homework/cache.py +19 -0
- zhs-0.1.1/src/zhs/zhidao/homework/models.py +182 -0
- zhs-0.1.1/src/zhs/zhidao/homework/scanner.py +148 -0
- zhs-0.1.1/src/zhs/zhidao/homework/worker.py +710 -0
- zhs-0.1.1/src/zhs/zhidao/models.py +112 -0
- zhs-0.1.1/src/zhs/zhidao/quiz.py +99 -0
- zhs-0.1.1/src/zhs/zhidao/video.py +455 -0
- zhs-0.1.1/tests/ai/__init__.py +0 -0
- zhs-0.1.1/tests/ai/conftest.py +1 -0
- zhs-0.1.1/tests/ai/test_course.py +281 -0
- zhs-0.1.1/tests/ai/test_course_additional.py +460 -0
- zhs-0.1.1/tests/ai/test_exam.py +427 -0
- zhs-0.1.1/tests/ai/test_exam_base.py +438 -0
- zhs-0.1.1/tests/ai/test_homework.py +243 -0
- zhs-0.1.1/tests/ai/test_homework_additional.py +433 -0
- zhs-0.1.1/tests/ai/test_models.py +361 -0
- zhs-0.1.1/tests/ai/test_ppt.py +188 -0
- zhs-0.1.1/tests/ai/test_video.py +95 -0
- zhs-0.1.1/tests/api/__init__.py +0 -0
- zhs-0.1.1/tests/api/test_ai_analysis_api.py +105 -0
- zhs-0.1.1/tests/api/test_encrypted_query.py +348 -0
- zhs-0.1.1/tests/api/test_http_client.py +193 -0
- zhs-0.1.1/tests/api/test_sso.py +102 -0
- zhs-0.1.1/tests/api/test_zhidao_homework_api.py +170 -0
- zhs-0.1.1/tests/cache/__init__.py +0 -0
- zhs-0.1.1/tests/cache/test_ai_cache.py +195 -0
- zhs-0.1.1/tests/cache/test_base.py +186 -0
- zhs-0.1.1/tests/cache/test_zhidao_cache.py +239 -0
- zhs-0.1.1/tests/cli/__init__.py +0 -0
- zhs-0.1.1/tests/cli/services/__init__.py +1 -0
- zhs-0.1.1/tests/cli/services/test_exam_service.py +297 -0
- zhs-0.1.1/tests/cli/services/test_fetch_service.py +160 -0
- zhs-0.1.1/tests/cli/services/test_homework_service.py +669 -0
- zhs-0.1.1/tests/cli/services/test_play_service.py +398 -0
- zhs-0.1.1/tests/cli/test_bootstrap.py +437 -0
- zhs-0.1.1/tests/cli/test_course_type.py +162 -0
- zhs-0.1.1/tests/cli/test_main.py +401 -0
- zhs-0.1.1/tests/conftest.py +35 -0
- zhs-0.1.1/tests/fixtures/__init__.py +0 -0
- zhs-0.1.1/tests/hike/__init__.py +0 -0
- zhs-0.1.1/tests/hike/test_course.py +133 -0
- zhs-0.1.1/tests/hike/test_models.py +102 -0
- zhs-0.1.1/tests/hike/test_video.py +294 -0
- zhs-0.1.1/tests/integration/__init__.py +1 -0
- zhs-0.1.1/tests/integration/conftest.py +124 -0
- zhs-0.1.1/tests/integration/test_ai_integration.py +140 -0
- zhs-0.1.1/tests/integration/test_cli_integration.py +120 -0
- zhs-0.1.1/tests/integration/test_llm_integration.py +98 -0
- zhs-0.1.1/tests/integration/test_login_integration.py +97 -0
- zhs-0.1.1/tests/integration/test_session_integration.py +82 -0
- zhs-0.1.1/tests/integration/test_zhidao_integration.py +120 -0
- zhs-0.1.1/tests/llm/__init__.py +0 -0
- zhs-0.1.1/tests/llm/test_base.py +77 -0
- zhs-0.1.1/tests/llm/test_factory.py +70 -0
- zhs-0.1.1/tests/llm/test_openai.py +75 -0
- zhs-0.1.1/tests/llm/test_prompts.py +144 -0
- zhs-0.1.1/tests/llm/test_zhidao.py +348 -0
- zhs-0.1.1/tests/test_config.py +386 -0
- zhs-0.1.1/tests/test_crypto.py +238 -0
- zhs-0.1.1/tests/test_exceptions.py +103 -0
- zhs-0.1.1/tests/test_logger.py +253 -0
- zhs-0.1.1/tests/test_login.py +311 -0
- zhs-0.1.1/tests/test_reporter.py +108 -0
- zhs-0.1.1/tests/test_session.py +320 -0
- zhs-0.1.1/tests/utils/__init__.py +0 -0
- zhs-0.1.1/tests/utils/test_cookie.py +92 -0
- zhs-0.1.1/tests/utils/test_display.py +55 -0
- zhs-0.1.1/tests/utils/test_path.py +49 -0
- zhs-0.1.1/tests/zhidao/__init__.py +0 -0
- zhs-0.1.1/tests/zhidao/conftest.py +1 -0
- zhs-0.1.1/tests/zhidao/homework/__init__.py +0 -0
- zhs-0.1.1/tests/zhidao/homework/test_ai_analysis_integration.py +167 -0
- zhs-0.1.1/tests/zhidao/homework/test_analyzer.py +439 -0
- zhs-0.1.1/tests/zhidao/homework/test_cache_compat.py +63 -0
- zhs-0.1.1/tests/zhidao/homework/test_models.py +199 -0
- zhs-0.1.1/tests/zhidao/homework/test_scanner.py +258 -0
- zhs-0.1.1/tests/zhidao/homework/test_worker.py +583 -0
- zhs-0.1.1/tests/zhidao/test_course.py +264 -0
- zhs-0.1.1/tests/zhidao/test_models.py +221 -0
- zhs-0.1.1/tests/zhidao/test_quiz.py +195 -0
- zhs-0.1.1/tests/zhidao/test_video.py +461 -0
- zhs-0.1.1/uv.lock +1149 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, dev]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main, dev]
|
|
8
|
+
|
|
9
|
+
concurrency:
|
|
10
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
11
|
+
cancel-in-progress: true
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
# ── Lint, Format & Type Check ─────────────────────────────────
|
|
15
|
+
check:
|
|
16
|
+
name: Lint & Type Check
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v4
|
|
20
|
+
|
|
21
|
+
- uses: astral-sh/setup-uv@v4
|
|
22
|
+
|
|
23
|
+
- name: Install dependencies
|
|
24
|
+
run: uv sync --dev
|
|
25
|
+
|
|
26
|
+
- name: Ruff lint check (src + tests)
|
|
27
|
+
run: uv run ruff check src/ tests/
|
|
28
|
+
|
|
29
|
+
- name: Ruff format check (src + tests)
|
|
30
|
+
run: uv run ruff format --check src/ tests/
|
|
31
|
+
|
|
32
|
+
- name: Mypy strict check (src + tests)
|
|
33
|
+
run: uv run mypy src/ tests/
|
|
34
|
+
|
|
35
|
+
# ── Tests & Coverage ──────────────────────────────────────────
|
|
36
|
+
test:
|
|
37
|
+
name: Tests & Coverage
|
|
38
|
+
runs-on: ubuntu-latest
|
|
39
|
+
steps:
|
|
40
|
+
- uses: actions/checkout@v4
|
|
41
|
+
|
|
42
|
+
- uses: astral-sh/setup-uv@v4
|
|
43
|
+
|
|
44
|
+
- name: Install dependencies
|
|
45
|
+
run: uv sync --dev
|
|
46
|
+
|
|
47
|
+
- name: Run all tests with coverage
|
|
48
|
+
run: uv run pytest --cov=zhs --cov-report=term-missing --cov-report=html -q
|
|
49
|
+
|
|
50
|
+
- name: Upload coverage HTML report
|
|
51
|
+
if: always()
|
|
52
|
+
uses: actions/upload-artifact@v4
|
|
53
|
+
with:
|
|
54
|
+
name: coverage-report
|
|
55
|
+
path: htmlcov/
|
|
56
|
+
retention-days: 7
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: write
|
|
10
|
+
id-token: write # PyPI Trusted Publishing (OIDC)
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
# ── Pre-release Checks ─────────────────────────────────────────
|
|
14
|
+
check:
|
|
15
|
+
name: Pre-release Checks
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- uses: astral-sh/setup-uv@v4
|
|
21
|
+
|
|
22
|
+
- name: Install dependencies
|
|
23
|
+
run: uv sync --dev
|
|
24
|
+
|
|
25
|
+
- name: Ruff lint (src + tests)
|
|
26
|
+
run: uv run ruff check src/ tests/
|
|
27
|
+
|
|
28
|
+
- name: Ruff format check (src + tests)
|
|
29
|
+
run: uv run ruff format --check src/ tests/
|
|
30
|
+
|
|
31
|
+
- name: Mypy (src + tests)
|
|
32
|
+
run: uv run mypy src/ tests/
|
|
33
|
+
|
|
34
|
+
- name: Full test suite
|
|
35
|
+
run: uv run pytest --tb=short -q
|
|
36
|
+
|
|
37
|
+
# ── Build & Publish ────────────────────────────────────────────
|
|
38
|
+
build:
|
|
39
|
+
name: Build & Publish
|
|
40
|
+
runs-on: ubuntu-latest
|
|
41
|
+
needs: check
|
|
42
|
+
environment: pypi # 需在 GitHub 仓库 Settings > Environments 中创建 pypi 环境
|
|
43
|
+
permissions:
|
|
44
|
+
contents: write
|
|
45
|
+
id-token: write # OIDC 签名
|
|
46
|
+
steps:
|
|
47
|
+
- uses: actions/checkout@v4
|
|
48
|
+
with:
|
|
49
|
+
fetch-depth: 0 # git-cliff 需要完整历史
|
|
50
|
+
|
|
51
|
+
- uses: astral-sh/setup-uv@v4
|
|
52
|
+
|
|
53
|
+
- name: Generate changelog
|
|
54
|
+
uses: orhun/git-cliff-action@v4
|
|
55
|
+
id: git-cliff
|
|
56
|
+
with:
|
|
57
|
+
config: cliff.toml
|
|
58
|
+
args: --tag ${{ github.ref_name }}
|
|
59
|
+
env:
|
|
60
|
+
OUTPUT: CHANGELOG.md
|
|
61
|
+
|
|
62
|
+
- name: Build package
|
|
63
|
+
run: uv build
|
|
64
|
+
|
|
65
|
+
- name: Upload artifacts
|
|
66
|
+
uses: actions/upload-artifact@v4
|
|
67
|
+
with:
|
|
68
|
+
name: dist
|
|
69
|
+
path: dist/
|
|
70
|
+
|
|
71
|
+
- name: Create GitHub Release
|
|
72
|
+
uses: softprops/action-gh-release@v2
|
|
73
|
+
with:
|
|
74
|
+
files: dist/*
|
|
75
|
+
body: ${{ steps.git-cliff.outputs.content }}
|
|
76
|
+
|
|
77
|
+
- name: Commit changelog and push
|
|
78
|
+
run: |
|
|
79
|
+
git config user.name "github-actions[bot]"
|
|
80
|
+
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
81
|
+
git add CHANGELOG.md
|
|
82
|
+
git diff --cached --quiet || git commit -m "chore(release): update CHANGELOG.md for ${{ github.ref_name }}"
|
|
83
|
+
git push origin HEAD:main
|
|
84
|
+
|
|
85
|
+
- name: Publish to PyPI (Trusted Publishing / OIDC)
|
|
86
|
+
run: uv publish
|
zhs-0.1.1/.gitignore
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.egg-info/
|
|
6
|
+
*.egg
|
|
7
|
+
dist/
|
|
8
|
+
build/
|
|
9
|
+
.eggs/
|
|
10
|
+
|
|
11
|
+
# 虚拟环境
|
|
12
|
+
.venv/
|
|
13
|
+
venv/
|
|
14
|
+
env/
|
|
15
|
+
|
|
16
|
+
# IDE
|
|
17
|
+
.idea/
|
|
18
|
+
.vscode/
|
|
19
|
+
*.swp
|
|
20
|
+
*.swo
|
|
21
|
+
*~
|
|
22
|
+
.trae
|
|
23
|
+
|
|
24
|
+
# 环境变量
|
|
25
|
+
.env
|
|
26
|
+
.env.dev
|
|
27
|
+
.secrets
|
|
28
|
+
|
|
29
|
+
# 测试
|
|
30
|
+
.pytest_cache/
|
|
31
|
+
.coverage
|
|
32
|
+
htmlcov/
|
|
33
|
+
.mypy_cache/
|
|
34
|
+
.ruff_cache/
|
|
35
|
+
|
|
36
|
+
# 项目特定
|
|
37
|
+
.zhs/
|
|
38
|
+
.temp/
|
|
39
|
+
old/
|
|
40
|
+
|
|
41
|
+
# uv
|
|
42
|
+
.python-version
|
|
43
|
+
|
|
44
|
+
#config
|
|
45
|
+
config.toml
|
zhs-0.1.1/CHANGELOG.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## [0.1.1] - 2026-06-23
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
- Initial project setup
|
|
10
|
+
- **release**: Add git-cliff changelog automation, bump version to 0.1.1
|
|
11
|
+
|
|
12
|
+
<!-- generated by git-cliff -->
|