prgenius-core 2.2.0__tar.gz → 2.2.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 (48) hide show
  1. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/PKG-INFO +1 -1
  2. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/pyproject.toml +1 -1
  3. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/src/prgenius/__init__.py +1 -1
  4. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/src/prgenius/doctor.py +12 -1
  5. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/src/prgenius/parser.py +22 -3
  6. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/src/prgenius_core.egg-info/PKG-INFO +1 -1
  7. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/README.md +0 -0
  8. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/setup.cfg +0 -0
  9. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/src/prgenius/__main__.py +0 -0
  10. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/src/prgenius/cli.py +0 -0
  11. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/src/prgenius/contributor_view.py +0 -0
  12. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/src/prgenius/evaluator.py +0 -0
  13. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/src/prgenius/issue_evaluator.py +0 -0
  14. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/src/prgenius/maintainer_view.py +0 -0
  15. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/src/prgenius/mcp.py +0 -0
  16. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/src/prgenius/pr_metadata.py +0 -0
  17. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/src/prgenius/py.typed +0 -0
  18. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/src/prgenius/status.py +0 -0
  19. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/src/prgenius/structural.py +0 -0
  20. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/src/prgenius/triage.py +0 -0
  21. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/src/prgenius/utils.py +0 -0
  22. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/src/prgenius_core.egg-info/SOURCES.txt +0 -0
  23. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/src/prgenius_core.egg-info/dependency_links.txt +0 -0
  24. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/src/prgenius_core.egg-info/entry_points.txt +0 -0
  25. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/src/prgenius_core.egg-info/requires.txt +0 -0
  26. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/src/prgenius_core.egg-info/top_level.txt +0 -0
  27. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/tests/test_cli.py +0 -0
  28. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/tests/test_contributor_view.py +0 -0
  29. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/tests/test_enrich_cases.py +0 -0
  30. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/tests/test_evaluator.py +0 -0
  31. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/tests/test_evaluator_v163.py +0 -0
  32. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/tests/test_extract_features.py +0 -0
  33. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/tests/test_gh_fallback.py +0 -0
  34. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/tests/test_issue_evaluator.py +0 -0
  35. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/tests/test_maintainer_view.py +0 -0
  36. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/tests/test_mcp.py +0 -0
  37. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/tests/test_mcp_stdio.py +0 -0
  38. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/tests/test_parser_smoke.py +0 -0
  39. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/tests/test_pr_metadata.py +0 -0
  40. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/tests/test_product_quality.py +0 -0
  41. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/tests/test_review_case_evidence.py +0 -0
  42. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/tests/test_score_merge.py +0 -0
  43. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/tests/test_smoke_e2e.py +0 -0
  44. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/tests/test_status.py +0 -0
  45. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/tests/test_structural_checks.py +0 -0
  46. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/tests/test_triage.py +0 -0
  47. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/tests/test_utils.py +0 -0
  48. {prgenius_core-2.2.0 → prgenius_core-2.2.2}/tests/test_validate.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: prgenius-core
3
- Version: 2.2.0
3
+ Version: 2.2.2
4
4
  Summary: Evidence-backed lookup for big-repo PR contributions. Local-only, zero-runtime, stdlib-first. Renamed from `prgenius` to avoid PyPI name collision with an unrelated 2024 GPT-3 PR-description tool. Distribution renamed again in v0.7.8: `prgenius-kb` → `prgenius-core` (aligned with `misakanet-core` convention).
5
5
  Author: pr-genius contributors
6
6
  License-Expression: MIT
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "prgenius-core"
3
- version = "2.2.0"
3
+ version = "2.2.2"
4
4
  description = "Evidence-backed lookup for big-repo PR contributions. Local-only, zero-runtime, stdlib-first. Renamed from `prgenius` to avoid PyPI name collision with an unrelated 2024 GPT-3 PR-description tool. Distribution renamed again in v0.7.8: `prgenius-kb` → `prgenius-core` (aligned with `misakanet-core` convention)."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.9"
@@ -12,7 +12,7 @@ Public surface:
12
12
 
13
13
  from .parser import load, iter_profiles, iter_case_studies, profile_get, schema_info, clear_profile_cache
14
14
 
