| 29 | |
| 30 | @dataclass(frozen=True) |
| 31 | class SetupReport: |
| 32 | setup: WorkspaceSetup |
| 33 | prefetches: tuple[PrefetchResult, ...] |
| 34 | deferred_init: DeferredInitResult |
| 35 | trusted: bool |
| 36 | cwd: Path |
| 37 | |
| 38 | def as_markdown(self) -> str: |
| 39 | lines = [ |
| 40 | '# Setup Report', |
| 41 | '', |
| 42 | f'- Python: {self.setup.python_version} ({self.setup.implementation})', |
| 43 | f'- Platform: {self.setup.platform_name}', |
| 44 | f'- Trusted mode: {self.trusted}', |
| 45 | f'- CWD: {self.cwd}', |
| 46 | '', |
| 47 | 'Prefetches:', |
| 48 | *(f'- {prefetch.name}: {prefetch.detail}' for prefetch in self.prefetches), |
| 49 | '', |
| 50 | 'Deferred init:', |
| 51 | *self.deferred_init.as_lines(), |
| 52 | ] |
| 53 | return '\n'.join(lines) |
| 54 | |
| 55 | |
| 56 | def build_workspace_setup() -> WorkspaceSetup: |