extra_platforms packageΒΆ

Expose package-wide elements.

extra_platforms.extract_members(*other)[source]ΒΆ

Returns all traits found in other.

other can be an arbitrarily nested Iterable of Group, Trait, or their IDs. None values and empty iterables are silently ignored.

Caution

Can returns duplicates.

Return type:

Iterator[Trait]

extra_platforms.is_all_architectures(*args, **kwargs)ΒΆ
Return type:

Any

extra_platforms.is_all_ci(*args, **kwargs)ΒΆ
Return type:

Any

extra_platforms.is_all_platforms(*args, **kwargs)ΒΆ
Return type:

Any

extra_platforms.is_all_platforms_without_ci(*args, **kwargs)ΒΆ
Return type:

Any

extra_platforms.is_all_traits(*args, **kwargs)ΒΆ
Return type:

Any

extra_platforms.is_bsd_without_macos(*args, **kwargs)ΒΆ
Return type:

Any

extra_platforms.is_ci(*args, **kwargs)ΒΆ
Return type:

Any

extra_platforms.is_other_unix(*args, **kwargs)ΒΆ
Return type:

Any

extra_platforms.is_unix_without_macos(*args, **kwargs)ΒΆ
Return type:

Any

extra_platforms.is_unknown_linux(*args, **kwargs)ΒΆ
Return type:

Any

extra_platforms.platforms_from_ids(*trait_and_group_ids)ΒΆ

Alias platforms_from_ids β†’ traits_from_ids().

Deprecated since version 6.0.0: Use traits_from_ids() instead.

Return type:

tuple[Trait, ...]

SubmodulesΒΆ

extra_platforms.architecture_data moduleΒΆ

Architecture definitions and metadata.

See also

Architecture variants from Rust’s target-lexicon.

extra_platforms.architecture_data.AARCH64 = Architecture(id='aarch64', name='ARM64 (AArch64)')ΒΆ

Warning

Although aarch64 is the canonical ID for this architecture, some platforms may use the alias arm64 instead (e.g., macOS on Apple Silicon).

Todo

Consider adding arm64 as an alias in the future.

extra_platforms.architecture_data.ARMV5TEL = Architecture(id='armv5tel', name='ARMv5TE (little-endian)')ΒΆ

Note

ARMv5TE includes Thumb and DSP extensions. This architecture is found on older ARM devices and may appear in embedded systems or legacy platforms.

extra_platforms.architecture_data.ARMV7L = Architecture(id='armv7l', name='ARMv7 (little-endian)')ΒΆ

Note

This architecture is commonly referred to as armhf (ARM hard-float) in Debian-based distributions, or simply armv7 in other contexts.

extra_platforms.architecture_data.I386 = Architecture(id='i386', name='Intel 80386 (i386)')ΒΆ

Todo

Alias this to i486.

extra_platforms.architecture_data.PPC64LE = Architecture(id='ppc64le', name='PowerPC 64-bit (little-endian)')ΒΆ

Note

Also known as powerpc64le or ppc64el in some distributions.

extra_platforms.architecture_data.X86_64 = Architecture(id='x86_64', name='x86-64 (AMD64)')ΒΆ

Warning

Although x86_64 is the canonical ID for this architecture, some platforms may use the alias amd64 instead (e.g., Windows on x86-64).

Todo

Consider adding amd64 as an alias in the future.

extra_platforms.ci_data moduleΒΆ

CI definitions and metadata.

extra_platforms.detection moduleΒΆ

Heuristics to detect all traits of the current environment.

This collection of heuristics is designed as a set of separate function with minimal logic and dependencies. They’re the building blocks to evaluate the current environment.

All these heuristics can be hard-cached as the underlying system is not changing between code execution. They are still allowed to depends on each others, as long as you’re careful of not implementing circular dependencies.

Warning

Even if highly unlikely, it is possible to have multiple platforms detected for the same environment.

Typical example is Ubuntu WSL, which will make both the is_wsl2() and is_ubuntu() functions return True at the same time.

That’s because of the environment metadata, where:

$ uname -a
Linux 5.15.167.4-microsoft-standard-WSL2

$ cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.5 LTS"

That way we have the possibility elsewhere in extra-platforms to either decide if we only allow one, and only one, heuristic to match the current system, or allow for considering multiple systems at the same time.

Detection of Linux distribution rely on distro to gather as much details as possible. And also because it is the recommended replacement for Python’s original platform.linux_distribution function (which was removed in Python 3.8).

For all other traits, we either rely on:

See also

Other source of inspiration for platform detection:

extra_platforms.detection.is_aarch64()[source]ΒΆ

Return True if current architecture is AARCH64.

Caution

platform.machine() returns different values depending on the OS:

  • Linux: aarch64

  • macOS: arm64

  • Windows: ARM64

Return type:

bool

extra_platforms.detection.is_armv5tel()[source]ΒΆ

Return True if current architecture is ARMV5TEL.

Return type:

bool

extra_platforms.detection.is_armv6l()[source]ΒΆ

Return True if current architecture is ARMV6L.

Return type:

bool

extra_platforms.detection.is_armv7l()[source]ΒΆ

Return True if current architecture is ARMV7L.

