1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
| import os
| import platform
|
| from pip._vendor.rich import inspect
| from pip._vendor.rich.console import Console, get_windows_console_features
| from pip._vendor.rich.panel import Panel
| from pip._vendor.rich.pretty import Pretty
|
|
| def report() -> None: # pragma: no cover
| """Print a report to the terminal with debugging information"""
| console = Console()
| inspect(console)
| features = get_windows_console_features()
| inspect(features)
|
| env_names = (
| "CLICOLOR",
| "COLORTERM",
| "COLUMNS",
| "JPY_PARENT_PID",
| "JUPYTER_COLUMNS",
| "JUPYTER_LINES",
| "LINES",
| "NO_COLOR",
| "TERM_PROGRAM",
| "TERM",
| "TTY_COMPATIBLE",
| "TTY_INTERACTIVE",
| "VSCODE_VERBOSE_LOGGING",
| )
| env = {name: os.getenv(name) for name in env_names}
| console.print(Panel.fit((Pretty(env)), title="[b]Environment Variables"))
|
| console.print(f'platform="{platform.system()}"')
|
|
| if __name__ == "__main__": # pragma: no cover
| report()
|
|