devops-analyzer 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 (31) hide show
  1. {devops_analyzer-0.1.0/devops_analyzer.egg-info → devops_analyzer-0.1.2}/PKG-INFO +3 -3
  2. {devops_analyzer-0.1.0 → devops_analyzer-0.1.2}/devops/analysis.py +3 -1
  3. devops_analyzer-0.1.2/devops/ui.py +41 -0
  4. {devops_analyzer-0.1.0 → devops_analyzer-0.1.2/devops_analyzer.egg-info}/PKG-INFO +3 -3
  5. {devops_analyzer-0.1.0 → devops_analyzer-0.1.2}/devops_analyzer.egg-info/SOURCES.txt +1 -0
  6. {devops_analyzer-0.1.0 → devops_analyzer-0.1.2}/pyproject.toml +3 -3
  7. {devops_analyzer-0.1.0 → devops_analyzer-0.1.2}/LICENSE +0 -0
  8. {devops_analyzer-0.1.0 → devops_analyzer-0.1.2}/MANIFEST.in +0 -0
  9. {devops_analyzer-0.1.0 → devops_analyzer-0.1.2}/README.md +0 -0
  10. {devops_analyzer-0.1.0 → devops_analyzer-0.1.2}/devops/__init__.py +0 -0
  11. {devops_analyzer-0.1.0 → devops_analyzer-0.1.2}/devops/__main__.py +0 -0
  12. {devops_analyzer-0.1.0 → devops_analyzer-0.1.2}/devops/cli.py +0 -0
  13. {devops_analyzer-0.1.0 → devops_analyzer-0.1.2}/devops/config.py +0 -0
  14. {devops_analyzer-0.1.0 → devops_analyzer-0.1.2}/devops/config_cmd.py +0 -0
  15. {devops_analyzer-0.1.0 → devops_analyzer-0.1.2}/devops/extract.py +0 -0
  16. {devops_analyzer-0.1.0 → devops_analyzer-0.1.2}/devops/models/__init__.py +0 -0
  17. {devops_analyzer-0.1.0 → devops_analyzer-0.1.2}/devops/models/base.py +0 -0
  18. {devops_analyzer-0.1.0 → devops_analyzer-0.1.2}/devops/models/openai.py +0 -0
  19. {devops_analyzer-0.1.0 → devops_analyzer-0.1.2}/devops/models/zhipuai.py +0 -0
  20. {devops_analyzer-0.1.0 → devops_analyzer-0.1.2}/devops/scan/__init__.py +0 -0
  21. {devops_analyzer-0.1.0 → devops_analyzer-0.1.2}/devops/scan/scan.cpp +0 -0
  22. {devops_analyzer-0.1.0 → devops_analyzer-0.1.2}/devops/scan/scan.h +0 -0
  23. {devops_analyzer-0.1.0 → devops_analyzer-0.1.2}/devops/scan/scan_bindings.cpp +0 -0
  24. {devops_analyzer-0.1.0 → devops_analyzer-0.1.2}/devops_analyzer.egg-info/dependency_links.txt +0 -0
  25. {devops_analyzer-0.1.0 → devops_analyzer-0.1.2}/devops_analyzer.egg-info/entry_points.txt +0 -0
  26. {devops_analyzer-0.1.0 → devops_analyzer-0.1.2}/devops_analyzer.egg-info/not-zip-safe +0 -0
  27. {devops_analyzer-0.1.0 → devops_analyzer-0.1.2}/devops_analyzer.egg-info/requires.txt +0 -0
  28. {devops_analyzer-0.1.0 → devops_analyzer-0.1.2}/devops_analyzer.egg-info/top_level.txt +0 -0
  29. {devops_analyzer-0.1.0 → devops_analyzer-0.1.2}/requirements.txt +0 -0
  30. {devops_analyzer-0.1.0 → devops_analyzer-0.1.2}/setup.cfg +0 -0
  31. {devops_analyzer-0.1.0 → devops_analyzer-0.1.2}/setup.py +0 -0
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: devops-analyzer
3
- Version: 0.1.0
3
+ Version: 0.1.2
4
4
  Summary: 扫描源码、提取代码块、大模型分析并生成 README.md
5
5
  Author: ZHUHK
6
6
  License-Expression: MIT
7
- Project-URL: Homepage, https://github.com/example/devops-analyzer
8
- Requires-Python: >=3.9
7
+ Project-URL: Homepage, https://github.com/dadaozhichen/OpenDevOps
8
+ Requires-Python: >=3.11
9
9
  Description-Content-Type: text/markdown