Return type:

bool

extra_platforms.detection.is_armv8l()[source]ΒΆ

Return True if current architecture is ARMV8L.

Return type:

bool

extra_platforms.detection.is_arm()[source]ΒΆ

Return True if current architecture is ARM.

Hint

This is a fallback detection for generic ARM architecture. It will return True for any ARM architecture not specifically covered by the more precise variants: is_aarch64(), is_armv5tel(), is_armv6l(), is_armv7l() or is_armv8l().

Return type:

bool

extra_platforms.detection.is_i386()[source]ΒΆ

Return True if current architecture is I386.

Return type:

bool

extra_platforms.detection.is_i586()[source]ΒΆ

Return True if current architecture is I586.

Return type:

bool

extra_platforms.detection.is_i686()[source]ΒΆ

Return True if current architecture is I686.

Return type:

bool

extra_platforms.detection.is_x86_64()[source]ΒΆ

Return True if current architecture is X86_64.

Caution

Windows returns AMD64 in uppercase, so we normalize to lowercase.

Return type:

bool

extra_platforms.detection.is_mips()[source]ΒΆ

Return True if current architecture is MIPS.

Return type:

bool

extra_platforms.detection.is_mipsel()[source]ΒΆ

Return True if current architecture is MIPSEL.

Return type:

bool

extra_platforms.detection.is_mips64()[source]ΒΆ

Return True if current architecture is MIPS64.

Return type:

bool

extra_platforms.detection.is_mips64el()[source]ΒΆ

Return True if current architecture is MIPS64EL.

Return type:

bool

extra_platforms.detection.is_ppc()[source]ΒΆ

Return True if current architecture is PPC.

Return type:

bool

extra_platforms.detection.is_ppc64()[source]ΒΆ

Return True if current architecture is PPC64.

Return type:

bool

extra_platforms.detection.is_ppc64le()[source]ΒΆ

Return True if current architecture is PPC64LE.

Return type:

bool

extra_platforms.detection.is_riscv32()[source]ΒΆ

Return True if current architecture is RISCV32.

Return type:

bool

extra_platforms.detection.is_riscv64()[source]ΒΆ

Return True if current architecture is RISCV64.

Return type:

bool

extra_platforms.detection.is_sparc()[source]ΒΆ

Return True if current architecture is SPARC.

Return type:

bool

extra_platforms.detection.is_sparc64()[source]ΒΆ

Return True if current architecture is SPARC64.

Return type:

bool

extra_platforms.detection.is_s390x()[source]ΒΆ

Return True if current architecture is S390X.

Return type:

bool

extra_platforms.detection.is_loongarch64()[source]ΒΆ

Return True if current architecture is LOONGARCH64.

Return type:

bool

extra_platforms.detection.is_wasm32()[source]ΒΆ

Return True if current architecture is WASM32.

Hint

WebAssembly detection is based on Emscripten’s platform identifier.

Return type:

bool

extra_platforms.detection.is_wasm64()[source]ΒΆ

Return True if current architecture is WASM64.

Hint

WebAssembly detection is based on Emscripten’s platform identifier.

Return type:

bool

extra_platforms.detection.is_unknown_architecture()[source]ΒΆ

Return True if current architecture is UNKNOWN_ARCHITECTURE.

Return type:

bool

extra_platforms.detection.is_aix()[source]ΒΆ

Return True if current platform is AIX.

Return type:

bool

extra_platforms.detection.is_altlinux()[source]ΒΆ

Return True if current platform is ALTLINUX.

Return type:

bool

extra_platforms.detection.is_amzn()[source]ΒΆ

Return True if current platform is AMZN.

Return type:

bool

extra_platforms.detection.is_android()[source]ΒΆ

Return True if current platform is ANDROID.

Return type:

bool

extra_platforms.detection.is_arch()[source]ΒΆ

Return True if current platform is ARCH.

Return type:

bool

extra_platforms.detection.is_buildroot()[source]ΒΆ

Return True if current platform is BUILDROOT.

Return type:

bool

extra_platforms.detection.is_cachyos()[source]ΒΆ

Return True if current platform is CACHYOS.

Return type:

bool

extra_platforms.detection.is_centos()[source]ΒΆ

Return True if current platform is CENTOS.

Return type:

bool

extra_platforms.detection.is_cloudlinux()[source]ΒΆ

Return True if current platform is CLOUDLINUX.

Return type:

bool

extra_platforms.detection.is_cygwin()[source]ΒΆ

Return True if current platform is CYGWIN.

Return type:

bool

extra_platforms.detection.is_debian()[source]ΒΆ

Return True if current platform is DEBIAN.

Return type:

bool

extra_platforms.detection.is_dragonfly_bsd()[source]ΒΆ

Return True if current platform is DRAGONFLY_BSD.

Return type:

bool

extra_platforms.detection.is_exherbo()[source]ΒΆ

Return True if current platform is EXHERBO.

Return type:

bool

extra_platforms.detection.is_fedora()[source]ΒΆ

Return True if current platform is FEDORA.

Return type:

bool

extra_platforms.detection.is_freebsd()[source]ΒΆ

Return True if current platform is FREEBSD.

Return type:

bool

