.. SPDX-FileCopyrightText: © 2015 Read the Docs, Inc .. SPDX-FileCopyrightText: © 2024 The "Whiteprints" contributors .. .. SPDX-License-Identifier: MIT whiteprints.debug_info ====================== .. py:module:: whiteprints.debug_info .. autoapi-nested-parse:: Gather and organize runtime information for the current Python environment. This module provides functionality to collect comprehensive debug details such as operating system specifics, Python interpreter information, package versioning, and dependency data. It is designed to facilitate troubleshooting by generating a structured snapshot of the environment in which the code is running. The collected data includes: - OS distribution details (e.g., name, version). - Python version and platform information. - Package versions, including the version of this module. - A list of Python paths where modules are searched. - Detailed information about runtime dependencies, including their versions and locations when available. This is useful for debugging issues related to dependency resolution, environment configuration across different systems. Classes ------- .. autoapisummary:: whiteprints.debug_info.PackageInfo whiteprints.debug_info.DebugInfo Functions --------- .. autoapisummary:: whiteprints.debug_info.gather_debug_info Module Contents --------------- .. SPDX-FileCopyrightText: © 2015 Read the Docs, Inc .. SPDX-FileCopyrightText: © 2024 The "Whiteprints" contributors .. .. SPDX-License-Identifier: MIT .. py:class:: PackageInfo Bases: :py:obj:`TypedDict` Holds runtime dependency information. .. SPDX-FileCopyrightText: © 2015 Read the Docs, Inc .. SPDX-FileCopyrightText: © 2024 The "Whiteprints" contributors .. .. SPDX-License-Identifier: MIT .. SPDX-FileCopyrightText: © 2015 Read the Docs, Inc .. SPDX-FileCopyrightText: © 2024 The "Whiteprints" contributors .. .. SPDX-License-Identifier: MIT .. py:attribute:: name :type: str .. SPDX-FileCopyrightText: © 2015 Read the Docs, Inc .. SPDX-FileCopyrightText: © 2024 The "Whiteprints" contributors .. .. SPDX-License-Identifier: MIT .. SPDX-FileCopyrightText: © 2015 Read the Docs, Inc .. SPDX-FileCopyrightText: © 2024 The "Whiteprints" contributors .. .. SPDX-License-Identifier: MIT .. py:attribute:: version :type: str .. SPDX-FileCopyrightText: © 2015 Read the Docs, Inc .. SPDX-FileCopyrightText: © 2024 The "Whiteprints" contributors .. .. SPDX-License-Identifier: MIT .. SPDX-FileCopyrightText: © 2015 Read the Docs, Inc .. SPDX-FileCopyrightText: © 2024 The "Whiteprints" contributors .. .. SPDX-License-Identifier: MIT .. py:attribute:: origin :type: NotRequired[pathlib.Path] .. SPDX-FileCopyrightText: © 2015 Read the Docs, Inc .. SPDX-FileCopyrightText: © 2024 The "Whiteprints" contributors .. .. SPDX-License-Identifier: MIT .. py:class:: DebugInfo Bases: :py:obj:`TypedDict` Holds runtime debug information. .. SPDX-FileCopyrightText: © 2015 Read the Docs, Inc .. SPDX-FileCopyrightText: © 2024 The "Whiteprints" contributors .. .. SPDX-License-Identifier: MIT .. SPDX-FileCopyrightText: © 2015 Read the Docs, Inc .. SPDX-FileCopyrightText: © 2024 The "Whiteprints" contributors .. .. SPDX-License-Identifier: MIT .. py:attribute:: operating_system :type: distro.distro.InfoDict .. SPDX-FileCopyrightText: © 2015 Read the Docs, Inc .. SPDX-FileCopyrightText: © 2024 The "Whiteprints" contributors .. .. SPDX-License-Identifier: MIT .. SPDX-FileCopyrightText: © 2015 Read the Docs, Inc .. SPDX-FileCopyrightText: © 2024 The "Whiteprints" contributors .. .. SPDX-License-Identifier: MIT .. py:attribute:: platform :type: str .. SPDX-FileCopyrightText: © 2015 Read the Docs, Inc .. SPDX-FileCopyrightText: © 2024 The "Whiteprints" contributors .. .. SPDX-License-Identifier: MIT .. SPDX-FileCopyrightText: © 2015 Read the Docs, Inc .. SPDX-FileCopyrightText: © 2024 The "Whiteprints" contributors .. .. SPDX-License-Identifier: MIT .. py:attribute:: python_version :type: str .. SPDX-FileCopyrightText: © 2015 Read the Docs, Inc .. SPDX-FileCopyrightText: © 2024 The "Whiteprints" contributors .. .. SPDX-License-Identifier: MIT .. SPDX-FileCopyrightText: © 2015 Read the Docs, Inc .. SPDX-FileCopyrightText: © 2024 The "Whiteprints" contributors .. .. SPDX-License-Identifier: MIT .. py:attribute:: python_executable :type: pathlib.Path .. SPDX-FileCopyrightText: © 2015 Read the Docs, Inc .. SPDX-FileCopyrightText: © 2024 The "Whiteprints" contributors .. .. SPDX-License-Identifier: MIT .. SPDX-FileCopyrightText: © 2015 Read the Docs, Inc .. SPDX-FileCopyrightText: © 2024 The "Whiteprints" contributors .. .. SPDX-License-Identifier: MIT .. py:attribute:: package_version :type: str .. SPDX-FileCopyrightText: © 2015 Read the Docs, Inc .. SPDX-FileCopyrightText: © 2024 The "Whiteprints" contributors .. .. SPDX-License-Identifier: MIT .. SPDX-FileCopyrightText: © 2015 Read the Docs, Inc .. SPDX-FileCopyrightText: © 2024 The "Whiteprints" contributors .. .. SPDX-License-Identifier: MIT .. py:attribute:: pythonpath :type: list[pathlib.Path] .. SPDX-FileCopyrightText: © 2015 Read the Docs, Inc .. SPDX-FileCopyrightText: © 2024 The "Whiteprints" contributors .. .. SPDX-License-Identifier: MIT .. SPDX-FileCopyrightText: © 2015 Read the Docs, Inc .. SPDX-FileCopyrightText: © 2024 The "Whiteprints" contributors .. .. SPDX-License-Identifier: MIT .. py:attribute:: dependencies :type: list[PackageInfo] .. SPDX-FileCopyrightText: © 2015 Read the Docs, Inc .. SPDX-FileCopyrightText: © 2024 The "Whiteprints" contributors .. .. SPDX-License-Identifier: MIT .. py:function:: gather_debug_info() -> DebugInfo Gather detailed runtime debug information of the current environment. This function collects information about the operating system, the Python environment, package versions, and dependencies. It retrieves details such as the OS distribution, Python version, platform information, and the version of the executing package. Additionally, it includes the Python path and information about runtime dependencies, including their names, versions, and locations (if available). :returns: A dictionary containing: - operating_system: Details about the current OS distribution including name, version, and ID. - platform: A string representing the underlying platform, e.g., 'Linux-5.15.0-76-generic-x86_64-with-glibc2.31'. - python_version: The full version string of the Python interpreter being used, e.g., '3.12.0'. - package_version: The version of the `whiteprints` package. - pythonpath: A list of paths where Python searches for modules. - dependencies: A list of dictionaries where each entry represents a runtime dependency with its name, version, and, if available, the path to the module's origin file. :rtype: DebugInfo