crackerjack 0.38.1__py3-none-any.whl → 0.38.3__py3-none-any.whl

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.

Potentially problematic release.


This version of crackerjack might be problematic. Click here for more details.

@@ -1873,7 +1873,64 @@ class WorkflowPipeline:
1873
1873
  ) -> bool:
1874
1874
  with phase_monitor(workflow_id, "testing") as monitor:
1875
1875
  monitor.record_sequential_op()
1876
- return self._run_testing_phase(options)
1876
+ test_result = self._run_testing_phase(options)
1877
+
1878
+ # Execute coverage improvement if boost_coverage is enabled and tests passed
1879
+ if test_result and getattr(options, "boost_coverage", False):
1880
+ await self._execute_coverage_improvement(options)
1881
+
1882
+ return test_result
1883
+
1884
+ async def _execute_coverage_improvement(self, options: OptionsProtocol) -> None:
1885
+ """Execute coverage improvement when boost_coverage is enabled."""
1886
+ try:
1887
+ from crackerjack.orchestration.coverage_improvement import (
1888
+ create_coverage_improvement_orchestrator,
1889
+ )
1890
+
1891
+ coverage_orchestrator = await create_coverage_improvement_orchestrator(
1892
+ self.pkg_path, console=self.console
1893
+ )
1894
+
1895
+ should_improve = await coverage_orchestrator.should_improve_coverage()
1896
+ if not should_improve:
1897
+ self.console.print(
1898
+ "[dim]📈 Coverage at 100% - no improvement needed[/dim]"
1899
+ )
1900
+ return
1901
+
1902
+ # Create agent context for coverage improvement
1903
+ from crackerjack.agents.base import AgentContext
1904
+ from crackerjack.services.filesystem import FileSystemService
1905
+
1906
+ filesystem_service = FileSystemService()
1907
+ agent_context = AgentContext(
1908
+ project_path=self.pkg_path,
1909
+ )
1910
+
1911
+ result = await coverage_orchestrator.execute_coverage_improvement(
1912
+ agent_context
1913
+ )
1914
+
1915
+ if result["status"] == "completed":
1916
+ self.console.print(
1917
+ f"[green]📈[/green] Coverage improvement: {len(result.get('fixes_applied', []))} "
1918
+ f"tests created in {len(result.get('files_modified', []))} files"
1919
+ )
1920
+ elif result["status"] == "skipped":
1921
+ self.console.print(
1922
+ f"[dim]📈 Coverage improvement skipped: {result.get('reason', 'Unknown')}[/dim]"
1923
+ )
1924
+ else:
1925
+ self.console.print(
1926
+ "[yellow]⚠️[/yellow] Coverage improvement completed with issues"
1927
+ )
1928
+
1929
+ except Exception as e:
1930
+ self.console.print(
1931
+ f"[yellow]⚠️[/yellow] Coverage improvement failed: {str(e)}"
1932
+ )
1933
+ self.logger.warning(f"Coverage improvement error: {e}")
1877
1934
 