10
10
  License-File: LICENSE
11
11
  Requires-Dist: tree-sitter<0.22,>=0.21.0
@@ -9,6 +9,7 @@ from typing import Any
9
9
 
10
10
  from devops.extract import CodeBlock, extract_blocks_from_paths
11
11
  from devops.models import BaseChatModel, get_chat_model
12
+ from devops.ui import thinking
12
13
 
13
14
  MAX_CODE_LINES = 80
14
15
  MAX_CHARS_PER_REQUEST = 24_000
@@ -44,7 +45,8 @@ def _format_blocks_for_prompt(blocks: list[CodeBlock]) -> str:
44
45
 
45
46
 
46
47
  def _chat(model: BaseChatModel, prompt: str) -> str:
47
- return model.chat(SYSTEM_PROMPT, prompt, temperature=0.2)
48
+ with thinking():
49
+ return model.chat(SYSTEM_PROMPT, prompt, temperature=0.2)
48
50
 
49
51
 
50
52
  def analyze_blocks(
@@ -0,0 +1,41 @@
1
+ """终端 UI 辅助(等待动画等)。"""
2
+
3
+ from __future__ import annotations
4
+
5
+ import sys
6
+ import threading
7
+ from contextlib import contextmanager
8
+ from typing import Iterator
9
+
10
+ _SPINNER = ("⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏")
11
+
12
+
13
+ @contextmanager
14
+ def thinking(message: str = "thinking") -> Iterator[None]:
15
+ """在阻塞操作期间于 stderr 显示转圈与文案。"""
16
+ if not sys.stderr.isatty():
17
+ print(f"{message}...", file=sys.stderr, flush=True)
18
+ yield
19
+ return
20
+
21
+ stop = threading.Event()
22
+ prefix = f"{message} "
23
+
24
+ def _spin() -> None:
25
+ i = 0
26
+ while not stop.wait(0.08):
27
+ frame = _SPINNER[i % len(_SPINNER)]
28
+ sys.stderr.write(f"\r{frame} {prefix}")
29
+ sys.stderr.flush()
30
+ i += 1
31
+
32
+ thread = threading.Thread(target=_spin, daemon=True)
33
+ thread.start()
34
+ try:
35
+ yield
36
+ finally:
37
+ stop.set()
38
+ thread.join(timeout=0.5)
39
+ clear = "\r" + " " * (len(prefix) + 2) + "\r"
40
+ sys.stderr.write(clear)
41
+ sys.stderr.flush()
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: devops-analyzer
3
- Version: 0.1.0
3
+ Version: 0.1.2
4
4
  Summary: 扫描源码、提取代码块、大模型分析并生成 README.md
5
5
  Author: ZHUHK
6
6
  License-Expression: MIT
7
- Project-URL: Homepage, https://github.com/example/devops-analyzer
8
- Requires-Python: >=3.9
7
+ Project-URL: Homepage, https://github.com/dadaozhichen/OpenDevOps
8
+ Requires-Python: >=3.11
9
9
  Description-Content-Type: text/markdown
10
10
  License-File: LICENSE
11
11
  Requires-Dist: tree-sitter<0.22,>=0.21.0
@@ -11,6 +11,7 @@ devops/cli.py
11
11
  devops/config.py
12
12
  devops/config_cmd.py
13
13
  devops/extract.py
14
+ devops/ui.py
14
15
  devops/models/__init__.py
15
16
  devops/models/base.py
16
17
  devops/models/openai.py
@@ -4,10 +4,10 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "devops-analyzer"
7
- version = "0.1.0"
7
+ version = "0.1.2"
8
8
  description = "扫描源码、提取代码块、大模型分析并生成 README.md"
9
9
  readme = "README.md"
10
- requires-python = ">=3.9"
10
+ requires-python = ">=3.11"
11
11
  license = "MIT"
12
12
  authors = [{ name = "ZHUHK" }]
13
13
  dependencies = [
@@ -26,7 +26,7 @@ build = ["build>=1.2.0"]
26
26
  devops = "devops.cli:main"
27
27
 
28
28
  [project.urls]
29
- Homepage = "https://github.com/example/devops-analyzer"
29
+ Homepage = "https://github.com/dadaozhichen/OpenDevOps"
30
30
 
31
31
  [tool.setuptools.packages.find]
32
32
  where = ["."]
File without changes