extra_platforms.detection.is_gentoo()[source]ΒΆ

Return True if current platform is GENTOO.

Return type:

bool

extra_platforms.detection.is_guix()[source]ΒΆ

Return True if current platform is GUIX.

Return type:

bool

extra_platforms.detection.is_haiku()[source]ΒΆ

Return True if current platform is HAIKU.

Return type:

bool

extra_platforms.detection.is_hurd()[source]ΒΆ

Return True if current platform is HURD.

Caution

sys.platform can returns GNU or gnu0, see: <https://github.com/kdeldycke/extra-platforms/issues/308>

Return type:

bool

extra_platforms.detection.is_ibm_powerkvm()[source]ΒΆ

Return True if current platform is IBM_POWERKVM.

Return type:

bool

extra_platforms.detection.is_illumos()[source]ΒΆ

Return True if current platform is ILLUMOS.

Hint

Illumos is a Unix OS derived from OpenSolaris. It shares sys.platform == 'sunos5' with Solaris, but can be distinguished by checking platform.uname().version which contains β€œillumos” on Illumos-based systems (like OpenIndiana, SmartOS, OmniOS).

Return type:

bool

extra_platforms.detection.is_kvmibm()[source]ΒΆ

Return True if current platform is KVMIBM.

Return type:

bool

extra_platforms.detection.is_linuxmint()[source]ΒΆ

Return True if current platform is LINUXMINT.

Return type:

bool

extra_platforms.detection.is_macos()[source]ΒΆ

Return True if current platform is MACOS.

Return type:

bool

extra_platforms.detection.is_mageia()[source]ΒΆ

Return True if current platform is MAGEIA.

Return type:

bool

extra_platforms.detection.is_mandriva()[source]ΒΆ

Return True if current platform is MANDRIVA.

Return type:

bool

extra_platforms.detection.is_midnightbsd()[source]ΒΆ

Return True if current platform is MIDNIGHTBSD.

Return type:

bool

extra_platforms.detection.is_netbsd()[source]ΒΆ

Return True if current platform is NETBSD.

Return type:

bool

extra_platforms.detection.is_nobara()[source]ΒΆ

Return True if current platform is NOBARA.

Return type:

bool

extra_platforms.detection.is_openbsd()[source]ΒΆ

Return True if current platform is OPENBSD.

Return type:

bool

extra_platforms.detection.is_opensuse()[source]ΒΆ

Return True if current platform is OPENSUSE.

Return type:

bool

extra_platforms.detection.is_oracle()[source]ΒΆ

Return True if current platform is ORACLE.

Return type:

bool

extra_platforms.detection.is_parallels()[source]ΒΆ

Return True if current platform is PARALLELS.

Return type:

bool

extra_platforms.detection.is_pidora()[source]ΒΆ

Return True if current platform is PIDORA.

Return type:

bool

extra_platforms.detection.is_raspbian()[source]ΒΆ

Return True if current platform is RASPBIAN.

Return type:

bool

extra_platforms.detection.is_rhel()[source]ΒΆ

Return True if current platform is RHEL.

Return type:

bool

extra_platforms.detection.is_rocky()[source]ΒΆ

Return True if current platform is ROCKY.

Return type:

bool

extra_platforms.detection.is_scientific()[source]ΒΆ

Return True if current platform is SCIENTIFIC.

Return type:

bool

extra_platforms.detection.is_slackware()[source]ΒΆ

Return True if current platform is SLACKWARE.

Return type:

bool

extra_platforms.detection.is_sles()[source]ΒΆ

Return True if current platform is SLES.

Return type:

bool

extra_platforms.detection.is_solaris()[source]ΒΆ

Return True if current platform is SOLARIS.

Return type:

bool

extra_platforms.detection.is_sunos()[source]ΒΆ

Return True if current platform is SUNOS.

Return type:

bool

extra_platforms.detection.is_tumbleweed()[source]ΒΆ

Return True if current platform is TUMBLEWEED.

Return type:

bool

extra_platforms.detection.is_tuxedo()[source]ΒΆ

Return True if current platform is TUXEDO.

Return type:

bool

extra_platforms.detection.is_ubuntu()[source]ΒΆ

Return True if current platform is UBUNTU.

Return type:

bool

extra_platforms.detection.is_ultramarine()[source]ΒΆ

Return True if current platform is ULTRAMARINE.

Return type:

bool

extra_platforms.detection.is_windows()[source]ΒΆ

Return True if current platform is WINDOWS.

Return type:

bool

extra_platforms.detection.is_wsl1()[source]ΒΆ

Return True if current platform is WSL1.

Caution

The only difference between WSL1 and WSL2 is the case of the kernel release version:

  • WSL 1:

    $ uname -r
    4.4.0-22572-Microsoft
    
  • WSL 2:

    $ uname -r
    5.10.102.1-microsoft-standard-WSL2
    
Return type:

bool

extra_platforms.detection.is_wsl2()[source]ΒΆ

Return True if current platform is WSL2.

Return type:

bool

extra_platforms.detection.is_xenserver()[source]ΒΆ

Return True if current platform is XENSERVER.

Return type:

bool

extra_platforms.detection.is_unknown_platform()[source]ΒΆ