1878
1935
  async def _execute_standard_hooks_workflow_monitored(
1879
1936
  self, options: OptionsProtocol, workflow_id: str
@@ -142,7 +142,25 @@ class TestManager:
142
142
 
143
143
  with coverage_json_path.open() as f:
144
144
  data = json.load(f)
145
+ # Check for totals field first (newer format)
145
146
  direct_coverage = data.get("totals", {}).get("percent_covered")
147
+
148
+ # If no totals, calculate from files data (standard pytest-cov format)
149
+ if direct_coverage is None and "files" in data:
150
+ total_statements = 0
151
+ total_covered = 0
152
+
153
+ for file_data in data["files"].values():
154
+ summary = file_data.get("summary", {})
155
+ statements = summary.get("num_statements", 0)
156
+ covered = summary.get("covered_lines", 0)
157
+ total_statements += statements
158
+ total_covered += covered
159
+
160
+ if total_statements > 0:
161
+ direct_coverage = (
162
+ total_covered / total_statements
163
+ ) * 100
146
164
  except (json.JSONDecodeError, KeyError):
147
165
  pass # Fall back to ratchet data
148
166
 
@@ -273,7 +291,26 @@ class TestManager:
273
291
  try:
274
292
  with coverage_json_path.open() as f:
275
293
  data = json.load(f)
294
+ # Check for totals field first (newer format)
276
295
  current_coverage = data.get("totals", {}).get("percent_covered")
296
+
297
+ # If no totals, calculate from files data (standard pytest-cov format)
298
+ if current_coverage is None and "files" in data:
299
+ total_statements = 0
300
+ total_covered = 0
301
+
302
+ for file_data in data["files"].values():
303
+ summary = file_data.get("summary", {})
304
+ statements = summary.get("num_statements", 0)
305
+ covered = summary.get("covered_lines", 0)
306
+ total_statements += statements
307
+ total_covered += covered
308
+
309
+ if total_statements > 0:
310
+ current_coverage = (
311
+ total_covered / total_statements
312
+ ) * 100
313
+
277
314
  if current_coverage is not None:
278
315
  self.console.print(
279
316
  f"[dim]📊 Coverage extracted from coverage.json: {current_coverage:.2f}%[/dim]"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: crackerjack
3
- Version: 0.38.1
3
+ Version: 0.38.3
4
4
  Summary: Crackerjack Python project management tool
5
5
  Project-URL: documentation, https://github.com/lesleslie/crackerjack
6
6
  Project-URL: homepage, https://github.com/lesleslie/crackerjack
@@ -74,7 +74,7 @@ Description-Content-Type: text/markdown
74
74
  [![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)
75
75
  [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)
76
76
  [![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
77
- ![Coverage](https://img.shields.io/badge/coverage-37.0%25-red)
77
+ ![Coverage](https://img.shields.io/badge/coverage-37.1%25-red)
78
78
 
79
79
  ## 🎯 Purpose
80
80
 
@@ -54,7 +54,7 @@ crackerjack/core/service_watchdog.py,sha256=Ttj1imOxvUea4Tkf5JO1e2dQtGIK7D-bX1xO
54
54
  crackerjack/core/session_coordinator.py,sha256=TgoGE9DfXe2x-OkH93Ld9dX9ROjx2_mZFkGXen-z5YI,15680
55
55
  crackerjack/core/timeout_manager.py,sha256=_sbEsfYDwWx7y0Pn89QCoAZ5DpWIbCdtR9qkG_Kqj5E,15013
56
56
  crackerjack/core/websocket_lifecycle.py,sha256=74kn6ugu6FLlDQhCNSPgqguCFwRoT1WFOvtl8G2OyFc,12860
57
- crackerjack/core/workflow_orchestrator.py,sha256=rIAIKQkGsKZX4ZOxoKhFupgAIspYND8RfV45TQFFrs4,76039
57
+ crackerjack/core/workflow_orchestrator.py,sha256=WakgGU2j_R6nsUUVhTRebZvnn5WiFjT0ZHciLi_T18M,78414
58
58
  crackerjack/docs/INDEX.md,sha256=a6CGFEeL5DX_FRft_JFWd0nOxoBmCSSp-QHIC3B7ato,342
59
59
  crackerjack/docs/generated/api/API_REFERENCE.md,sha256=mWoqImZA7AhDvRqqF1MhUo70g_pnZr3NoBeZQRotqN8,155816
60
60
  crackerjack/docs/generated/api/CLI_REFERENCE.md,sha256=ikuG0hO5EjIiQlJtAUnvEuAhXDa-JHPULPXNNmUwvk4,2805
@@ -87,7 +87,7 @@ crackerjack/managers/hook_manager.py,sha256=_FT0ngwPwujqg0KZGpLz-pP07mwDmptJ5pVk
87
87
  crackerjack/managers/publish_manager.py,sha256=E0jqHuscfn89pI2Ely0R6xyi3EGTvYFQeFTWyRmdjBM,22067
88
88
  crackerjack/managers/test_command_builder.py,sha256=1TlPzddNcDDxRORH6UvAudcbRc6hKwFyknSEVLkiWAo,3459
89
89
  crackerjack/managers/test_executor.py,sha256=2837Ti4OaNsmLxnmELjbQ18hmfL0-Z2EW-W2UeFSDcE,13871
90
- crackerjack/managers/test_manager.py,sha256=KRU39TLJR_E2zEcqxM3P2IO87N6aPXwNvjaIG8ip_-g,16713
90
+ crackerjack/managers/test_manager.py,sha256=ClApfL9e3K1qe3vVcVbC8Y84CMJO55mwPegXiaTw9g8,18638
91
91
  crackerjack/managers/test_manager_backup.py,sha256=CR8D7WZ68ZrTADFqYJtVDUWnlznJXJNriPIdsp6ZB1E,37932
92
92
  crackerjack/managers/test_progress.py,sha256=B1013ygUk2nAo37whDXNA7n-FYdsEO4qj17fuDm_fdg,3058
93
93
  crackerjack/mcp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -224,8 +224,8 @@ crackerjack/tools/validate_input_validator_patterns.py,sha256=NN7smYlXWrHLQXTb-8
224
224
  crackerjack/tools/validate_regex_patterns.py,sha256=J7GG9EP1fASpRIsG8qRPeiCSkdCwmk0sdo29GgoJ6w8,5863
225
225
  crackerjack/ui/__init__.py,sha256=eMb1OeTU-dSLICAACn0YdYB4Amdr8wHckjKfn0wOIZE,37
226
226
  crackerjack/ui/server_panels.py,sha256=F5IH6SNN06BaZQMsFx_D-OA286aojmaFPJ5kvvSRv_c,4232
227
- crackerjack-0.38.1.dist-info/METADATA,sha256=loyVdeEfQZi1tLq5e7L6selAIPb_Gdgssd7hmLhTz2o,38082
228
- crackerjack-0.38.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
229
- crackerjack-0.38.1.dist-info/entry_points.txt,sha256=AJKNft0WXm9xoGUJ3Trl-iXHOWxRAYbagQiza3AILr4,57
230
- crackerjack-0.38.1.dist-info/licenses/LICENSE,sha256=fDt371P6_6sCu7RyqiZH_AhT1LdN3sN1zjBtqEhDYCk,1531
231
- crackerjack-0.38.1.dist-info/RECORD,,
227
+ crackerjack-0.38.3.dist-info/METADATA,sha256=PbJSlpgQInY8pFYVNx1s-6iE6lxZrA0PHLCGywJOd2Y,38082
228
+ crackerjack-0.38.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
229
+ crackerjack-0.38.3.dist-info/entry_points.txt,sha256=AJKNft0WXm9xoGUJ3Trl-iXHOWxRAYbagQiza3AILr4,57
230
+ crackerjack-0.38.3.dist-info/licenses/LICENSE,sha256=fDt371P6_6sCu7RyqiZH_AhT1LdN3sN1zjBtqEhDYCk,1531
231
+ crackerjack-0.38.3.dist-info/RECORD,,