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