Return True if current platform is UNKNOWN_PLATFORM.

Return type:

bool

extra_platforms.detection.is_azure_pipelines()[source]ΒΆ

Return True if current CI is AZURE_PIPELINES.

Return type:

bool

extra_platforms.detection.is_bamboo()[source]ΒΆ

Return True if current CI is BAMBOO.

Return type:

bool

extra_platforms.detection.is_buildkite()[source]ΒΆ

Return True if current CI is BUILDKITE.

See also

Environment variables reference: <https://buildkite.com/docs/pipelines/environment-variables>.

Return type:

bool

extra_platforms.detection.is_circle_ci()[source]ΒΆ

Return True if current CI is CIRCLE_CI.

Return type:

bool

extra_platforms.detection.is_cirrus_ci()[source]ΒΆ

Return True if current CI is CIRRUS_CI.

See also

Environment variables reference: <https://cirrus-ci.org/guide/writing-tasks/#environment-variables>.

Return type:

bool

extra_platforms.detection.is_codebuild()[source]ΒΆ

Return True if current CI is CODEBUILD.

Return type:

bool

extra_platforms.detection.is_github_ci()[source]ΒΆ

Return True if current CI is GITHUB_CI.

Return type:

bool

extra_platforms.detection.is_gitlab_ci()[source]ΒΆ

Return True if current CI is GITLAB_CI.

Return type:

bool

extra_platforms.detection.is_heroku_ci()[source]ΒΆ

Return True if current CI is HEROKU_CI.

Return type:

bool

extra_platforms.detection.is_teamcity()[source]ΒΆ

Return True if current CI is TEAMCITY.

Return type:

bool

extra_platforms.detection.is_travis_ci()[source]ΒΆ

Return True if current CI is TRAVIS_CI.

Return type:

bool

extra_platforms.detection.is_unknown_ci()[source]ΒΆ

Return True if current CI is UNKNOWN_CI.

Return type:

bool

extra_platforms.detection.current_architecture(strict=False)[source]ΒΆ

Returns the Architecture matching the current environment.

Returns UNKNOWN_ARCHITECTURE if not running inside a recognized architecture. To raise an error instead, set strict to True.

Important

Always raises an error if multiple architectures match.

Return type:

Architecture

extra_platforms.detection.current_platform(strict=False)[source]ΒΆ

Always returns the best matching Platform for the current environment.

Returns UNKNOWN_PLATFORM if not running inside a recognized platform. To raise an error instead, set strict to True.

Important

If multiple platforms match the current environment, this function will try to select the best, informative one. Raises an error if we can’t decide on a single, appropriate platform.

Return type:

Platform

extra_platforms.detection.current_ci(strict=False)[source]ΒΆ

Returns the CI system matching the current environment.

Returns UNKNOWN_CI if not running inside a recognized CI system. To raise an error instead, set strict to True.

Important

Always raises an error if multiple CI systems match.

Return type:

CI

extra_platforms.detection.current_traits()[source]ΒΆ

Returns all traits matching the current environment.

This includes Platform, Architecture, and CI systems.

Caution

Never returns UNKNOWN traits.

Raises SystemError if the current environment is not recognized at all.

Attention

At this point it is too late to worry about caching. This function has no choice but to evaluate all detection heuristics.

Return type:

set[Trait]

extra_platforms.group moduleΒΆ

Group a collection of traits. Also referred as families.

extra_platforms.group.extract_members(*other)[source]ΒΆ

Returns all traits found in other.

other can be an arbitrarily nested Iterable of Group, Trait, or their IDs. None values and empty iterables are silently ignored.

Caution

Can returns duplicates.

Return type:

Iterator[Trait]

class extra_platforms.group.Group(id, name, icon='❓', members=<factory>)[source]ΒΆ

Bases: _Identifiable

A Group identifies a collection of Trait members.

Additionally of the common fields inherited from _Identifiable, each group provides:

  • members: An iterable of Trait instances that belong to this group.

  • member_ids: A frozenset of member IDs for quick lookup.

  • canonical: A bool indicating if the group is canonical (non-overlapping).

  • various set-like operations (union, intersection, difference, etc.).

unknown_symbol: ClassVar[str] = 'UNKNOWN'ΒΆ

Groups use UNKNOWN instead of UNKNOWN_GROUP.

members: Iterable[Trait]ΒΆ

Traits in this group.

Normalized to MappingProxyType at init, providing O(1) lookup by ID.

generate_docstring()[source]ΒΆ

Generate comprehensive docstring for this group instance.

Combines the attribute docstring from the source module with various metadata.

Return type:

str

property member_ids: frozenset[str]ΒΆ

A frozenset of member IDs that belong to this group.

property canonical: boolΒΆ

Returns True if the group is canonical (non-overlapping), False otherwise.

A canonical group is one that does not share any members with other canonical groups. All canonical groups are non-overlapping.

Non-canonical groups are provided for convenience, but overlap with each other or with canonical groups.

Hint

Canonical groups are denoted with a β¬₯ symbol in the documentation and tables.

items()[source]ΒΆ

Iterate over the traits of the group as key-value pairs.

Return type:

