python-harness 0.0.3__tar.gz → 0.0.5__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 (21) hide show
  1. {python_harness-0.0.3/python_harness.egg-info → python_harness-0.0.5}/PKG-INFO +1 -1
  2. {python_harness-0.0.3 → python_harness-0.0.5}/pyproject.toml +1 -1
  3. {python_harness-0.0.3 → python_harness-0.0.5}/python_harness/cli.py +4 -1
  4. {python_harness-0.0.3 → python_harness-0.0.5}/python_harness/hard_evaluator.py +13 -1
  5. {python_harness-0.0.3 → python_harness-0.0.5/python_harness.egg-info}/PKG-INFO +1 -1
  6. {python_harness-0.0.3 → python_harness-0.0.5}/LICENSE +0 -0
  7. {python_harness-0.0.3 → python_harness-0.0.5}/README.md +0 -0
  8. {python_harness-0.0.3 → python_harness-0.0.5}/python_harness/__init__.py +0 -0
  9. {python_harness-0.0.3 → python_harness-0.0.5}/python_harness/evaluator.py +0 -0
  10. {python_harness-0.0.3 → python_harness-0.0.5}/python_harness/qc_evaluator.py +0 -0
  11. {python_harness-0.0.3 → python_harness-0.0.5}/python_harness/soft_evaluator.py +0 -0
  12. {python_harness-0.0.3 → python_harness-0.0.5}/python_harness.egg-info/SOURCES.txt +0 -0
  13. {python_harness-0.0.3 → python_harness-0.0.5}/python_harness.egg-info/dependency_links.txt +0 -0
  14. {python_harness-0.0.3 → python_harness-0.0.5}/python_harness.egg-info/entry_points.txt +0 -0
  15. {python_harness-0.0.3 → python_harness-0.0.5}/python_harness.egg-info/requires.txt +0 -0
  16. {python_harness-0.0.3 → python_harness-0.0.5}/python_harness.egg-info/top_level.txt +0 -0
  17. {python_harness-0.0.3 → python_harness-0.0.5}/setup.cfg +0 -0
  18. {python_harness-0.0.3 → python_harness-0.0.5}/tests/test_cli.py +0 -0
  19. {python_harness-0.0.3 → python_harness-0.0.5}/tests/test_evaluator.py +0 -0
  20. {python_harness-0.0.3 → python_harness-0.0.5}/tests/test_hard_evaluator.py +0 -0
  21. {python_harness-0.0.3 → python_harness-0.0.5}/tests/test_soft_evaluator.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-harness
3
- Version: 0.0.3
3
+ Version: 0.0.5
4
4
  Summary: An agentic codebase evaluation and evolution tool for Python projects.
5
5
  Author-email: Mingli Yuan <mingli.yuan@gmail.com>
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "python-harness"
3
- version = "0.0.3"
3
+ version = "0.0.5"
4
4
  description = "An agentic codebase evaluation and evolution tool for Python projects."
5
5
  requires-python = ">=3.10"
6
6
  readme = "README.md"
@@ -104,7 +104,7 @@ def measure(path: str = typer.Argument(".", help="The path to evaluate")) -> Non
104
104
  if hard_results["mypy"]["status"] != "success":
105
105
  output = hard_results["mypy"].get("output", "")
106
106
  console.print(f"[red]Mypy issues found:[/red]\n{output}")
107
- if hard_results["ty"]["status"] != "success":
107
+ if hard_results["ty"]["status"] not in ("success", "warning"):
108
108
  output = hard_results["ty"].get("output", "")
109
109
  # ty might print to stderr instead of stdout, or it might be missing
110
110
  error_msg = hard_results["ty"].get("error_message", "")
@@ -116,6 +116,9 @@ def measure(path: str = typer.Argument(".", help="The path to evaluate")) -> Non
116
116
  console.print(
117
117
  "[red]Ty failed, but no standard output was captured.[/red]"
118
118
  )
119
+ elif hard_results["ty"]["status"] == "warning":
120
+ msg = hard_results["ty"].get("error_message", "ty not found")
121
+ console.print(f"[yellow]Ty warning:[/yellow] {msg}")
119
122
  if hard_results["radon_cc"]["status"] != "success":
120
123
  issues = hard_results["radon_cc"].get("issues", [])
121
124
  console.print(
@@ -63,6 +63,7 @@ class HardEvaluator:
63
63
  def run_ty(self) -> dict[str, Any]:
64
64
  """
65
65
  Run ty language server checks.
66
+ If ty is not installed, fail gracefully rather than crashing.
66
67
  """
67
68
  try:
68
69
  result = subprocess.run(
@@ -79,7 +80,18 @@ class HardEvaluator:
79
80
  "output": output,
80
81
  "return_code": result.returncode,
81
82
  }
83
+ except FileNotFoundError:
84
+ return {
85
+ "status": "warning",
86
+ "error_message": "ty executable not found. Skipping ty checks."
87
+ }
82
88
  except Exception as e:
89
+ # Handle cases where ty is found but fails to run or throws other OS errors
90
+ if "No such file or directory: 'ty'" in str(e):
91
+ return {
92
+ "status": "warning",
93
+ "error_message": "ty executable not found. Skipping ty checks."
94
+ }
83
95
  return {"status": "error", "error_message": str(e)}
84
96
 
85
97
  def run_radon_cc(self) -> dict[str, Any]:
@@ -188,7 +200,7 @@ class HardEvaluator:
188
200
  all_passed = (
189
201
  ruff_res.get("status") == "success" and
190
202
  mypy_res.get("status") == "success" and
191
- ty_res.get("status") == "success" and
203
+ ty_res.get("status") in ("success", "warning") and
192
204
  radon_cc_res.get("status") == "success"
193
205
  )
194
206
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-harness
3
- Version: 0.0.3
3
+ Version: 0.0.5
4
4
  Summary: An agentic codebase evaluation and evolution tool for Python projects.
5
5
  Author-email: Mingli Yuan <mingli.yuan@gmail.com>
6
6
  License: MIT
File without changes
File without changes
File without changes