(path: Path, *, recent_traces: list[dict[str, Any]])
| 197 | |
| 198 | |
| 199 | def _bundle_manifest(path: Path, *, recent_traces: list[dict[str, Any]]) -> dict[str, Any]: |
| 200 | error_count = sum(1 for trace in recent_traces if trace.get("error_code")) |
| 201 | return { |
| 202 | "bundle_version": 1, |
| 203 | "created_at": time.strftime("%Y-%m-%dT%H:%M:%S%z", time.localtime()), |
| 204 | "package_version": _package_version(), |
| 205 | "python_version": sys.version, |
| 206 | "platform": { |
| 207 | "system": platform.system(), |
| 208 | "release": platform.release(), |
| 209 | "machine": platform.machine(), |
| 210 | "python_implementation": platform.python_implementation(), |
| 211 | }, |
| 212 | "data_dir": str(data_dir()), |
| 213 | "bundle_path": str(path), |
| 214 | "recent_trace_count": len(recent_traces), |
| 215 | "recent_error_count": error_count, |
| 216 | } |
| 217 | |
| 218 | |
| 219 | def build_support_bundle( |
no test coverage detected