Iterator[tuple[str, Trait]]

isdisjoint(other)[source]ΒΆ

Return True if the group has no members in common with other.

Groups are disjoint if and only if their intersection is an empty set.

other can be an arbitrarily nested Iterable of Group and Trait.

Return type:

bool

fullyintersects(other)[source]ΒΆ

Return True if the group has all members in common with other.

Return type:

bool

issubset(other)[source]ΒΆ

Test whether every member in the group is in other.

Return type:

bool

issuperset(other)[source]ΒΆ

Test whether every member in other is in the group.

Return type:

bool

union(*others)[source]ΒΆ

Return a new Group with members from the group and all others.

Caution

The new Group will inherits the metadata of the first one. All other groups’ metadata will be ignored.

Return type:

Group

intersection(*others)[source]ΒΆ

Return a new Group with members common to the group and all others.

Caution

The new Group will inherits the metadata of the first one. All other groups’ metadata will be ignored.

Return type:

Group

difference(*others)[source]ΒΆ

Return a new Group with members in the group that are not in the others.

Caution

The new Group will inherits the metadata of the first one. All other groups’ metadata will be ignored.

Return type:

Group

symmetric_difference(other)[source]ΒΆ

Return a new Group with members in either the group or other but not both.

Caution

The new Group will inherits the metadata of the first one. All other groups’ metadata will be ignored.

Return type:

Group

copy(id=None, name=None, icon=None, members=None)[source]ΒΆ

Return a shallow copy of the group.

Fields can be overridden by passing new values as arguments.

Return type:

Group

add(member)[source]ΒΆ

Return a new Group with the specified trait added.

If the trait is already in the group, returns a copy unchanged.

Return type:

Group

Args:

member: A Trait object or trait ID string to add.

Returns:

A new Group instance with the trait added.

Raises:

ValueError: If the trait ID is not recognized.

remove(member)[source]ΒΆ

Return a new Group with the specified trait removed.

Raises KeyError if the trait is not in the group.

Return type:

Group

Args:

member: A Trait object or trait ID string to remove.

Returns:

A new Group instance with the trait removed.

Raises:

KeyError: If the trait is not in the group.

discard(member)[source]ΒΆ

Return a new Group with the specified trait removed if present.

Unlike remove(), this does not raise an error if the trait is not found.

Return type:

Group

Args:

member: A Trait object or trait ID string to remove.

Returns:

A new Group instance with the trait removed, or a copy if not present.

pop(member_id=None)[source]ΒΆ

Remove and return a trait from the group.

Return type:

tuple[Trait, Group]

Args:
member_id: Optional trait ID to remove. If not provided, removes an arbitrary

trait (specifically, the first one in iteration order).

Returns:

A tuple of (removed Trait, new Group).

Raises:

KeyError: If member_id is provided but not found in the group. KeyError: If the group is empty.

clear()[source]ΒΆ

Return a new empty Group with the same metadata.

Return type:

Group

Returns:

A new Group instance with no members but same id, name, and icon.

all_group: ClassVar[str] = 'ALL_GROUPS'ΒΆ

The symbol name for the group containing all instances of this type.

data_module_id: ClassVar[str] = 'group_data'ΒΆ

The module name where instances of this type are defined.

doc_page: ClassVar[str] = 'groups.md'ΒΆ

The documentation page filename.

type_id: ClassVar[str] = 'group'ΒΆ

Machine-readable type identifier used to derive module and symbol names.

type_name: ClassVar[str] = 'group'ΒΆ

Human-readable type name for documentation.

extra_platforms.group_data moduleΒΆ

Definitions of ready-to-use groups.

This module contains all predefined Group instances and frozenset collections that organize traits into logical categories.

extra_platforms.group_data.ALL_ARCHITECTURES: Group = Group(id='all_architectures', name='All architectures')ΒΆ

All recognized architectures.

Caution

This group does not contain the UNKNOWN_ARCHITECTURE trait.

extra_platforms.group_data.ALL_ARM = Group(id='all_arm', name='ARM architectures')ΒΆ

All ARM-based architectures.

extra_platforms.group_data.X86 = Group(id='x86', name='x86 family')ΒΆ

All x86-based architectures (Intel-compatible).

extra_platforms.group_data.LOONGARCH = Group(id='loongarch', name='LoongArch')ΒΆ

LoongArch architecture.

extra_platforms.group_data.ALL_MIPS = Group(id='all_mips', name='MIPS architectures')ΒΆ

All MIPS-based architectures.

extra_platforms.group_data.POWERPC = Group(id='powerpc', name='PowerPC family')ΒΆ

All PowerPC-based architectures.

extra_platforms.group_data.RISCV = Group(id='riscv', name='RISC-V family')ΒΆ

All RISC-V-based architectures.

extra_platforms.group_data.ALL_SPARC = Group(id='all_sparc', name='SPARC architectures')ΒΆ

All SPARC-based architectures.

extra_platforms.group_data.IBM_MAINFRAME = Group(id='ibm_mainframe', name='IBM mainframe')ΒΆ

IBM mainframe architectures.

extra_platforms.group_data.WEBASSEMBLY = Group(id='webassembly', name='WebAssembly')ΒΆ