15
- __version__ = "2.2.0"
15
+ __version__ = "2.2.2"
16
16
  __all__ = [
17
17
  "__version__",
18
18
  "load",
@@ -192,7 +192,18 @@ def run_doctor(repo_root: Optional[Path] = None) -> dict:
192
192
 
193
193
  warnings: list[str] = []
194
194
  if not kb["readable"]:
195
- if kb["repo_root_source"] == "none":
195
+ # 顺序重要: 先判**实际使用的 root**是否存在, 再谈"来源"。
196
+ # repo_root_source 说的是模块自解析的结果, 与 --repo-root 无关 ——
197
+ # 用户传了坏路径时若先看 source, 会把"你传的路径不存在"说成
198
+ # "wheel 只装代码", 并错指那个路径是安装位置 (2.2.1 就这么措辞失实过)。
199
+ if not root.exists():
200
+ warnings.append(
201
+ f"the knowledge-base path does not exist: {root} "
202
+ "(pass the pr-genius git clone to --repo-root, or drop --repo-root to use the default)"
203
+ )
204
+ elif not root.is_dir():
205
+ warnings.append(f"the knowledge-base path is not a directory: {root}")
206
+ elif kb["repo_root_source"] == "none":
196
207
  # wheel 只装代码,知识库在仓库里 —— 新用户从 PyPI 装完就是这个状态。
197
208
  warnings.append(
198
209
  "knowledge base not found — the `prgenius-core` wheel ships code only, "
@@ -304,6 +304,21 @@ def parse_frontmatter(text: str) -> dict:
304
304
 
305
305
  # ---------- higher-level iterators ----------
306
306
 
307
+ def _iter_dir(path: Path) -> list[Path]:
308
+ """列出目录条目; 目录不存在或不可读时返回空表, 不抛.
309
+
310
+ 为什么: `--repo-root` 传了不存在的路径时, `root.iterdir()` 直接
311
+ FileNotFoundError 冒成 traceback —— 用户只想要一句"这个路径不对"。
312
+ 取数函数不该因为输入不存在就崩; 它们返回空, 由调用方决定怎么报
313
+ (doctor 会说 knowledge base not readable, 这才是用户该看到的)。
314
+ """
315
+ try:
316
+ return sorted(path.iterdir())
317
+ except (FileNotFoundError, NotADirectoryError, PermissionError, OSError):
318
+ return []
319
+
320
+
321
+
307
322
  def iter_profiles(repo_root: str | Path) -> Iterator[dict]:
308
323
  """Yield each Repo Profile dict under `<repo_root>/<folder>/index.md` or `<repo_root>/profiles/<folder>/index.md`."""
309
324
  root = Path(repo_root)
@@ -317,7 +332,7 @@ def iter_profiles(repo_root: str | Path) -> Iterator[dict]:
317
332
  }
318
333
 
319
334
  # Scan root-level profile dirs
320
- for sub in sorted(root.iterdir()):
335
+ for sub in _iter_dir(root):
321
336
  if not sub.is_dir() or sub.name in skip or sub.name.startswith("."):
322
337
  continue
323
338
  idx = sub / "index.md"
@@ -331,7 +346,7 @@ def iter_profiles(repo_root: str | Path) -> Iterator[dict]:
331
346
  # Scan profiles/ subdirectory
332
347
  profiles_dir = root / "profiles"
333
348
  if profiles_dir.is_dir():
334
- for sub in sorted(profiles_dir.iterdir()):
349
+ for sub in _iter_dir(profiles_dir):
335
350
  if not sub.is_dir() or sub.name.startswith("."):
336
351
  continue
337
352
  idx = sub / "index.md"
@@ -346,7 +361,11 @@ def iter_profiles(repo_root: str | Path) -> Iterator[dict]:
346
361
  def iter_case_studies(repo_root: str | Path) -> Iterator[dict]:
347
362
  """Yield each PR Case Study dict under repo root."""
348
363
  root = Path(repo_root)
349
- for path in sorted(root.rglob("pr-*.md")):
364
+ try:
365
+ _case_paths = sorted(root.rglob("pr-*.md"))
366
+ except (FileNotFoundError, NotADirectoryError, PermissionError, OSError):
367
+ _case_paths = []
368
+ for path in _case_paths:
350
369
  try:
351
370
  loaded = load(path)
352
371
  except Exception:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: prgenius-core
3
- Version: 2.2.0
3
+ Version: 2.2.2
4
4
  Summary: Evidence-backed lookup for big-repo PR contributions. Local-only, zero-runtime, stdlib-first. Renamed from `prgenius` to avoid PyPI name collision with an unrelated 2024 GPT-3 PR-description tool. Distribution renamed again in v0.7.8: `prgenius-kb` → `prgenius-core` (aligned with `misakanet-core` convention).
5
5
  Author: pr-genius contributors
6
6
  License-Expression: MIT
File without changes
File without changes