Skip to content

Platform#

Platform #

arch: Arch property #

Return the architecture of the platform.

Examples#
>>> Platform("linux-64").arch
Arch(x86_64)
>>> Platform("linux-aarch64").arch
Arch(aarch64)
>>>

is_linux: bool property #

Return True if the platform is linux.

Examples#
>>> Platform("linux-64").is_linux
True
>>> Platform("osx-64").is_linux
False
>>>

is_osx: bool property #

Return True if the platform is osx.

Examples#
>>> Platform("osx-64").is_osx
True
>>> Platform("linux-64").is_osx
False
>>>

is_unix: bool property #

Return True if the platform is unix.

Examples#
>>> Platform("linux-64").is_unix
True
>>> Platform("win-64").is_unix
False
>>>

is_windows: bool property #

Return True if the platform is win.

Examples#
>>> Platform("win-64").is_windows
True
>>> Platform("linux-64").is_windows
False
>>>

only_platform: Optional[str] property #

Return the platform without the architecture.

Examples#
>>> Platform("linux-64").only_platform
'linux'
>>>

__repr__() #

Returnrs a representation of the platform.

Examples#
>>> Platform("linux-64")
Platform(linux-64)
>>>

__str__() #

Returns a string representation of the platform.

Examples#
>>> str(Platform("linux-64"))
'linux-64'
>>>

current() classmethod #

Returns the current platform.