WebAssembly architectures.

extra_platforms.group_data.ARCH_64_BIT = Group(id='arch_64_bit', name='64-bit architectures')ΒΆ

All 64-bit architectures.

extra_platforms.group_data.ARCH_32_BIT = Group(id='arch_32_bit', name='32-bit architectures')ΒΆ

All 32-bit architectures.

extra_platforms.group_data.ALL_PLATFORMS: Group = Group(id='all_platforms', name='All platforms')ΒΆ

All recognized platforms.

Caution

This group does not contain the UNKNOWN_PLATFORM trait.

extra_platforms.group_data.ALL_WINDOWS = Group(id='all_windows', name='All Windows')ΒΆ

All Windows operating systems.

extra_platforms.group_data.UNIX = Group(id='unix', name='All Unix')ΒΆ

All Unix-like operating systems and compatibility layers.

extra_platforms.group_data.UNIX_WITHOUT_MACOS = Group(id='unix_without_macos', name='All Unix excluding macOS')ΒΆ

All Unix platforms, without macOS.

This is useful to avoid macOS-specific workarounds on Unix platforms.

extra_platforms.group_data.BSD = Group(id='bsd', name='All BSD')ΒΆ

All BSD platforms.

Note

Are considered of this family (according Wikipedia):

  • 386BSD (FreeBSD, NetBSD, OpenBSD, DragonFly BSD)

  • NeXTSTEP

  • Darwin (macOS, iOS, audioOS, iPadOS, tvOS, watchOS, bridgeOS)

  • SunOS

  • Ultrix

extra_platforms.group_data.BSD_WITHOUT_MACOS = Group(id='bsd_without_macos', name='All BSD excluding macOS')ΒΆ

All BSD platforms, without macOS.

This is useful to avoid macOS-specific workarounds on BSD platforms.

extra_platforms.group_data.LINUX = Group(id='linux', name='Linux distributions')ΒΆ

All distributions based on a Linux kernel.

Note

Are considered of this family (according Wikipedia):

  • Android

  • ChromeOS

  • any other distribution

extra_platforms.group_data.LINUX_LAYERS = Group(id='linux_layers', name='Linux compatibility layers')ΒΆ

Interfaces that allows Linux binaries to run on a different host system.

Note

Are considered of this family (according Wikipedia):

  • Windows Subsystem for Linux

extra_platforms.group_data.LINUX_LIKE = Group(id='linux_like', name='All Linux & compatibility layers')ΒΆ

Sum of all Linux distributions and Linux compatibility layers.

extra_platforms.group_data.SYSTEM_V = Group(id='system_v', name='AT&T System Five')ΒΆ

All Unix platforms derived from AT&T System Five.

Note

Are considered of this family (according Wikipedia):

  • A/UX

  • AIX

  • HP-UX

  • IRIX

  • OpenServer

  • Solaris

  • OpenSolaris

  • Illumos

  • Tru64

  • UNIX

  • UnixWare

extra_platforms.group_data.UNIX_LAYERS = Group(id='unix_layers', name='Unix compatibility layers')ΒΆ

Interfaces that allows Unix binaries to run on a different host system.

Note

Are considered of this family (according Wikipedia):

  • Cygwin

  • Darling

  • Eunice

  • GNV

  • Interix

  • MachTen

  • Microsoft POSIX subsystem

  • MKS Toolkit

  • PASE

  • P.I.P.S.

  • PWS/VSE-AF

  • UNIX System Services

  • UserLAnd Technologies

  • Windows Services for UNIX

extra_platforms.group_data.OTHER_POSIX = Group(id='other_posix', name='Other POSIX-compliant platforms')ΒΆ

All other UNIX-like or POSIX-compliant platforms.

Note

Are considered of this family (according Wikipedia):

  • Coherent

  • GNU/Hurd

  • HarmonyOS

  • LiteOS

  • LynxOS

  • Minix

  • MOS

  • OSF/1

  • QNX

  • BlackBerry 10

  • Research Unix

  • SerenityOS

extra_platforms.group_data.ALL_CI = Group(id='all_ci', name='CI systems')ΒΆ

All recognized Continuous Integration systems.

Caution

This group does not contain the UNKNOWN_CI trait.

extra_platforms.group_data.UNKNOWN = Group(id='unknown', name='Unknown')ΒΆ

Unknown or unrecognized traits.

extra_platforms.group_data.ALL_TRAITS = Group(id='all_traits', name='All architectures, platforms and CI systems')ΒΆ

All predefined architectures, platforms and CI systems.

Hint

This group includes all UNKNOWN_* traits.

extra_platforms.group_data.ALL_ARCHITECTURE_GROUPS: frozenset[Group] = frozenset({Group(id='loongarch', name='LoongArch'), Group(id='ibm_mainframe', name='IBM mainframe'), Group(id='all_arm', name='ARM architectures'), Group(id='all_sparc', name='SPARC architectures'), Group(id='arch_32_bit', name='32-bit architectures'), Group(id='x86', name='x86 family'), Group(id='powerpc', name='PowerPC family'), Group(id='riscv', name='RISC-V family'), Group(id='webassembly', name='WebAssembly'), Group(id='arch_64_bit', name='64-bit architectures'), Group(id='all_mips', name='MIPS architectures'), Group(id='all_architectures', name='All architectures')})ΒΆ

