Platforms¶
Each platform represents an operating system or OS-like environment, and is associated with:
a unique platform ID
a human-readable name
an icon (emoji / unicode character)
various metadata in its
info()method
Platform usage¶
Each platform is materialized by a Platform object, from which you can access various metadata:
>>> from extra_platforms import DEBIAN
>>> DEBIAN
Platform(id='debian', name='Debian')
>>> DEBIAN.id
'debian'
>>> DEBIAN.current
False
>>> DEBIAN.info()
{'id': 'debian', 'name': 'Debian', 'icon': '🌀', 'url': 'https://debian.org', 'current': False, 'distro_id': None, 'version': None, 'version_parts': {'major': None, 'minor': None, 'build_number': None}, 'like': None, 'codename': None}
To check if the current platform matches a specific platform, use the corresponding detection function:
>>> from extra_platforms import is_macos
>>> is_macos()
True
The current platform can be obtained via the current_platform() function:
>>> from extra_platforms import current_platform
>>> current_platform()
Platform(id='macos', name='macOS')
Compatibility layers can match at once¶
Most Linux distributions are identified by the ID field of their os-release file, while other systems are recognized through dedicated markers like sys.platform values, environment variables or vendor files.
A compatibility layer is detected alongside the system it hosts, so two platform detection functions can legitimately return True at the same time: inside WSL, both is_wsl2() (or is_wsl1()) and the hosted distribution’s function like is_ubuntu() match; inside ChromeOS’s Crostini container, both is_chromeos() and is_debian() do.
current_platform() narrows the matches down to the most informative one by dropping the layers (WSL1, WSL2, CHROMEOS) in favor of the hosted distribution. current_traits() keeps every match.
GENERIC_LINUX plays the opposite role: it is not an extra match but a fallback, only firing when the kernel is Linux and the distribution cannot be identified (like minimal containers or build chroots shipping no os-release file). current_platform() still returns it in that situation, while logging a warning inviting you to report the unrecognized distribution.
Recognized platforms¶
Independent derivative distributions each get a dedicated platform, even when they build on a parent distribution: Ubuntu, Kali Linux, Linux Mint, Raspbian and PikaOS are all Debian derivatives, but each is managed by its own organization. Release channels, variants and flavors of a single distribution, managed by the same organization as the parent, are folded into the parent’s platform: every openSUSE channel (Tumbleweed, Leap, Slowroll, MicroOS, …) is detected as OPENSUSE, while the raw channel ID remains available through info().
Icon |
Symbol |
Name |
Detection function |
|---|---|---|---|
➿ |
IBM AIX |
||
|
AlmaLinux |
||
🏔️ |
Alpine Linux |
||
Δ |
ALT Linux |
||
⤻ |
Amazon Linux |
||
🤖 |
Android |
||
🎗️ |
Arch Linux |
||
⛑️ |
Buildroot |
||
⌬ |
CachyOS |
||
💠 |
CentOS |
||
🧿 |
ChromeOS |
||
✳️ |
Clear Linux OS |
||
꩜ |
CloudLinux OS |
||
Ͼ |
Cygwin |
||
🌀 |
Debian |
||
🪰 |
DragonFly BSD |
||
🚀 |
EndeavourOS |
||
🐽 |
Exherbo Linux |
||
🎩 |
Fedora |
||
😈 |
FreeBSD |
||
🥚 |
Generic Linux |
||
🗜️ |
Gentoo Linux |
||
🐃 |
Guix System |
||
🍂 |
Haiku |
||
🦬 |
GNU/Hurd |
||
🤹 |
IBM PowerKVM |
||
🔥 |
illumos |
||
🔱 |
Kali Linux |
||
🤹 |
KVM for IBM z Systems |
||
🌿 |
Linux Mint |
||
🍎 |
macOS |
||
⍥ |
Mageia |
||
💫 |
Mandriva Linux |
||
▲ |
Manjaro Linux |
||
🌘 |
MidnightBSD |
||
🚩 |
NetBSD |
||
❄️ |
NixOS |
||
|
Nobara |
||
🐡 |
OpenBSD |
||
🦎 |
openSUSE |
||
📶 |
OpenWrt |
||
🦴 |
Oracle Linux |
||
🟦 |
IBM i |
||
∥ |
Parallels |
||
🍓 |
Pidora |
||
🐹 |
PikaOS |
||
🍓 |
Raspbian |
||
🎩 |
RedHat Enterprise Linux |
||
⛰️ |
Rocky Linux |
||
⚛️ |
Scientific Linux |
||
🚬 |
Slackware |
||
🦎 |
SUSE Linux Enterprise Server |
||
🕷️ |
SliTaz GNU/Linux |
||
🌞 |
Solaris |
||
🧙 |
Source Mage GNU/Linux |
||
🌅 |
SunOS |
||
🤵 |
Tuxedo OS |
||
🎯 |
Ubuntu |
||
🌊 |
Ultramarine |
||
∅ |
Void Linux |
||
🪟 |
Windows |
||
⊞ |
Windows Subsystem for Linux v1 |
||
⊞ |
Windows Subsystem for Linux v2 |
||
Ⓧ |
XenServer |
Hint
The UNKNOWN_PLATFORM trait represents an unrecognized
platform. It is not included in the ALL_PLATFORMS group,
and will be returned by current_platform() if the current
platform is not recognized.
Groups of platforms¶
All platform groups¶
Icon |
Symbol |
Description |
||
|---|---|---|---|---|
⚙️ |
All platforms |
|||
🪟 |
All Windows |
⬥ |
||
Ⓑ |
All BSD |
⬥ |
||
🅱️ |
All BSD excluding macOS |
|||
🐧 |
Linux distributions |
⬥ |
||
≚ |
Linux compatibility layers |
⬥ |
||
🐣 |
All Linux & compatibility layers |
|||
🅟 |
Other POSIX-compliant platforms |
⬥ |
||
𝐕 |
AT&T System Five |
⬥ |
||
⨷ |
All Unix |
|||
≛ |
Unix compatibility layers |
⬥ |
||
⨂ |
All Unix excluding macOS |
Hint
Canonical groups are non-overlapping groups that together cover all recognized traits. They are marked with a ⬥ icon in the table above.
Other groups are provided for convenience, but overlap with each other or with canonical groups.
Canonical groups¶
All platforms are distributed in groups that are guaranteed to be non-overlapping.
Here is the canonical groups and all platforms, visualized as a Sankey diagram:
---
config:
sankey:
height: 800
showValues: false
width: 800
---
sankey-beta
ALL_PLATFORMS,LINUX,47
ALL_PLATFORMS,BSD,7
ALL_PLATFORMS,SYSTEM_V,3
ALL_PLATFORMS,UNIX_LAYERS,2
ALL_PLATFORMS,OTHER_POSIX,2
ALL_PLATFORMS,LINUX_LAYERS,2
ALL_PLATFORMS,ALL_WINDOWS,1
LINUX,ALMALINUX,1
LINUX,ALPINE,1
LINUX,ALTLINUX,1
LINUX,AMZN,1
LINUX,ANDROID,1
LINUX,ARCH,1
LINUX,BUILDROOT,1
LINUX,CACHYOS,1
LINUX,CENTOS,1
LINUX,CHROMEOS,1
LINUX,CLEARLINUX,1
LINUX,CLOUDLINUX,1
LINUX,DEBIAN,1
LINUX,ENDEAVOUROS,1
LINUX,EXHERBO,1
LINUX,FEDORA,1
LINUX,GENERIC_LINUX,1
LINUX,GENTOO,1
LINUX,GUIX,1
LINUX,IBM_POWERKVM,1
LINUX,KALI,1
LINUX,KVMIBM,1
LINUX,LINUXMINT,1
LINUX,MAGEIA,1
LINUX,MANDRIVA,1
LINUX,MANJARO,1
LINUX,NIXOS,1
LINUX,NOBARA,1
LINUX,OPENSUSE,1
LINUX,OPENWRT,1
LINUX,ORACLE,1
LINUX,PARALLELS,1
LINUX,PIDORA,1
LINUX,PIKAOS,1
LINUX,RASPBIAN,1
LINUX,RHEL,1
LINUX,ROCKY,1
LINUX,SCIENTIFIC,1
LINUX,SLACKWARE,1
LINUX,SLES,1
LINUX,SLITAZ,1
LINUX,SOURCEMAGE,1
LINUX,TUXEDO,1
LINUX,UBUNTU,1
LINUX,ULTRAMARINE,1
LINUX,VOID,1
LINUX,XENSERVER,1
BSD,DRAGONFLY_BSD,1
BSD,FREEBSD,1
BSD,MACOS,1
BSD,MIDNIGHTBSD,1
BSD,NETBSD,1
BSD,OPENBSD,1
BSD,SUNOS,1
SYSTEM_V,AIX,1
SYSTEM_V,ILLUMOS,1
SYSTEM_V,SOLARIS,1
UNIX_LAYERS,CYGWIN,1
UNIX_LAYERS,OS400,1
OTHER_POSIX,HAIKU,1
OTHER_POSIX,HURD,1
LINUX_LAYERS,WSL1,1
LINUX_LAYERS,WSL2,1
ALL_WINDOWS,WINDOWS,1
And the same groups visualized as a mindmap:
---
config:
mindmap:
padding: 5
---
mindmap
((⚙️ ALL_PLATFORMS))
)≛ UNIX_LAYERS(
(Ͼ CYGWIN)
(🟦 OS400)
)𝐕 SYSTEM_V(
(➿ AIX)
(🔥 ILLUMOS)
(🌞 SOLARIS)
)🅟 OTHER_POSIX(
(🍂 HAIKU)
(🦬 HURD)
)≚ LINUX_LAYERS(
(⊞ WSL1)
(⊞ WSL2)
)🐧 LINUX(
( ALMALINUX)
(🏔️ ALPINE)
(Δ ALTLINUX)
(⤻ AMZN)
(🤖 ANDROID)
(🎗️ ARCH)
(⛑️ BUILDROOT)
(⌬ CACHYOS)
(💠 CENTOS)
(🧿 CHROMEOS)
(✳️ CLEARLINUX)
(꩜ CLOUDLINUX)
(🌀 DEBIAN)
(🚀 ENDEAVOUROS)
(🐽 EXHERBO)
(🎩 FEDORA)
(🥚 GENERIC_LINUX)
(🗜️ GENTOO)
(🐃 GUIX)
(🤹 IBM_POWERKVM)
(🔱 KALI)
(🤹 KVMIBM)
(🌿 LINUXMINT)
(⍥ MAGEIA)
(💫 MANDRIVA)
(▲ MANJARO)
(❄️ NIXOS)
( NOBARA)
(🦎 OPENSUSE)
(📶 OPENWRT)
(🦴 ORACLE)
(∥ PARALLELS)
(🍓 PIDORA)
(🐹 PIKAOS)
(🍓 RASPBIAN)
(🎩 RHEL)
(⛰️ ROCKY)
(⚛️ SCIENTIFIC)
(🚬 SLACKWARE)
(🦎 SLES)
(🕷️ SLITAZ)
(🧙 SOURCEMAGE)
(🤵 TUXEDO)
(🎯 UBUNTU)
(🌊 ULTRAMARINE)
(∅ VOID)
(Ⓧ XENSERVER)
)Ⓑ BSD(
(🪰 DRAGONFLY_BSD)
(😈 FREEBSD)
(🍎 MACOS)
(🌘 MIDNIGHTBSD)
(🚩 NETBSD)
(🐡 OPENBSD)
(🌅 SUNOS)
)🪟 ALL_WINDOWS(
(🪟 WINDOWS)
Predefined platforms¶
Platform definitions and metadata.
Important
Not every distribution gets a dedicated entry. The granularity policy is:
Independent derivative distributions each get their own platform, even when they build on a parent distribution. Ubuntu, Kali Linux, Linux Mint, Raspbian and PikaOS are all Debian derivatives, but each is managed by its own organization, with its own identity, release cadence and package repositories.
Release channels, variants and flavors of a single distribution, managed by the same organization as the parent, are folded into the parent’s platform. Every openSUSE channel (Tumbleweed, Leap, Slowroll, MicroOS, …) is detected as
OPENSUSEby itsis_opensuse()detection function, while the raw channel ID remains available throughPlatform.info().
Note
Default icons are inspired from Starship project: - https://starship.rs/config/#os - https://github.com/starship/starship/blob/master/.github/config-schema.json
Some icons, especially Linux distributions, have their own dedicated codepoints in NerdFonts.
- extra_platforms.platform_data.ALMALINUX = Platform(id='almalinux', name='AlmaLinux')¶
Note
AlmaLinux has no representative Unicode emoji, so like
NOBARAit uses a NerdFont icon instead: (i.e. nf-linux-almalinux / f31d).The side-effect of using a NerdFont character is it will only display correctly when using a supported font. Otherwise, it will appear as an unknown or invisible character depending on the fonts.
- extra_platforms.platform_data.NOBARA = Platform(id='nobara', name='Nobara')¶
Note
Instead of using a loose Unicode icon for the Nobara OS, or just not adding any, we are using a NerdFont icon instead: (i.e. nf-linux-nobara / f380).
The side-effect of using a NerdFont character is it will only display correctly when using a supported font. Otherwise, it will appear as an unknown or invisible character depending on the fonts.
Todo
In the future, we may want to have two icons for each platform, one that is Unicode-based, the other that is NerdFont-based.
- extra_platforms.AIX = Platform(id='aix', name='IBM AIX')¶
ID:
aixAliases: -
Name: IBM AIX
Icon: ➿
Reference: <https://ibm.com/products/aix/>_
Detection function:
is_aix()Pytest decorators:
@skip_aix/@unless_aixGroups (5):
ALL_PLATFORMS,ALL_TRAITS,SYSTEM_V⬥,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.ALMALINUX = Platform(id='almalinux', name='AlmaLinux')¶
Note
AlmaLinux has no representative Unicode emoji, so like
NOBARAit uses a NerdFont icon instead: (i.e. nf-linux-almalinux / f31d).The side-effect of using a NerdFont character is it will only display correctly when using a supported font. Otherwise, it will appear as an unknown or invisible character depending on the fonts.
ID:
almalinuxAliases: -
Name: AlmaLinux
Icon:
Reference: <https://almalinux.org>_
Detection function:
is_almalinux()Pytest decorators:
@skip_almalinux/@unless_almalinuxGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.ALPINE = Platform(id='alpine', name='Alpine Linux')¶
ID:
alpineAliases: -
Name: Alpine Linux
Icon: 🏔️
Reference: <https://alpinelinux.org>_
Detection function:
is_alpine()Pytest decorators:
@skip_alpine/@unless_alpineGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.ALTLINUX = Platform(id='altlinux', name='ALT Linux')¶
ID:
altlinuxAliases: -
Name: ALT Linux
Icon: Δ
Reference: <https://altlinux.org>_
Detection function:
is_altlinux()Pytest decorators:
@skip_altlinux/@unless_altlinuxGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.AMZN = Platform(id='amzn', name='Amazon Linux')¶
ID:
amznAliases: -
Name: Amazon Linux
Icon: ⤻
Reference: <https://aws.amazon.com/amazon-linux-ami/>_
Detection function:
is_amzn()Pytest decorators:
@skip_amzn/@unless_amznGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.ANDROID = Platform(id='android', name='Android')¶
ID:
androidAliases: -
Name: Android
Icon: 🤖
Reference: <https://android.com>_
Detection function:
is_android()Pytest decorators:
@skip_android/@unless_androidGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.ARCH = Platform(id='arch', name='Arch Linux')¶
ID:
archAliases: -
Name: Arch Linux
Icon: 🎗️
Reference: <https://archlinux.org>_
Detection function:
is_arch()Pytest decorators:
@skip_arch/@unless_archGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.BUILDROOT = Platform(id='buildroot', name='Buildroot')¶
ID:
buildrootAliases: -
Name: Buildroot
Icon: ⛑️
Reference: <https://buildroot.org>_
Detection function:
is_buildroot()Pytest decorators:
@skip_buildroot/@unless_buildrootGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.CACHYOS = Platform(id='cachyos', name='CachyOS')¶
ID:
cachyosAliases: -
Name: CachyOS
Icon: ⌬
Reference: <https://cachyos.org>_
Detection function:
is_cachyos()Pytest decorators:
@skip_cachyos/@unless_cachyosGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.CENTOS = Platform(id='centos', name='CentOS')¶
ID:
centosAliases: -
Name: CentOS
Icon: 💠
Reference: <https://centos.org>_
Detection function:
is_centos()Pytest decorators:
@skip_centos/@unless_centosGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.CHROMEOS = Platform(id='chromeos', name='ChromeOS')¶
ID:
chromeosAliases: -
Name: ChromeOS
Icon: 🧿
Reference: <https://chromeos.google>_
Detection function:
is_chromeos()Pytest decorators:
@skip_chromeos/@unless_chromeosGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.CLEARLINUX = Platform(id='clearlinux', name='Clear Linux OS')¶
ID:
clearlinuxAliases: -
Name: Clear Linux OS
Icon: ✳️
Reference: <https://clearlinux.org>_
Detection function:
is_clearlinux()Pytest decorators:
@skip_clearlinux/@unless_clearlinuxGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.CLOUDLINUX = Platform(id='cloudlinux', name='CloudLinux OS')¶
ID:
cloudlinuxAliases: -
Name: CloudLinux OS
Icon: ꩜
Reference: <https://cloudlinux.com>_
Detection function:
is_cloudlinux()Pytest decorators:
@skip_cloudlinux/@unless_cloudlinuxGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.CYGWIN = Platform(id='cygwin', name='Cygwin')¶
ID:
cygwinAliases: -
Name: Cygwin
Icon: Ͼ
Reference: <https://cygwin.com>_
Detection function:
is_cygwin()Pytest decorators:
@skip_cygwin/@unless_cygwinGroups (5):
ALL_PLATFORMS,ALL_TRAITS,UNIX,UNIX_LAYERS⬥,UNIX_WITHOUT_MACOS
- extra_platforms.DEBIAN = Platform(id='debian', name='Debian')¶
ID:
debianAliases: -
Name: Debian
Icon: 🌀
Reference: <https://debian.org>_
Detection function:
is_debian()Pytest decorators:
@skip_debian/@unless_debianGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.DRAGONFLY_BSD = Platform(id='dragonfly_bsd', name='DragonFly BSD')¶
ID:
dragonfly_bsdAliases: -
Name: DragonFly BSD
Icon: 🪰
Reference: <https://www.dragonflybsd.org>_
Detection function:
is_dragonfly_bsd()Pytest decorators:
@skip_dragonfly_bsd/@unless_dragonfly_bsdGroups (6):
ALL_PLATFORMS,ALL_TRAITS,BSD⬥,BSD_WITHOUT_MACOS,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.ENDEAVOUROS = Platform(id='endeavouros', name='EndeavourOS')¶
ID:
endeavourosAliases: -
Name: EndeavourOS
Icon: 🚀
Reference: <https://endeavouros.com>_
Detection function:
is_endeavouros()Pytest decorators:
@skip_endeavouros/@unless_endeavourosGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.EXHERBO = Platform(id='exherbo', name='Exherbo Linux')¶
ID:
exherboAliases: -
Name: Exherbo Linux
Icon: 🐽
Reference: <https://exherbolinux.org>_
Detection function:
is_exherbo()Pytest decorators:
@skip_exherbo/@unless_exherboGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.FEDORA = Platform(id='fedora', name='Fedora')¶
ID:
fedoraAliases: -
Name: Fedora
Icon: 🎩
Reference: <https://fedoraproject.org>_
Detection function:
is_fedora()Pytest decorators:
@skip_fedora/@unless_fedoraGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.FREEBSD = Platform(id='freebsd', name='FreeBSD')¶
ID:
freebsdAliases: -
Name: FreeBSD
Icon: 😈
Reference: <https://freebsd.org>_
Detection function:
is_freebsd()Pytest decorators:
@skip_freebsd/@unless_freebsdGroups (6):
ALL_PLATFORMS,ALL_TRAITS,BSD⬥,BSD_WITHOUT_MACOS,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.GENERIC_LINUX = Platform(id='generic_linux', name='Generic Linux')¶
ID:
generic_linuxAliases: -
Name: Generic Linux
Icon: 🥚
Reference: <https://kernel.org>_
Detection function:
is_generic_linux()Pytest decorators:
@skip_generic_linux/@unless_generic_linuxGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.GENTOO = Platform(id='gentoo', name='Gentoo Linux')¶
ID:
gentooAliases: -
Name: Gentoo Linux
Icon: 🗜️
Reference: <https://gentoo.org>_
Detection function:
is_gentoo()Pytest decorators:
@skip_gentoo/@unless_gentooGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.GUIX = Platform(id='guix', name='Guix System')¶
ID:
guixAliases: -
Name: Guix System
Icon: 🐃
Reference: <https://guix.gnu.org>_
Detection function:
is_guix()Pytest decorators:
@skip_guix/@unless_guixGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.HAIKU = Platform(id='haiku', name='Haiku')¶
ID:
haikuAliases: -
Name: Haiku
Icon: 🍂
Reference: <https://www.haiku-os.org>_
Detection function:
is_haiku()Pytest decorators:
@skip_haiku/@unless_haikuGroups (5):
ALL_PLATFORMS,ALL_TRAITS,OTHER_POSIX⬥,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.HURD = Platform(id='hurd', name='GNU/Hurd')¶
ID:
hurdAliases: -
Name: GNU/Hurd
Icon: 🦬
Reference: <https://www.gnu.org/software/hurd/>_
Detection function:
is_hurd()Pytest decorators:
@skip_hurd/@unless_hurdGroups (5):
ALL_PLATFORMS,ALL_TRAITS,OTHER_POSIX⬥,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.IBM_POWERKVM = Platform(id='ibm_powerkvm', name='IBM PowerKVM')¶
ID:
ibm_powerkvmAliases: -
Name: IBM PowerKVM
Icon: 🤹
Reference: <https://ibm.com/mysupport/s/topic/0TO50000000QkyPGAS/>_
Detection function:
is_ibm_powerkvm()Pytest decorators:
@skip_ibm_powerkvm/@unless_ibm_powerkvmGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.ILLUMOS = Platform(id='illumos', name='illumos')¶
ID:
illumosAliases: -
Name: illumos
Icon: 🔥
Reference: <https://illumos.org>_
Detection function:
is_illumos()Pytest decorators:
@skip_illumos/@unless_illumosGroups (5):
ALL_PLATFORMS,ALL_TRAITS,SYSTEM_V⬥,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.KALI = Platform(id='kali', name='Kali Linux')¶
ID:
kaliAliases: -
Name: Kali Linux
Icon: 🔱
Reference: <https://kali.org>_
Detection function:
is_kali()Pytest decorators:
@skip_kali/@unless_kaliGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.KVMIBM = Platform(id='kvmibm', name='KVM for IBM z Systems')¶
ID:
kvmibmAliases: -
Name: KVM for IBM z Systems
Icon: 🤹
Reference: <https://ibm.com/products/kvm/>_
Detection function:
is_kvmibm()Pytest decorators:
@skip_kvmibm/@unless_kvmibmGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.LINUXMINT = Platform(id='linuxmint', name='Linux Mint')¶
ID:
linuxmintAliases: -
Name: Linux Mint
Icon: 🌿
Reference: <https://linuxmint.com>_
Detection function:
is_linuxmint()Pytest decorators:
@skip_linuxmint/@unless_linuxmintGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.MACOS = Platform(id='macos', name='macOS')¶
ID:
macosAliases: -
Name: macOS
Icon: 🍎
Reference: <https://apple.com/macos/>_
Detection function:
is_macos()Pytest decorators:
@skip_macos/@unless_macosGroups (4):
ALL_PLATFORMS,ALL_TRAITS,BSD⬥,UNIX
- extra_platforms.MAGEIA = Platform(id='mageia', name='Mageia')¶
ID:
mageiaAliases: -
Name: Mageia
Icon: ⍥
Reference: <https://mageia.org>_
Detection function:
is_mageia()Pytest decorators:
@skip_mageia/@unless_mageiaGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.MANDRIVA = Platform(id='mandriva', name='Mandriva Linux')¶
ID:
mandrivaAliases: -
Name: Mandriva Linux
Icon: 💫
Reference: <https://web.archive.org/web/20150522203942/https://mandriva.com/en/mbs/>_
Detection function:
is_mandriva()Pytest decorators:
@skip_mandriva/@unless_mandrivaGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.MANJARO = Platform(id='manjaro', name='Manjaro Linux')¶
ID:
manjaroAliases: -
Name: Manjaro Linux
Icon: ▲
Reference: <https://manjaro.org>_
Detection function:
is_manjaro()Pytest decorators:
@skip_manjaro/@unless_manjaroGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.MIDNIGHTBSD = Platform(id='midnightbsd', name='MidnightBSD')¶
ID:
midnightbsdAliases: -
Name: MidnightBSD
Icon: 🌘
Reference: <https://midnightbsd.org>_
Detection function:
is_midnightbsd()Pytest decorators:
@skip_midnightbsd/@unless_midnightbsdGroups (6):
ALL_PLATFORMS,ALL_TRAITS,BSD⬥,BSD_WITHOUT_MACOS,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.NETBSD = Platform(id='netbsd', name='NetBSD')¶
ID:
netbsdAliases: -
Name: NetBSD
Icon: 🚩
Reference: <https://netbsd.org>_
Detection function:
is_netbsd()Pytest decorators:
@skip_netbsd/@unless_netbsdGroups (6):
ALL_PLATFORMS,ALL_TRAITS,BSD⬥,BSD_WITHOUT_MACOS,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.NIXOS = Platform(id='nixos', name='NixOS')¶
ID:
nixosAliases: -
Name: NixOS
Icon: ❄️
Reference: <https://nixos.org>_
Detection function:
is_nixos()Pytest decorators:
@skip_nixos/@unless_nixosGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.NOBARA = Platform(id='nobara', name='Nobara')¶
Note
Instead of using a loose Unicode icon for the Nobara OS, or just not adding any, we are using a NerdFont icon instead: (i.e. nf-linux-nobara / f380).
The side-effect of using a NerdFont character is it will only display correctly when using a supported font. Otherwise, it will appear as an unknown or invisible character depending on the fonts.
Todo
In the future, we may want to have two icons for each platform, one that is Unicode-based, the other that is NerdFont-based.
ID:
nobaraAliases: -
Name: Nobara
Icon:
Reference: <https://nobaraproject.org>_
Detection function:
is_nobara()Pytest decorators:
@skip_nobara/@unless_nobaraGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.OPENBSD = Platform(id='openbsd', name='OpenBSD')¶
ID:
openbsdAliases: -
Name: OpenBSD
Icon: 🐡
Reference: <https://openbsd.org>_
Detection function:
is_openbsd()Pytest decorators:
@skip_openbsd/@unless_openbsdGroups (6):
ALL_PLATFORMS,ALL_TRAITS,BSD⬥,BSD_WITHOUT_MACOS,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.OPENSUSE = Platform(id='opensuse', name='openSUSE')¶
ID:
opensuseAliases: -
Name: openSUSE
Icon: 🦎
Reference: <https://opensuse.org>_
Detection function:
is_opensuse()Pytest decorators:
@skip_opensuse/@unless_opensuseGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.OPENWRT = Platform(id='openwrt', name='OpenWrt')¶
ID:
openwrtAliases: -
Name: OpenWrt
Icon: 📶
Reference: <https://openwrt.org>_
Detection function:
is_openwrt()Pytest decorators:
@skip_openwrt/@unless_openwrtGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.ORACLE = Platform(id='oracle', name='Oracle Linux')¶
ID:
oracleAliases: -
Name: Oracle Linux
Icon: 🦴
Reference: <https://oracle.com/linux/>_
Detection function:
is_oracle()Pytest decorators:
@skip_oracle/@unless_oracleGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.OS400 = Platform(id='os400', name='IBM i')¶
ID:
os400Aliases: -
Name: IBM i
Icon: 🟦
Reference: <https://en.wikipedia.org/wiki/IBM_i>_
Detection function:
is_os400()Pytest decorators:
@skip_os400/@unless_os400Groups (5):
ALL_PLATFORMS,ALL_TRAITS,UNIX,UNIX_LAYERS⬥,UNIX_WITHOUT_MACOS
- extra_platforms.PARALLELS = Platform(id='parallels', name='Parallels')¶
ID:
parallelsAliases: -
Name: Parallels
Icon: ∥
Reference: <https://parallels.com>_
Detection function:
is_parallels()Pytest decorators:
@skip_parallels/@unless_parallelsGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.PIDORA = Platform(id='pidora', name='Pidora')¶
ID:
pidoraAliases: -
Name: Pidora
Icon: 🍓
Reference: <https://web.archive.org/web/20200227132047/http://pidora.ca:80/>_
Detection function:
is_pidora()Pytest decorators:
@skip_pidora/@unless_pidoraGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.PIKAOS = Platform(id='pikaos', name='PikaOS')¶
ID:
pikaosAliases: -
Name: PikaOS
Icon: 🐹
Reference: <https://pika-os.com>_
Detection function:
is_pikaos()Pytest decorators:
@skip_pikaos/@unless_pikaosGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.RASPBIAN = Platform(id='raspbian', name='Raspbian')¶
ID:
raspbianAliases: -
Name: Raspbian
Icon: 🍓
Reference: <https://raspberrypi.com/software/>_
Detection function:
is_raspbian()Pytest decorators:
@skip_raspbian/@unless_raspbianGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.RHEL = Platform(id='rhel', name='RedHat Enterprise Linux')¶
ID:
rhelAliases: -
Name: RedHat Enterprise Linux
Icon: 🎩
Reference: <https://redhat.com/rhel/>_
Detection function:
is_rhel()Pytest decorators:
@skip_rhel/@unless_rhelGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.ROCKY = Platform(id='rocky', name='Rocky Linux')¶
ID:
rockyAliases: -
Name: Rocky Linux
Icon: ⛰️
Reference: <https://rockylinux.org>_
Detection function:
is_rocky()Pytest decorators:
@skip_rocky/@unless_rockyGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.SCIENTIFIC = Platform(id='scientific', name='Scientific Linux')¶
ID:
scientificAliases: -
Name: Scientific Linux
Icon: ⚛️
Reference: <https://scientificlinux.org>_
Detection function:
is_scientific()Pytest decorators:
@skip_scientific/@unless_scientificGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.SLACKWARE = Platform(id='slackware', name='Slackware')¶
ID:
slackwareAliases: -
Name: Slackware
Icon: 🚬
Reference: <https://www.slackware.com>_
Detection function:
is_slackware()Pytest decorators:
@skip_slackware/@unless_slackwareGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.SLES = Platform(id='sles', name='SUSE Linux Enterprise Server')¶
ID:
slesAliases: -
Name: SUSE Linux Enterprise Server
Icon: 🦎
Reference: <https://suse.com/products/server/>_
Detection function:
is_sles()Pytest decorators:
@skip_sles/@unless_slesGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.SLITAZ = Platform(id='slitaz', name='SliTaz GNU/Linux')¶
ID:
slitazAliases: -
Name: SliTaz GNU/Linux
Icon: 🕷️
Reference: <https://slitaz.org>_
Detection function:
is_slitaz()Pytest decorators:
@skip_slitaz/@unless_slitazGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.SOLARIS = Platform(id='solaris', name='Solaris')¶
ID:
solarisAliases: -
Name: Solaris
Icon: 🌞
Reference: <https://oracle.com/solaris>_
Detection function:
is_solaris()Pytest decorators:
@skip_solaris/@unless_solarisGroups (5):
ALL_PLATFORMS,ALL_TRAITS,SYSTEM_V⬥,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.SOURCEMAGE = Platform(id='sourcemage', name='Source Mage GNU/Linux')¶
ID:
sourcemageAliases: -
Name: Source Mage GNU/Linux
Icon: 🧙
Reference: <https://sourcemage.org>_
Detection function:
is_sourcemage()Pytest decorators:
@skip_sourcemage/@unless_sourcemageGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.SUNOS = Platform(id='sunos', name='SunOS')¶
ID:
sunosAliases: -
Name: SunOS
Icon: 🌅
Reference: <https://wikipedia.org/wiki/SunOS>_
Detection function:
is_sunos()Pytest decorators:
@skip_sunos/@unless_sunosGroups (6):
ALL_PLATFORMS,ALL_TRAITS,BSD⬥,BSD_WITHOUT_MACOS,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.TUXEDO = Platform(id='tuxedo', name='Tuxedo OS')¶
ID:
tuxedoAliases: -
Name: Tuxedo OS
Icon: 🤵
Reference: <https://tuxedocomputers.com/os>_
Detection function:
is_tuxedo()Pytest decorators:
@skip_tuxedo/@unless_tuxedoGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.UBUNTU = Platform(id='ubuntu', name='Ubuntu')¶
ID:
ubuntuAliases: -
Name: Ubuntu
Icon: 🎯
Reference: <https://ubuntu.com>_
Detection function:
is_ubuntu()Pytest decorators:
@skip_ubuntu/@unless_ubuntuGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.ULTRAMARINE = Platform(id='ultramarine', name='Ultramarine')¶
ID:
ultramarineAliases: -
Name: Ultramarine
Icon: 🌊
Reference: <https://ultramarine-linux.org>_
Detection function:
is_ultramarine()Pytest decorators:
@skip_ultramarine/@unless_ultramarineGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.UNKNOWN_PLATFORM = Platform(id='unknown_platform', name='Unknown platform')¶
ID:
unknown_platformAliases: -
Name: Unknown platform
Icon: ❓
Reference: <https://en.wikipedia.org/wiki/Computer_platform>_
Detection function:
is_unknown_platform()Pytest decorators:
@skip_unknown_platform/@unless_unknown_platformGroups (2):
ALL_TRAITS,UNKNOWN⬥
- extra_platforms.VOID = Platform(id='void', name='Void Linux')¶
ID:
voidAliases: -
Name: Void Linux
Icon: ∅
Reference: <https://voidlinux.org/>_
Detection function:
is_void()Pytest decorators:
@skip_void/@unless_voidGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.WINDOWS = Platform(id='windows', name='Windows')¶
ID:
windowsAliases: -
Name: Windows
Icon: 🪟
Reference: <https://windows.com>_
Detection function:
is_windows()Pytest decorators:
@skip_windows/@unless_windowsGroups (3):
ALL_PLATFORMS,ALL_TRAITS,ALL_WINDOWS⬥
- extra_platforms.WSL1 = Platform(id='wsl1', name='Windows Subsystem for Linux v1')¶
ID:
wsl1Aliases: -
Name: Windows Subsystem for Linux v1
Icon: ⊞
Reference: <https://learn.microsoft.com/windows/wsl>_
Detection function:
is_wsl1()Pytest decorators:
@skip_wsl1/@unless_wsl1Groups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX_LAYERS⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.WSL2 = Platform(id='wsl2', name='Windows Subsystem for Linux v2')¶
ID:
wsl2Aliases: -
Name: Windows Subsystem for Linux v2
Icon: ⊞
Reference: <https://learn.microsoft.com/windows/wsl>_
Detection function:
is_wsl2()Pytest decorators:
@skip_wsl2/@unless_wsl2Groups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX_LAYERS⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
- extra_platforms.XENSERVER = Platform(id='xenserver', name='XenServer')¶
ID:
xenserverAliases: -
Name: XenServer
Icon: Ⓧ
Reference: <https://xenproject.org>_
Detection function:
is_xenserver()Pytest decorators:
@skip_xenserver/@unless_xenserverGroups (6):
ALL_PLATFORMS,ALL_TRAITS,LINUX⬥,LINUX_LIKE,UNIX,UNIX_WITHOUT_MACOS
Platform information¶
Version and codename details behind info() are gathered by the
platform_info module: Linux distributions through /etc/os-release, with
systemd-hostnamed as a fallback for systems hiding that file, macOS and
Windows through their own platform primitives.
Platform-specific information gathering.
This module provides utilities to fetch detailed version and codename information
for all platforms: Linux distributions (via /etc/os-release), macOS and Windows.
Linux reads /etc/os-release, then /usr/lib/os-release. When neither file is
readable, _hostnamectl_os_release() asks systemd-hostnamed for the same
identity over D-Bus and rebuilds the os-release fields from its answer.
See also
The os-release specification
defines the format and fields of /etc/os-release.
- extra_platforms.platform_info.CODENAME_RE = re.compile('\\((\\D+)\\)|,\\s*(\\D+)')¶
Matches a codename trailing a version string.
The os-release specification puts no codename in
VERSION, but distributions append one anyway, either parenthesized (22.04.3 LTS (Jammy Jellyfish)) or after a comma (10, Buster). Both forms exclude digits, which keeps the version itself out of the match.
- extra_platforms.platform_info.CPE_ID_OVERRIDES: dict[str, str] = {'alt:server': 'altlinux', 'amazon:amazon_linux': 'amzn', 'amazon:linux': 'amzn', 'opensuse:leap': 'opensuse-leap', 'oracle:linux': 'ol', 'redhat:enterprise_linux': 'rhel', 'scientificlinux:scientificlinux': 'rhel', 'slackware:slackware_linux': 'slackware'}¶
Maps a CPE
vendor:productpair to the os-releaseIDof the same system.A CPE product name and an os-release
IDare set by different bodies, so they agree for most distributions and diverge for some. Only the divergent pairs are listed here:_parse_cpe_name()uses the product itself for all the others, which coversalmalinux,centos,cloudlinux,fedora,kvmibm,opensuse,rockyandsles.Each entry is read from a real os-release file declaring both fields, as collected in python-distro’s test resources. Add an entry only from such a file: the rule is to reproduce the
IDthe system itself declares, never to pick the ID that looks right.
- extra_platforms.platform_info.os_release_id() str[source]¶
Return the sanitized distribution ID from os-release.
Lowercases the
IDfield and replaces spaces with underscores. No other transformation is applied: sub-variant IDs (likeolfor Oracle Linux, oropensuse-slowrollfor the openSUSE Slowroll channel) are preserved verbatim, solinux_info()andPlatform.info()expose the exact distribution flavor. Mapping these IDs to their canonical platform is the job of the detection functions (seeis_oracle()andis_opensuse()indetection.py).- Return type:
- Returns:
Sanitized distribution ID, or empty string if absent.
- extra_platforms.platform_info.linux_info() dict[str, Any][source]¶
Fetch detailed Linux distribution information from os-release.
Returns a dictionary with the same structure as
distro.info()for consistency, including:id: Distribution ID (e.g., “ubuntu”, “fedora”)version: Full version string (e.g., “22.04”)version_parts: Dictionary withmajor,minor,build_numberlike: Space-separated list of related distributionscodename: Distribution codename (e.g., “jammy”)
Missing fields are set to
None, like inmacos_info()andwindows_info().
- extra_platforms.platform_info.invalidate_os_release_cache()[source]¶
Clear caches for all os-release functions.
- Return type:
- extra_platforms.platform_info.MACOS_CODENAMES: dict[tuple[str, str | None], str] = {('10', '0'): 'Cheetah', ('10', '1'): 'Puma', ('10', '10'): 'Yosemite', ('10', '11'): 'El Capitan', ('10', '12'): 'Sierra', ('10', '13'): 'High Sierra', ('10', '14'): 'Mojave', ('10', '15'): 'Catalina', ('10', '2'): 'Jaguar', ('10', '3'): 'Panther', ('10', '4'): 'Tiger', ('10', '5'): 'Leopard', ('10', '6'): 'Snow Leopard', ('10', '7'): 'Lion', ('10', '8'): 'Mountain Lion', ('10', '9'): 'Mavericks', ('11', None): 'Big Sur', ('12', None): 'Monterey', ('13', None): 'Ventura', ('14', None): 'Sonoma', ('15', None): 'Sequoia', ('26', None): 'Tahoe', ('27', None): 'Golden Gate'}¶
Maps macOS
(major, minor)version parts to release code name.See also
Todo
Handle the oddity where some beta releases of macOS Tahoe report their major version as
16instead of15or26. Left unhandled for now, as we consider this a glitch in macOS history, and do not have a proper way to detect beta versions at this time.
- extra_platforms.platform_info.get_macos_codename(major=None, minor=None)[source]¶
Get the macOS codename for a given version.
- Parameters:
- Return type:
- Returns:
The codename for the macOS version (like
"Sonoma","Ventura").- Raises:
ValueError – If no codename matches the given version, or if multiple codenames match (which shouldn’t happen with valid data).
- extra_platforms.platform_info.macos_info()[source]¶
Fetch detailed macOS version information.
Returns a dictionary with the same structure as
distro.info()for consistency, including:version: Full version string (e.g., “14.2.1”)version_parts: Dictionary withmajor,minor,build_numbercodename: The macOS codename (e.g., “Sonoma”)
- Return type:
- Returns:
A dictionary containing macOS version details.
- Raises:
ValueError – If the current macOS version cannot be mapped to a codename.
- extra_platforms.platform_info.windows_info()[source]¶
Fetch detailed Windows version information.
Returns a dictionary with the same structure as
distro.info()for consistency, including:version: Full version string (e.g., “10.0.19041”)version_parts: Dictionary withmajor,minor,build_numbercodename: A combination of version and edition (e.g., “10 Enterprise”)
Todo
Get even more details for Windows version. See inspirations from: https://github.com/saltstack/salt/blob/246d066/salt/grains/core.py#L1432-L1488