bundle.core.platform ==================== .. py:module:: bundle.core.platform Attributes ---------- .. autoapisummary:: bundle.core.platform.platform_info Classes ------- .. autoapisummary:: bundle.core.platform.ProcessCommand bundle.core.platform.ProcessCommands bundle.core.platform.PlatformSpecific bundle.core.platform.Darwin bundle.core.platform.Platform Module Contents --------------- .. py:class:: ProcessCommand(/, **data: Any) Bases: :py:obj:`bundle.core.data.Data` Represents a single platform-specific shell command and its result. .. attribute:: name The identifier for the command. :type: str .. attribute:: command The shell command to execute. :type: str .. attribute:: result The output/result of the executed command. :type: str .. py:attribute:: name :type: str .. py:attribute:: command :type: str .. py:attribute:: result :type: str :value: None .. py:method:: run() :async: Execute the shell command asynchronously and store its output in `result`. :returns: None :raises ProcessError: If the command execution fails. .. py:class:: ProcessCommands(/, **data: Any) Bases: :py:obj:`bundle.core.data.Data` Represents a collection of platform-specific commands to be executed. .. attribute:: commands List of ProcessCommand instances. :type: list[ProcessCommand] .. py:attribute:: commands :type: list[ProcessCommand] :value: None .. py:method:: run() -> ProcessCommands :async: Execute all contained platform commands asynchronously. :returns: The instance with updated results for each command. :rtype: ProcessCommands .. py:class:: PlatformSpecific(/, **data: Any) Bases: :py:obj:`bundle.core.data.Data` Abstract base class for platform-specific data models. .. attribute:: target The platform target identifier (e.g., 'darwin', 'linux'). :type: str .. py:attribute:: target :type: str :value: None .. py:method:: platform_commands() -> ProcessCommands :classmethod: :abstractmethod: Return a ProcessCommands instance with platform-specific commands. :returns: The commands to be executed for this platform. :rtype: ProcessCommands :raises NotImplementedError: If not implemented by a subclass. .. py:method:: resolve() -> PlatformSpecific :classmethod: Resolve and instantiate the platform-specific data model by running its commands. :returns: An instance populated with command results. :rtype: PlatformSpecific .. py:class:: Darwin(/, **data: Any) Bases: :py:obj:`PlatformSpecific` Data model for macOS (Darwin) platform-specific information. .. attribute:: product_version macOS product version. :type: str .. attribute:: build_version macOS build version. :type: str .. attribute:: kernel_version Kernel version. :type: str .. attribute:: hardware_model Hardware model identifier. :type: str .. attribute:: hardware_uuid Hardware UUID. :type: str .. attribute:: xcode_version Xcode version installed. :type: str .. attribute:: command_line_tools_version Command Line Tools version. :type: str .. py:attribute:: product_version :type: str :value: None .. py:attribute:: build_version :type: str :value: None .. py:attribute:: kernel_version :type: str :value: None .. py:attribute:: hardware_model :type: str :value: None .. py:attribute:: hardware_uuid :type: str :value: None .. py:attribute:: xcode_version :type: str :value: None .. py:attribute:: command_line_tools_version :type: str :value: None .. py:attribute:: macosx_deployment_target :type: float :value: None .. py:method:: platform_commands() -> Darwin :classmethod: Return the set of commands required to gather Darwin/macOS-specific information. :returns: The commands to be executed for Darwin. :rtype: ProcessCommands .. py:class:: Platform(/, **data: Any) Bases: :py:obj:`bundle.core.entity.Entity` Represents the current platform's system and Python environment information. .. attribute:: system The operating system name (lowercase). :type: str .. attribute:: node The network name (hostname) of the machine. :type: str .. attribute:: release The system's release version. :type: str .. attribute:: version The system's version. :type: str .. attribute:: arch The machine architecture. :type: str .. attribute:: processor The processor identifier. :type: str .. attribute:: python_version The Python version in use. :type: str .. attribute:: python_implementation The Python implementation (e.g., CPython). :type: str .. attribute:: python_executable The path to the Python executable. :type: str .. attribute:: python_compiler The Python compiler used. :type: str .. attribute:: cwd The current working directory. :type: Path .. attribute:: home The user's home directory. :type: Path .. attribute:: env The environment variables. :type: dict .. attribute:: is_64bits Whether the Python interpreter is 64-bit. :type: bool .. attribute:: pid The current process ID. :type: int .. attribute:: uid The current user ID (if available). :type: int | None .. attribute:: gid The current group ID (if available). :type: int | None .. attribute:: darwin Darwin-specific platform information (if on macOS). :type: Darwin | None .. py:attribute:: system :type: str :value: None .. py:attribute:: node :type: str :value: None .. py:attribute:: release :type: str :value: None .. py:attribute:: version :type: str :value: None .. py:attribute:: arch :type: str :value: None .. py:attribute:: processor :type: str :value: None .. py:attribute:: python_version :type: str :value: None .. py:attribute:: python_implementation :type: str :value: None .. py:attribute:: python_executable :type: str :value: None .. py:attribute:: python_compiler :type: str :value: None .. py:attribute:: cwd :type: pathlib.Path :value: None .. py:attribute:: home :type: pathlib.Path :value: None .. py:attribute:: env :type: dict :value: None .. py:attribute:: is_64bits :type: bool :value: None .. py:attribute:: pid :type: int :value: None .. py:attribute:: uid :type: None | int :value: None .. py:attribute:: gid :type: None | int :value: None .. py:attribute:: darwin :type: None | Darwin :value: None .. py:property:: platform_string :type: str Return a string summarizing the platform and Python environment. :returns: A string in the format "{system}-{machine}-{python_implementation}{python_version}". :rtype: str .. py:property:: is_windows :type: bool Check if the current system is Windows. :returns: True if Windows, False otherwise. :rtype: bool .. py:property:: is_linux :type: bool Check if the current system is Linux. :returns: True if Linux, False otherwise. :rtype: bool .. py:property:: is_darwin :type: bool Check if the current system is Darwin (macOS). :returns: True if Darwin, False otherwise. :rtype: bool .. py:data:: platform_info