All groups whose members are architectures.

extra_platforms.group_data.ALL_PLATFORM_GROUPS: frozenset[Group] = frozenset({Group(id='linux_layers', name='Linux compatibility layers'), Group(id='linux_like', name='All Linux & compatibility layers'), Group(id='system_v', name='AT&T System Five'), Group(id='other_posix', name='Other POSIX-compliant platforms'), Group(id='bsd_without_macos', name='All BSD excluding macOS'), Group(id='unix_layers', name='Unix compatibility layers'), Group(id='unix_without_macos', name='All Unix excluding macOS'), Group(id='bsd', name='All BSD'), Group(id='linux', name='Linux distributions'), Group(id='unix', name='All Unix'), Group(id='all_windows', name='All Windows'), Group(id='all_platforms', name='All platforms')})ΒΆ

All groups whose members are platforms.

extra_platforms.group_data.ALL_CI_GROUPS: frozenset[Group] = frozenset({Group(id='all_ci', name='CI systems')})ΒΆ

All groups whose members are CI systems.

Note

Not that useful currently, but provided for symmetry with architecture and platform groups.

extra_platforms.group_data.NON_OVERLAPPING_GROUPS: frozenset[Group] = frozenset({Group(id='loongarch', name='LoongArch'), Group(id='ibm_mainframe', name='IBM mainframe'), Group(id='all_arm', name='ARM architectures'), Group(id='all_sparc', name='SPARC architectures'), Group(id='all_ci', name='CI systems'), Group(id='linux_layers', name='Linux compatibility layers'), Group(id='powerpc', name='PowerPC family'), Group(id='x86', name='x86 family'), Group(id='riscv', name='RISC-V family'), Group(id='system_v', name='AT&T System Five'), Group(id='unknown', name='Unknown'), Group(id='webassembly', name='WebAssembly'), Group(id='other_posix', name='Other POSIX-compliant platforms'), Group(id='unix_layers', name='Unix compatibility layers'), Group(id='bsd', name='All BSD'), Group(id='linux', name='Linux distributions'), Group(id='all_mips', name='MIPS architectures'), Group(id='all_windows', name='All Windows')})ΒΆ

Non-overlapping groups.

Hint

These groups together cover all predefined architectures, platforms, and CI systems, including traits from the UNKNOWN group.

All groups in this collection are marked as canonical.

extra_platforms.group_data.EXTRA_GROUPS: frozenset[Group] = frozenset({Group(id='arch_32_bit', name='32-bit architectures'), Group(id='bsd_without_macos', name='All BSD excluding macOS'), Group(id='linux_like', name='All Linux & compatibility layers'), Group(id='unix_without_macos', name='All Unix excluding macOS'), Group(id='unix', name='All Unix'), Group(id='all_platforms', name='All platforms'), Group(id='arch_64_bit', name='64-bit architectures'), Group(id='all_architectures', name='All architectures'), Group(id='all_traits', name='All architectures, platforms and CI systems')})ΒΆ

Overlapping groups, defined for convenience.

Hint

None of these groups are marked as canonical.

extra_platforms.group_data.ALL_GROUPS: frozenset[Group] = frozenset({Group(id='loongarch', name='LoongArch'), Group(id='all_arm', name='ARM architectures'), Group(id='all_sparc', name='SPARC architectures'), Group(id='linux_layers', name='Linux compatibility layers'), Group(id='arch_32_bit', name='32-bit architectures'), Group(id='powerpc', name='PowerPC family'), Group(id='riscv', name='RISC-V family'), Group(id='unknown', name='Unknown'), Group(id='webassembly', name='WebAssembly'), Group(id='x86', name='x86 family'), Group(id='all_architectures', name='All architectures'), Group(id='linux', name='Linux distributions'), Group(id='bsd_without_macos', name='All BSD excluding macOS'), Group(id='unix_layers', name='Unix compatibility layers'), Group(id='linux_like', name='All Linux & compatibility layers'), Group(id='unix_without_macos', name='All Unix excluding macOS'), Group(id='bsd', name='All BSD'), Group(id='all_windows', name='All Windows'), Group(id='unix', name='All Unix'), Group(id='all_platforms', name='All platforms'), Group(id='all_ci', name='CI systems'), Group(id='system_v', name='AT&T System Five'), Group(id='other_posix', name='Other POSIX-compliant platforms'), Group(id='ibm_mainframe', name='IBM mainframe'), Group(id='arch_64_bit', name='64-bit architectures'), Group(id='all_mips', name='MIPS architectures'), Group(id='all_traits', name='All architectures, platforms and CI systems')})ΒΆ

All predefined groups.

Hint

This collection contains both canonical and non-canonical groups, including the UNKNOWN group.

extra_platforms.group_data.ALL_TRAIT_IDS: frozenset[str] = frozenset({'aarch64', 'aix', 'altlinux', 'amzn', 'android', 'arch', 'arm', 'armv5tel', 'armv6l', 'armv7l', 'armv8l', 'azure_pipelines', 'bamboo', 'buildkite', 'buildroot', 'cachyos', 'centos', 'circle_ci', 'cirrus_ci', 'cloudlinux', 'codebuild', 'cygwin', 'debian', 'dragonfly_bsd', 'exherbo', 'fedora', 'freebsd', 'gentoo', 'github_ci', 'gitlab_ci', 'guix', 'haiku', 'heroku_ci', 'hurd', 'i386', 'i586', 'i686', 'ibm_powerkvm', 'illumos', 'kvmibm', 'linuxmint', 'loongarch64', 'macos', 'mageia', 'mandriva', 'midnightbsd', 'mips', 'mips64', 'mips64el', 'mipsel', 'netbsd', 'nobara', 'openbsd', 'opensuse', 'oracle', 'parallels', 'pidora', 'ppc', 'ppc64', 'ppc64le', 'raspbian', 'rhel', 'riscv32', 'riscv64', 'rocky', 's390x', 'scientific', 'slackware', 'sles', 'solaris', 'sparc', 'sparc64', 'sunos', 'teamcity', 'travis_ci', 'tumbleweed', 'tuxedo', 'ubuntu', 'ultramarine', 'wasm32', 'wasm64', 'windows', 'wsl1', 'wsl2', 'x86_64', 'xenserver'})ΒΆ

A frozenset of all recognized traits IDs.

Attention

This collection does not contain all the UNKNOWN_* traits.

extra_platforms.group_data.ALL_GROUP_IDS: frozenset[str] = frozenset({'all_architectures', 'all_arm', 'all_ci', 'all_mips', 'all_platforms', 'all_sparc', 'all_traits', 'all_windows', 'arch_32_bit', 'arch_64_bit', 'bsd', 'bsd_without_macos', 'ibm_mainframe', 'linux', 'linux_layers', 'linux_like', 'loongarch', 'other_posix', 'powerpc', 'riscv', 'system_v', 'unix', 'unix_layers', 'unix_without_macos', 'webassembly', 'x86'})ΒΆ

A frozenset of all recognized group IDs.

Attention

This collection does not contain the UNKNOWN group.

extra_platforms.group_data.ALL_IDS: frozenset[str] = frozenset({'aarch64', 'aix', 'all_architectures', 'all_arm', 'all_ci', 'all_mips', 'all_platforms', 'all_sparc', 'all_traits', 'all_windows', 'altlinux', 'amzn', 'android', 'arch', 'arch_32_bit', 'arch_64_bit', 'arm', 'armv5tel', 'armv6l', 'armv7l', 'armv8l', 'azure_pipelines', 'bamboo', 'bsd', 'bsd_without_macos', 'buildkite', 'buildroot', 'cachyos', 'centos', 'circle_ci', 'cirrus_ci', 'cloudlinux', 'codebuild', 'cygwin', 'debian', 'dragonfly_bsd', 'exherbo', 'fedora', 'freebsd', 'gentoo', 'github_ci', 'gitlab_ci', 'guix', 'haiku', 'heroku_ci', 'hurd', 'i386', 'i586', 'i686', 'ibm_mainframe', 'ibm_powerkvm', 'illumos', 'kvmibm', 'linux', 'linux_layers', 'linux_like', 'linuxmint', 'loongarch', 'loongarch64', 'macos', 'mageia', 'mandriva', 'midnightbsd', 'mips', 'mips64', 'mips64el', 'mipsel', 'netbsd', 'nobara', 'openbsd', 'opensuse', 'oracle', 'other_posix', 'parallels', 'pidora', 'powerpc', 'ppc', 'ppc64', 'ppc64le', 'raspbian', 'rhel', 'riscv', 'riscv32', 'riscv64', 'rocky', 's390x', 'scientific', 'slackware', 'sles', 'solaris', 'sparc', 'sparc64', 'sunos', 'system_v', 'teamcity', 'travis_ci', 'tumbleweed', 'tuxedo', 'ubuntu', 'ultramarine', 'unix', 'unix_layers', 'unix_without_macos', 'wasm32', 'wasm64', 'webassembly', 'windows', 'wsl1', 'wsl2', 'x86', 'x86_64', 'xenserver'})ΒΆ

A frozenset of all recognized traits and group IDs.

Attention

This collection does not contain all the UNKNOWN_* traits and the UNKNOWN group.

extra_platforms.platform_data moduleΒΆ

Platform definitions and metadata.

Note

Default icons are inspired from Starship project: - https://starship.rs/config/#os - https://github.com/davidkna/starship/blob/e9faf17/.github/config-schema.json#L1221-L1269

Some icons, especially Linux distributions, have their own dedicated codepoints in NerdFonts.

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.pytest moduleΒΆ

Pytest decorators to skip tests depending on the platform they’re run on.

Generates a pair of ready-to-use @skip_<id> and @unless_<id> decorators for each platform and group.

extra_platforms.trait moduleΒΆ

Trait base class for architectures, platforms, CI systems, and more.

A trait represents a distinguishing characteristic of a runtime environment. Each trait has a unique ID, a human-readable name, an icon, and the ability to detect if it matches the current environment.

Data associated with traits can be aggressively cached and frozen, as they’re only computed based on environment-dependent values.